This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/10412] New: undefined behavior when porting error()
- From: "ebb9 at byu dot net" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 18 Jul 2009 13:13:20 -0000
- Subject: [Bug libc/10412] New: undefined behavior when porting error()
- Reply-to: sourceware-bugzilla at sourceware dot org
Within glibc, it is always safe to call fflush (stdout), even if stdout has been
previously closed. However, POSIX does not require this guarantee, and there
are other platforms where attempting a flush in this situation causes a SIGSEGV:
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18046/focus=18052
Since gnulib ports the error.c file to many other platforms, but wants to keep
it in sync with glibc's version, it would be nice for glibc to apply this patch
for portability. The attached patch makes the optimization of not calling fcntl
on glibc, while still fixing the crash from the original gnulib report.
--
Summary: undefined behavior when porting error()
Product: glibc
Version: 2.10
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: ebb9 at byu dot net
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=10412
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.