X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SARE_BAYES_5x8,SPF_PASS X-Spam-Check-By: sourceware.org Message-ID: <4B67E3C8.1050500@gmail.com> Date: Tue, 02 Feb 2010 08:35:20 +0000 From: Andrew West User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: dlclose not calling destructors of static variables. References: <4B61732F DOT 4030804 AT gmail DOT com> <4B62DDE6 DOT 5070106 AT gmail DOT com> <4B62F118 DOT 8010305 AT gmail DOT com> <20100129184514 DOT GA9550 AT ednor DOT casa DOT cgf DOT cx> <4B66BF2F DOT 4060802 AT gmail DOT com> <20100201162603 DOT GB25374 AT ednor DOT casa DOT cgf DOT cx> <4B6710CE DOT 40300 AT gmail DOT com> <4B675932 DOT 9040908 AT gmail DOT com> In-Reply-To: <4B675932.9040908@gmail.com> Content-Type: multipart/mixed; boundary="------------080201060807000400070101" X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --------------080201060807000400070101 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------080201060807000400070101 Content-Type: text/plain; name="objdump.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="objdump.txt" libeffect_loader_d.dll: file format pei-i386 Sections: Idx Name Size VMA LMA File off Algn 0 .text 00061380 63941000 63941000 00000600 2**4 CONTENTS, ALLOC, LOAD, CODE, DATA 1 .data 000095a8 639a3000 639a3000 00061a00 2**5 CONTENTS, ALLOC, LOAD, DATA 2 .rdata 00000010 639ad000 639ad000 0006b000 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 3 .eh_frame 0000015c 639ae000 639ae000 0006b200 2**2 CONTENTS, ALLOC, LOAD, DATA 4 .bss 00001540 639af000 639af000 00000000 2**3 ALLOC 5 .edata 0007d0bf 639b1000 639b1000 0006b400 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 6 .idata 00003660 63a2f000 63a2f000 000e8600 2**2 CONTENTS, ALLOC, LOAD, DATA 7 .reloc 000029b8 63a33000 63a33000 000ebe00 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 8 .debug_aranges 0000a748 63a36000 63a36000 000ee800 2**0 CONTENTS, READONLY, DEBUGGING 9 .debug_pubnames 000d5737 63a41000 63a41000 000f9000 2**0 CONTENTS, READONLY, DEBUGGING 10 .debug_info 002cfa26 63b17000 63b17000 001ce800 2**0 CONTENTS, READONLY, DEBUGGING 11 .debug_abbrev 0000e136 63de7000 63de7000 0049e400 2**0 CONTENTS, READONLY, DEBUGGING 12 .debug_line 0002872a 63df6000 63df6000 004ac600 2**0 CONTENTS, READONLY, DEBUGGING 13 .debug_frame 0002632c 63e1f000 63e1f000 004d4e00 2**2 CONTENTS, READONLY, DEBUGGING 14 .debug_str 0000bcb1 63e46000 63e46000 004fb200 2**0 CONTENTS, READONLY, DEBUGGING 15 .debug_loc 00043d0d 63e52000 63e52000 00507000 2**0 CONTENTS, READONLY, DEBUGGING 16 .debug_ranges 0000c628 63e96000 63e96000 0054ae00 2**0 CONTENTS, READONLY, DEBUGGING --------------080201060807000400070101 Content-Type: text/plain; charset=us-ascii -- 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 --------------080201060807000400070101--