discuss-gnustep
[Top][All Lists]
Advanced

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

Re: signal SIGSEGV, Segmentation fault


From: Andreas Höschler
Subject: Re: signal SIGSEGV, Segmentation fault
Date: Tue, 22 May 2018 13:54:08 +0200

Hi Wolfgang,

Any further ideas?

Looking back at your initial report, it has this telling line about the crash:

Thread 1 "TimberNav" received signal SIGSEGV, Segmentation fault.
-[MapView drawRect:] (self=0xb7ca746e <-[NSView displayRectIgnoringOpacity:inContext:]+318>,
   _cmd=0x8a704b8, rect=...) at MapView.m:168
168           NSLog(@"routeVisible: %d", _routeVisible);
(gdb)

The self parameter in the call is a pointer into the code area of the program. So it looks like a serious memory management issue in your program where the MapView object that you intended to call the drawRect: method on has been released already and its memory been overwritten by some other code.

How do you see that the self pointer points to code area?

I have added a retain in the init method of MapView (dirty hack)

- (id)initWithFrame:(NSRect)frameRect
{
   NSLog(@"initWithFrame ...");
   self = [super initWithFrame: frameRect];
   [self retain];
   ...
}

to check your proposition and also did

- (void)dealloc
{
   NSLog(@"MapView dealloc");
   ...
   [super dealloc];
}

This changed nothing. The program still crashes at the same spot and MapView is never deallocated (at least dealloc not called)!? And remember, the app works perfectly well in two other environments (for whatever that's worth). 

Perhaps adding NSZombieEnabled=YES to the environment before running your program might already give you a clue.

You mean

export NSZombieEnabled=YES
openapp <application>

?

Thanks,

 Andreas


reply via email to

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