Re: Exceptions thrown from framework not caught in application
Re: Exceptions thrown from framework not caught in application
- Subject: Re: Exceptions thrown from framework not caught in application
- From: Andreas Grosam <email@hidden>
- Date: Wed, 13 Sep 2006 23:54:33 +0200
On 12.09.2006, at 19:42, Steve Baxter wrote:
Hi Andreas,
On 12 Sep 2006, at 16:40, Andreas Grosam wrote:
On 08.09.2006, at 01:38, Steve Baxter wrote:
I wish Apple would fix this - the fix is a single line of code.
Unfortunately it is not considered to be a bug...
radt://4424486
The biggest problem with this right now is that on 10.3.9 this is
completely broken. If you want to target 10.3.9 and you want to use
RTTI or exceptions across a DSO (module/framework/application)
boundary, you cannot use GCC 4.x.
radr://4535751
If we assume the source code has been correctly decorated with export
directives, what exactly (the more detailed the better) is the
problem (namely the bug/flaw which you refere with "broken") in the
system 10.3.9?
I'm not using export directives, instead all symbols are exported from
all DSOs (GCC_SYMBOLS_PRIVATE_EXTERN = NO)
Does 10.4.x work correctly?
Yes. I believe the bug is in the CRT that comes with 10.3.9. It
fails to correctly resolve duplicate symbols across DSOs under some
circumstances.
It should be noted that in order to enable exception thrown across
DSOs, the symbols for RTTI for that exception classes need to be
instantiated only once in the fully linked application.
Indeed.
Does this problem you refere to occure during static linking, or is
it restricted to dynamically linking via dyld when linking shared
libs, or is it restricted when dynamically binding plugins?
Only when dynamically binding plugins as far as I know.
Unfortunately, i can confirm now, that this issue also happens with
shared libraries, which comprise a legal application. I created the
application in Xcode 2.4 on 10.4.7.
On 10.4.x, the application works correctly. On 10.3.9 it fails.
It is pretty much obvious that the dynamic linker on 10.3.9 is unable
to merge several definitions of coalesced weak symbols. For RTTI this
kind of symbol will be produced quite often - but not always, the
alternative is to use undefined references.
More specifically, if a RTTI symbol (in this example for the class
Error) is defined in more than one DSO like this:
000041c8 (__DATA,__const_coal) weak external __ZTI5Error
the dyld of 10.3.x fails to coalesce the definitions into a single one,
and hence the ODR will be violated.
I failed also to find a workaround so far, like forcing to create the
RTTI definition where the class ctor is defined, and subsequently
*reference* to existing RTTI symbols instead creating new definitions
in the calling DSO. However the compiler preferes to create new
definitions anyway,
Andreas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden