[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to find which variable owns memory?

From: Charlie Zender
Subject: How to find which variable owns memory?
Date: Sat, 3 Nov 2001 00:23:08 -0800


A combination of DDD, Electric Fence, and MALLOC_CHECK_ are all
telling me that a C++ program is attempting to delete[] invalid
memory, and these tools tell me the exact memory locations,
0x80fc411 in a2d_cls<float>::~a2d_cls (this=0xbfff9ca0, __in_chrg=2) at 

My question is, given the memory location, how can I identify
exactly which variable in a program is supposed to own the memory
stored at that location? Part of the problem is that the errors
sometimes occur as object are destroyed when the subroutine in
which they were declared is exited so they go out of scope,
so the errors occur "in between" my subroutines in very obscure
system code. Bottom line is I need to figure out which objects
supposedly own the memory which is not able to be delete[]d.
How best to do that? 

Any help appreciated,
Charlie Zender address@hidden (949) 824-2987/FAX-3256, Department of
Earth System Science, University of California, Irvine CA 92697-3100

reply via email to

[Prev in Thread] Current Thread [Next in Thread]