Re: "symbols hidden by default" causing runtime crashes
Re: "symbols hidden by default" causing runtime crashes
- Subject: Re: "symbols hidden by default" causing runtime crashes
- From: Stuart Smith <email@hidden>
- Date: Fri, 11 Jun 2010 14:11:51 -0700
- Thread-topic: "symbols hidden by default" causing runtime crashes
Here's a guess:
you have two symbols with the same name, one in your library, one in your
code.
In your code, you refer to the symbol, expecting to make a call into the
library.
If symbols are hidden, you end up referring to your code's symbol, which is
not what you expected, and you crash.
If symbols are not hidden, you call into the library and all is well.
Why, you ask, don't I get a "duplicate symbol" error from the linker when I
unhide the library's symbols? I don't know, but this has bitten us -
duplicate symbols, no duplicate symbol warning, crash at runtime.
Our solution was to rename the offending symbol in the library using the
preprocessor (a #define in the prefix header).
Stuart
on 6/10/10 11:30 AM, email@hidden at
email@hidden wrote:
> Message: 13
> Date: Thu, 10 Jun 2010 20:28:48 +0200
> From: Thijs Koerselman <email@hidden>
> Subject: "symbols hidden by default" causing runtime crashes
> To: email@hidden
> Message-ID:
> <email@hidden>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Not sure if this is Xcode related or gcc. I spend ages trying to
> figure out why my code was crashing when I discovered that the flag
> "symbols hidden by default" (GCC_SYMBOLS_PRIVATE_EXTERN) made all the
> difference. If I switch it on, it causes runtime memory corruption in
> a library I'm using.
>
> Is such a thing common? Is this something I have to blame the library
> for? I know it uses a lot of inlines, if that helps.
>
> It would be great to gain a little insight in what exactly causes such
> a thing. I don't want to spend this much time trying to track down the
> same problem again in the future:(
>
> Thijs
_______________________________________________
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