[RFC] libgfortran dll i/o redirection lossage caused by order-of-termination issue

Dave Korn dave.korn.cygwin@googlemail.com
Fri Jul 10 13:58:00 GMT 2009

Christopher Faylor wrote:
> On Fri, Jul 10, 2009 at 12:43:44AM +0100, Dave Korn wrote:
>> Christopher Faylor wrote:
>>>> That's bad.  The call to newlib's __cleanup() hook shuts down stdio
>>>> facilities, and so when libgfortran DLL's dtors are finally called,
>>>> they attempt to flush the buffer down already-closed stdio channels,
>>>> and it gets silently dropped on the floor.
>>> Yep.  Longstanding issue.  I thought you couldn't guarantee that a
>>> global destructor would be able to do I/O.
>> Do you have a reference?  I couldn't see anything in gABI, n2800 or
>> cxx-abi that really obviously looked like it said that to me.
> I couldn't find one either.  I can't remember if this is something I
> read or something I just felt we had to live with.  I think it's
> probably the latter.

  Hopefully we'll turn out not to, after all.

> My only request is that *this time* we add volumnious documentation with
> references.  Oh how I wish I could time travel back and knock myself
> over the head with this simple requirement.

  I'll add a new how- document while I'm at it.


More information about the Cygwin-developers mailing list