Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: serious bug in dyld ?



Etienne,

There are some fairly serious implementation flaws with dyld anyway, but
really only if you are using C++ with static intialization. I don't know
if you've found a different problem or not. Unfortunately, the order of
static initialization is not garunteed with dyld. For example, if you
have two libraries that initialize static data from a C++ class, and the
first one is called but _before_ the initialization is done references the
initialization routine of the second library (ie needs a class from that
library that _also_ has static C++ data), then it interrupts the first
libraries init routine and never comes back. At least thats a general
idea. There are many problems this could cause, not in the least wierd
effects that have no relation to anything you're used to :) And they are
hard to debug.

Advanced/complicated C++ code (namely STLport in my case) does not play
well with dyld. The current solution I'm using is to link every library
with "bind at load" and "-single_module" and hope for the best. Note that
prebinding is another can of worms in this case and cannot be used at all.

Dan

On Wed, 11 Feb 2004, Etienne Petitjean wrote:

> Hello,
>
> I have been chasing a nasty bug for the past few hours where my
> application memory heap gets corrupted while debugging my program with
> XCode.
>
> after tracing the code with GDB, I found that my heap gets corrupted
> after a call to __dyld_link_in_need_modules in
> __dyld_bind_lazy_symbol_reference.
>
> my malloced memory gets corrupted every time. It looks like a
> potentially serious bug to me.
> Has anyone noticed this kind of problem ?
>
> My project is a pure C++ project and the code is compiled with the
> standard "Development" build style.
> I'm using XCode 1.1 and gcc 3.3 (build 1495) on a G5 with Mac OS X
> 10.3.2
>
> Thanx,
>
> Etienne Petitjean
> _______________________________________________
> darwin-development mailing list | email@hidden
> Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >serious bug in dyld ? (From: Etienne Petitjean <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.