Re: Stack frame incorrect on stack unwinding during exception
nickdu wrote:
Just want to add another bit of information. When I changed:
void Validate()
{
std::string x;
.
.
.
if (x.length() != 0)
T_OLEDB_ERR_DEADLY_STR(x.c_str());
}
To:
void Validate()
{
std::string x;
.
.
.
try
{
if (x.length() != 0)
T_OLEDB_ERR_DEADLY_STR(x.c_str());
}
catch(...)
{
throw;
}
}
The exception during stack unwinding goes away which indicates the
stack
frame was correct when destructing my local STL string 'x'.
I suspect, as Bruno suggests, that there's a good chance that the exception
still ocurred but was simply swallowed by the catch(...). It's also
possible that if there's really a code gen bug that adding another try/catch
frame got around the bug.
Your class definition includes several overloads of
Exception::raiseException. What does the one that's being invoked look
like? You're definitely skating close to undefined behavior since you're
using .c_str() on a string that's going to be destroyed by the exception
throw. You haven't posted enough code yet to make any conclusions though.
Keep working on that smaller repro case, and if you can, please post the
definition of the overload of raiseException that's being called.
-cd