Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Date: Tue, 10 May 2005 12:09:04 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Static destructors not running Message-ID: <20050510160904.GF15665@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <48781a66050509154660edcc78 AT mail DOT gmail DOT com> <48781a6605051006066aa9b036 AT mail DOT gmail DOT com> <20050510153512 DOT GZ15665 AT trixie DOT casa DOT cgf DOT cx> <48781a66050510085450bd1339 AT mail DOT gmail DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48781a66050510085450bd1339@mail.gmail.com> User-Agent: Mutt/1.5.8i On Tue, May 10, 2005 at 11:54:45AM -0400, William M. (Mike) Miller wrote: >On 5/10/05, Christopher Faylor wrote: >> On Tue, May 10, 2005 at 09:06:36AM -0400, William M. (Mike) Miller wrote: >> >I'm still left with the problem of figuring out what changed to cause >> >this result. Until I ran the "setup" application last Friday, I was >> >seeing output from static destructors, and now I don't. It would >> >save me a lot of work to be able to restore the old behavior, but I >> >don't know what was responsible for this change. >> >> Just as a wild guess, does explicitly calling exit help at all? > >Yes, the output does appear when I call exit instead of returning >from main(). Unfortunately, that's not an option. For one thing, >this is shared code that works just fine on other systems (and >under Cygwin until I updated last Friday). For another, the >semantics of calling exit in main() are not exactly the same as >returning from main() -- local automatic objects in main() are not >destroyed by the exit() call, which is something some of this >code that is now failing relies on. I was trying to figure out the problem, not suggest that you should change all of your code. Previous to 1.5.16, static destructors were always called via a gcc "atexit" mechanism. This meant that there were scenarios where destructors would not be called at all so I made cygwin's exit call the destructors explicitly. I just forgot to make cygwin do the right thing when returning from main rather than exiting. This will be fixed in the next snapshot. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/