> I have a problem with a structure (linked list), that gets corrupted,
> if I use a specific shared library.
[quoted text clipped - 13 lines]
>
> Thanks, Lothar
Write a function, named "Probe", that prints a string if the linked list
is corrupt (possibly by keeping a second linked list and comparing the
two.) Put a breakpoint on Probe's print statement. Sprinkle your code
with Probe and re-run it until you pin down the offending line. Remember
that you may be able to run Probe from gdb, so you Probe inside the line.
lothar.behrens@lollisoft.de - 09 Nov 2005 20:35 GMT
I thougth about three structures to be managed. It is uncertain that
two structures
get corrupted. This way, even one is corrupted, I could use one of the
two, that are
equal.
But this may be too much work. Better would be, if there is a way to
protect the area
against unwanted access and only set read write access, when the
functions that have
to access the structure.
On Windows this would be a protection fault, I could use to detect the
point of fault.
Is there a similar way on PPC ?
Thanks, Lothar
Greg - 13 Nov 2005 13:45 GMT
> I thougth about three structures to be managed. It is uncertain that
> two structures
[quoted text clipped - 14 lines]
>
> Thanks, Lothar
Yes, read the malloc man page for the complete list of environment
malloc debug variables.
The easiest way to debug the program though is probably to use Apple's
MallocDebug application that is part of Developer tools. MallocDebug
will launch the program with the appropriate debug libraries and memory
guards and provides a complete GUI to boot.
If MallocDebug can't find the problem, then I would try the more
time-consuming and less developer-friendly command-line approach using
environment variables.
Greg