Re: pointer address changes for no reason
Re: pointer address changes for no reason
- Subject: Re: pointer address changes for no reason
- From: "Ewan Delanoy" <email@hidden>
- Date: Sat, 7 Apr 2007 12:57:00 +0200 (CEST)
- Importance: Normal
>
>> What I don't understand here is why the
>> pointer address
>> changed ?
>
> I've seen this happen before on Intel Macs when a buffer overrun
> occurred elsewhere. Try running your app in Guard Malloc and see if
> it crashes while running your code.
>
> Nick Zitzmann
I also tested the app with MallocDebug (trying both the options in the
Preferences :
with or without "Clear malloc'd memory when freed"), but it does not
provide more
information than running the app unbder gdb. The main stumbling block remains
the same : a pointer becomes changed against my will and without
me knowing it, and all the debugging tools start noticing something only
far too late, when my code calls the pointer that has become invalid.
I have no way to know when and how the pointer's address was changed. Ideally
I would like to use a "global" watchpoint on my numPagesField IBoutlet,
but such
a tool does not exist ...
Ewan
Output when running the app with MallocDebug :
A panel appears, saying "Target application crashed
/Users/ewan/Documents/Computing/Aaron/Brouilhedou/Schreiben/build/Debug/Schreiben.app/Contents/MacOS/Schreiben
accessed memory at 0x00000015 illegally."
Output when running the app with gdb :
Program received signal: "SIGBUS".
libMallocDebug[Schreiben-299]: Target application (pid 299) attempted to
access memory at 0x00000015 with insufficient permissions.
libMallocDebug[Schreiben-299]: MallocDebug can't do anything about this,
so the app's just going to have to be terminated.
libMallocDebug[Schreiben-299]:
*************************************************
libMallocDebug[Schreiben-299]: THIS IS A BUG IN THE PROGRAM BEING RUN
UNDER MALLOC DEBUG,
libMallocDebug[Schreiben-299]: NOT A BUG IN MALLOC DEBUG!
libMallocDebug[Schreiben-299]:
*************************************************
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden