Re: Global variable in static library - double free or corruption error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/21/2010 05:23 PM, Jeffrey Walton wrote:
>> that there can only ever be one definition of a symbol in a program, and
>> UNIX has always merged multiple definitions to achieve this
> Does the rule include that gloabl object destructors are to run on
> every unload, or the last/final unload or last call to dlclose (when
> the shared object gets unmapped)?

I suspect that Bad Things would happen.  :-)

As far as I know, they are run, and if you have two definitions
of some object with a destructor, then you violate the ODR rule,
and it's all your fault!

> Many folks don't expect their
> objects will be pulled out from under them until the last unload. It
> seems like a reasonable expectation to me.

Sure, but you break the rules, you get to keep all the pieces.

Andrew.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux