Re: Corruption of Static data in shared libraries
Re: Corruption of Static data in shared libraries
- Subject: Re: Corruption of Static data in shared libraries
- From: Andrew Kimpton <email@hidden>
- Date: Wed, 02 Nov 2005 21:34:46 -0800
Cameron Hayne wrote:
On 2-Nov-05, at 9:45 PM, Andrew Kimpton wrote:
I have two shared libraries (CFBundle plugins) which in turn each
load one additional shared library (different for each). I'm running
into a problem where static class variables seem to be corrupted
(often being 'reset' to zero)
This sort of thing might happen if the stack gets too big - e.g. if
you have large arrays on the stack. But I thought that current
versions of gcc had stack-overrun warnings at runtime.
Otherwise look for wild pointers that might be doing the overwriting.
I think you can get gdb to break when a particular location is
written to. Otherwise just narrow in on the problem by printing out
the value of the variable (the one that seems to get corrupted) as
you step through the code.
I don't think this is a memory corruption problem per-se - this code
runs fine under a variety of test scenarios (and I'll double check with
Guard Malloc turned on to be sure)..
Using the variable print trick doesn't help - I can see that the
variable is fine from the debugger in the preceeding stack frame. That's
why I don't think this is a 'corruption of the variable' problem as much
as a 'wonky base pointer' for the global data.
Andrew 8-)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden