discuss-gnustep
[Top][All Lists]
Advanced

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

Re: is handling of UncaughtException broken on my system?


From: Richard Frith-Macdonald
Subject: Re: is handling of UncaughtException broken on my system?
Date: Sat, 21 Feb 2009 10:20:55 +0000


On 21 Feb 2009, at 09:47, Truls Becken wrote:

sylvain wrote:
Hi,

the program below does not work as I would have expected on my system.

#include <Foundation/Foundation.h>
void MyEHandler(NSException* exception)
{
NSLog(@"exception: %@\n",exception);
}
int
main(int argc, const char *argv[])
{
id pool = [[NSAutoreleasePool alloc] init];
NSSetUncaughtExceptionHandler(MyEHandler);
/* compare function address, is ok */
NSLog(@"MyEHandler: %p\n",MyEHandler);
NSLog(@"MyEHandler: %p\n",NSGetUncaughtExceptionHandler());
[NSException raise:@"crash" format:@"no reason"];
[pool release];
return 0;
}

$ ./obj/brokenexception
2009-02-20 22:11:14.668 brokenexception[15643] MyEHandler: 0x8048804
2009-02-20 22:11:14.984 brokenexception[15643] MyEHandler: 0x8048804
Abandon

I have installed GNUStep on Ubuntu. Package version: 7.2

Is it a problem with me, the Ubuntu build or upstream?

Is the Ubuntu GNUstep Make configured with
--enable-native-objc-exceptions by any chance?

NSException does not call the uncaught exception handler if
_NATIVE_OBJC_EXCEPTIONS is defined. I guess it then becomes the
responsibility of libobjc. Is it a bug in libobjc not to do this?

Yes ... it's a known bug/missing-feature in libobj
There is a patch to fix it awaiting action by the libobjc maintainers.





reply via email to

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