Skip navigation.
 
mlRe: pointer address changes for no reason
FROM : Ewan Delanoy
DATE : Sat Apr 07 12:57:00 2007

>

>> 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]:
*************************************************

Related mailsAuthorDate
mlpointer address changes for no reason Ewan Delanoy Apr 6, 18:43
mlre: pointer address changes for no reason Erik Buck Apr 6, 19:26
mlRe: pointer address changes for no reason Nick Zitzmann Apr 6, 20:16
mlRe: pointer address changes for no reason Ewan Delanoy Apr 7, 12:57
mlRe: pointer address changes for no reason Scott Ribe Apr 9, 02:55
mlRe: pointer address changes for no reason Ewan Delanoy Apr 9, 10:08
mlRe: pointer address changes for no reason Nick Zitzmann Apr 9, 18:05
mlRe: pointer address changes for no reason Scott Ribe Apr 9, 19:40
mlRe: pointer address changes for no reason John Stiles Apr 10, 20:22
mlRe: pointer address changes for no reason Bill Bumgarner Apr 10, 20:32
mlRe: pointer address changes for no reason Ewan Delanoy Apr 11, 09:47
mlRe: pointer address changes for no reason Scott Ribe Apr 11, 18:07
mlRe: pointer address changes for no reason Ewan Delanoy Apr 11, 18:38
mlRe: pointer address changes for no reason Michael Babin Apr 12, 22:45
mlRe: pointer address changes for no reason (SOLVED) Ewan Delanoy Apr 13, 10:42