public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug stdio/29459] New: fwrite does not return EPIPE when underlying write fails with EPIPE.
@ 2022-08-08 17:32 carlos at redhat dot com
  2022-08-08 17:33 ` [Bug stdio/29459] " carlos at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: carlos at redhat dot com @ 2022-08-08 17:32 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29459

            Bug ID: 29459
           Summary: fwrite does not return EPIPE when underlying write
                    fails with EPIPE.
           Product: glibc
           Version: 2.36
            Status: NEW
          Severity: normal
          Priority: P2
         Component: stdio
          Assignee: unassigned at sourceware dot org
          Reporter: carlos at redhat dot com
  Target Milestone: ---

This was reported downstream for CentOS 9 Stream here:
https://bugzilla.redhat.com/show_bug.cgi?id=2112672

The issue is an upstream issue that needs review.

The test case is attached from the downstream issue.

An strace shows the issue clearly:

1659979752.806415 write(1, "hello\n", 6) = 6
1659979752.806467 write(2, "1. fwrite wrote 6 bytes and ferror is 0\n", 40) =
40
1659979752.806517 write(1, "hello\n", 6) = -1 EPIPE (Broken pipe)
1659979752.806548 --- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER,
si_pid=202616, si_uid=1000} ---
1659979752.806563 write(2, "2. fwrite wrote 6 bytes and ferror is 1\n", 40) =
40

The underlying write fails with EPIPE, but fwrite doesn't itself fail.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-08-08 19:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-08 17:32 [Bug stdio/29459] New: fwrite does not return EPIPE when underlying write fails with EPIPE carlos at redhat dot com
2022-08-08 17:33 ` [Bug stdio/29459] " carlos at redhat dot com
2022-08-08 17:33 ` carlos at redhat dot com
2022-08-08 17:35 ` carlos at redhat dot com
2022-08-08 17:50 ` schwab@linux-m68k.org
2022-08-08 19:19 ` carlos at redhat dot com
2022-08-08 19:57 ` sam at gentoo dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).