delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/02/02/10:30:18

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4B684502.4070702@gmail.com>
Date: Tue, 02 Feb 2010 15:30:10 +0000
From: Andrew West <andrewwest AT gmail DOT com>
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: <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> <20100201174611 DOT GA26080 AT ednor DOT casa DOT cgf DOT cx> <20100201175123 DOT GB26080 AT ednor DOT casa DOT cgf DOT cx> <4B672B74 DOT 4090808 AT gmail DOT com> <4B673D5F DOT 4050104 AT gmail DOT com> <4B6746A5 DOT 3090203 AT gmail DOT com> <4B67F236 DOT 6020307 AT gmail DOT com> <20100202151612 DOT GA8308 AT ednor DOT casa DOT cgf DOT cx>
In-Reply-To: <20100202151612.GA8308@ednor.casa.cgf.cx>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 02/02/2010 15:16, Christopher Faylor wrote:
> On Tue, Feb 02, 2010 at 09:36:54AM +0000, Andrew West wrote:
>    
>> O.k. I've changed remove_dll_atexit to;
>>
>> remove_dll_atexit (const dll *d)
>>   {
>>
>>     unsigned char *dll_beg = (unsigned char *) d->handle + 0x1000;
>>     unsigned char *dll_end = (unsigned char *) d->p.data_start;
>>      
> According to gdb, setting dll_end to this is functionally equivalent to
> using AllocationBase + RegionSize.  I thought you tried that already.
>
> But, anyway...
>    

I think Dave Korn mentioned that it's possible for the .text to be 
broken into multiple regions, so perhaps RegionSize
only shows the size of one of those multiple regions. There's another 
message on the list with more detail, either way
for me AllocationBase + RegionSize didn't match p.data_start for me.

>    
>> I tested my changes against my simple test case and against my full program and they
>> both seems to work fine.
>>      
> I've gotten rid of remove_dll_atexit and implemented Dave's other idea of
> specifically calling cxa_atexit when atexit is called from a DLL.  I realize
> this morning that this might require some additional tweaking to preserve
> the same order of calling but that's easily done.
>
> I'm waiting for approval on a newlib patch before rolling a new snapshot
> for this.
>
>    

Good stuff, I'll keep an eye on the snapshot site and give it a test 
once it's up.

Thanks both for your work on this.

Andy

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019