RE: carbon throwing objc exceptions
RE: carbon throwing objc exceptions
- Subject: RE: carbon throwing objc exceptions
- From: Nathan Herring <email@hidden>
- Date: Tue, 15 Sep 2009 21:58:50 +0000
- 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=email@hidden [mailto:darwin-dev-bounces+nathanh=email@hidden] 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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden