This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/10412] New: undefined behavior when porting error()


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]