RE: carbon throwing objc exceptions
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Thread-index: AQHKNX3ygeYV2+Z12k+e/p33wOh/FJDXDfCAgAElHtA= Thread-topic: carbon throwing objc exceptions I have separately made the suggestion, via rdar://7225898, that Apple move ObjC[++] to use libUnwind, so that callbacks of any kind would see this as a (possibly foreign) exception, and would either (1) terminate due to un-unwindability (rather than quietly unwind stack that cannot be unwound), (2) allow for standard exception handling, including catching and rethrowing for finally-like behavior. This would have some benefit towards a more unified exception model. -----Original Message----- From: darwin-dev-bounces+nathanh=microsoft.com@lists.apple.com [mailto:darwin-dev-bounces+nathanh=microsoft.com@lists.apple.com] On Behalf Of Joel Reymont Sent: Monday, September 14, 2009 2:25 PM To: Shawn Erickson Cc: darwin dev Subject: Re: carbon throwing objc exceptions Sean, On Sep 14, 2009, at 9:57 PM, Shawn Erickson wrote:
Why are you attempting to catch the except at all? It looks like no attempt is made to deal with the exception and in general exceptions in Cocoa are truly exceptional and imply a mistake by the programmer.
Quoting from an existing bug [2]: "If a cocoa exception is thrown in the middle of a gecko callback, really bad things happen (like you can no longer load any pages, for example). Cocoa exceptions are basically setjmp/longjmp, and, presumably, without a handler, will jump back to the main event loop's default handler. This will unwind the stack without any stack cleanup."
I wouldn't attempt to catch the exception but instead let a top level handler get it and then make a decision to log at that point (look at NSExceptionHandler).
This is of no use since the issue is C++ stack unwinding [1]. More he
Also CoreFoundation is not Carbon.
My bad. Thanks, Joel [1] https://wiki.mozilla.org/Cocoa_In_XPCOM [2] https://bugzilla.mozilla.org/show_bug.cgi?id=163260 --- fastest mac firefox! http://wagerlabs.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/nathanh%40microsoft.com This email sent to nathanh@microsoft.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Nathan Herring