dlclose not calling destructors of static variables.

Andrew West andrewwest@gmail.com
Tue Feb 2 08:35:00 GMT 2010


On 01/02/2010 22:44, Dave Korn wrote:
> On 01/02/2010 17:35, Andrew West wrote:
>
>    
>> But the atexit function is registered at 0x706c10f0. Changing
>> AllocationBase to BaseAddress worked for my test case out of pure luck,
>> with my larger libraries it still failed.
>>      
>    I've managed to convince myself it's right actually.
>
>    
>> Looking at one of the libraries in my code that fails I get ( with the
>> atexit at 0x78351c9 )
>>
>> remove_dll_atexit;
>> m.AllocationBase = 0x7820000
>> m.AllocationBase + m.RegionSize = 0x7824000
>>
>> GDB;
>> from = 0x07821000
>> to = 0x079159b8
>>      
>    Please post the output of "objdump -h" on this library.  (If there's no
> problem doing so, please send me a copy of the binary off-list.)
>
>      cheers,
>        DaveK
>
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>    
I've attached the objdump -h output. Looks like the library was 
relocated in memory, but if I do;

0x63940000 + (  0x78351c9 - 0x7820000 ) = 0x639551c9

Checking the assembly dump from objdump and the destructor is there at
0x6394632b, it's just a simple call to the base classes destructor. The 
only thing that might be of interest is that the base classes
destructor is in another shared library. Then again cygwin isn't even 
managing to call the original destructor so I can't see how that
might effect things.

Andy
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: objdump.txt
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100202/a39232be/attachment.txt>
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list