discuss-gnustep
[Top][All Lists]
Advanced

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

Re: [Q] Segmentation Fault error of AddressManager.app


From: Richard Frith-Macdonald
Subject: Re: [Q] Segmentation Fault error of AddressManager.app
Date: Mon, 13 Oct 2003 08:52:04 +0100


On Monday, October 13, 2003, at 08:04 AM, Björn Giesler wrote:

Hi,

On 2003-10-13 08:00:57 +0200 NeXT <chunsj@embian.com> wrote:
it died with segmentation fault error. What I've found is wakeFromNib of
Controller.m has a problem. -setFillsSuperview:
needs a super view but current code does not set superview before above

Yes. Thanks for pointing that out; I fixed it. Strange that it segfaults on your machine, though -- [self superview] should return nil, and sending messages to nil is OK, so [[self superview] frame] should return a bogus rect, but shouldn't segfault, and on my box it doesn't. Strange.

FYI sending a -frame message to nil will return nil ... a pointer rather than a structure (the expected NSRect).

On Intel hardware this tends to just mean that a garbage rect is returned, but on other hardware it's common that this results in a segfault instead. Basically, the convention that it's ok to send a message to nil is strictly only true if the expected return type is an object, though as far as I know it's ok on all real machines for
void, scalar, and pointer return types as well.

Certainly, if the return type is a structure or a float/double you should be careful that you are not sending
the message to nil.





reply via email to

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