[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undefined behavior in closeout, aggravated by libsigsegv

From: Jim Meyering
Subject: Re: undefined behavior in closeout, aggravated by libsigsegv
Date: Sat, 18 Jul 2009 10:42:54 +0200

Eric Blake wrote:
> But even if cygwin is improved to not trigger an internal fault, and/or
> libsigsegv changed to not interfere with cygwin's detection of internal 
> faults,
> it seems that the real root cause is that gnulib has caused the application to
> perform undefined behavior during the atexit() handler, and that we should fix
> this before it trips up other platforms.  What's the best way to do that?  
> Have
> close_stdout call freopen("/dev/null","w",stdout) prior to calling error()?
> Convince the glibc folks to change error() to not call fflush(stdout) if 
> fileno
> (stdout) is closed?  Rewrite close_stdout to open-code the error-printing
> actions instead of calling error()?  Something else?

How about fixing gnulib's lib/error.c to do the right thing?
Then if you teach m4/error.m4 to detect when glibc's error function
is defective (currently always) it can use the improved replacement.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]