[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] C++ Debuggery and the Path of Destruction
- Subject: [ale] C++ Debuggery and the Path of Destruction
- From: rountree at cs.uga.edu (Barry Rountree)
- Date: Fri Sep 24 21:09:57 2004
- In-reply-to: <[email protected]>
- References: <[email protected]>
On Friday 24 September 2004 08:41 pm, John Mills wrote:
> ALErs -
>
> Naturally, I got a bit too clever
It's almost certainly going to be easier to rewrite it as something less
clever, but hey, where's the fun in that?
;-)
> Any suggestions how to track this self-administered wedgie down?
Any chance of posting some code?
I finally gave up on getting memory management right the first (second,
nth...) time and started populating my code with debug statements to the
effect of:
__FILE__::__LINE__ is now creating a __WHATEVER__, address 0xabcddcab
__FILE__::__LINE__ is now deleting a __WHATEVER__, address 0xabcddcab
This made me look like a rank amateur, but also a rank amateur who generally
was able to leave at 5pm.
You can also try zeroing out the object's memory during destruction -- that
might let you segfault a bit sooner at a more useful location.
Combine the two and you should see an object getting freed that is later
referenced.
Good luck!
Barry
>
> TIA.
>
> - John Mills
> john.m.mills at alum.mit.edu
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale