This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Re: [1.7.0-60] crash on exit on c++ program (octave)
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-developers at cygwin dot com
- Date: Fri, 21 Aug 2009 10:57:42 +0200
- Subject: Re: [1.7.0-60] crash on exit on c++ program (octave)
- References: <206392.72071.qm@web25503.mail.ukl.yahoo.com> <4A8D9F58.20707@gmail.com> <4A8DAE21.3040903@gmail.com>
- Reply-to: cygwin-developers at cygwin dot com
On Aug 20 21:12, Dave Korn wrote:
> Dave Korn wrote:
> > We should probably make running the dtors idempotent, or unlink each dll
> > from the dll_list as we go. I need to think about this for a little while,
> > more later.
>
> The solution could be as simple as this. Just don't call dtors for dlopen'd
> DLLs when we run the global dll dtors. If the application dlcloses them,
> their dtors get run then. If it doesn't, they'll be run much later when the
> dlopen'd module receives DLL_PROCESS_DETACH as everything is being closed.
> Only thing I'm wondering about is if we shouldn't forcibly dlclose any
> left-over modules as part of the dtors sequence so that they run before the
> newlib i/o shutdown. Anyone got an opinion?
I think the dlclose call should be enforced for left-over modules. We
can use the below as temporary patch to avoid the crash for now.
Corinna
>
> cheers,
> DaveK
> Index: winsup/cygwin/dll_init.cc
> ===================================================================
> RCS file: /cvs/src/src/winsup/cygwin/dll_init.cc,v
> retrieving revision 1.65
> diff -p -u -r1.65 dll_init.cc
> --- winsup/cygwin/dll_init.cc 13 Aug 2009 07:35:49 -0000 1.65
> +++ winsup/cygwin/dll_init.cc 20 Aug 2009 19:28:11 -0000
> @@ -35,7 +35,8 @@ dll_global_dtors ()
> dll_global_dtors_recorded = false;
> if (recorded && dlls.start.next)
> for (dll *d = dlls.end; d != &dlls.start; d = d->prev)
> - d->p.run_dtors ();
> + if (d->type != DLL_LOAD)
> + d->p.run_dtors ();
> }
>
> /* Run all constructors associated with a dll */
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat