Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Diagnosis of failure to destruct on exception

0 views
Skip to first unread message

Brian Havard

unread,
Jan 7, 2019, 11:34:55 PM1/7/19
to
I'm trying to figure out why an object on the stack doesn't have its
destructor called when a C++ exception is thrown in a fairly complex
section of code (a recursive descent scripting language interpreter).

It's looking to me to be a compiler/runtime/optimiser bug because it
works correctly in full debug mode (-d2) or when built with gcc on
Linux. However, it's quite possibly a bug in my code that is interfering
with the clean up process.

Does anyone understand how the runtime tracks objects that need to be
cleaned up when the stack is unwound or have any advice on how to
diagnose the issue?

The object in question is a custom auto pointer I've written that tracks
references by forming a ring of auto pointer objects so the failure to
destruct one leads to dangling pointers and a crash.
0 new messages