GNU bug report logs - #23031
reporting write errors and handling SIGPIPE

Previous Next

Package: grep;

Reported by: Assaf Gordon <assafgordon <at> gmail.com>

Date: Wed, 16 Mar 2016 16:15:02 UTC

Severity: normal

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 23031 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Assaf Gordon <assafgordon <at> gmail.com>, 23031 <at> debbugs.gnu.org
Subject: Re: bug#23031: reporting write errors and handling SIGPIPE
Date: Wed, 16 Mar 2016 14:23:15 -0700
On 03/16/2016 09:14 AM, Assaf Gordon wrote:
> write(1, "2\n", 2)                      = -1 EPIPE (Broken pipe)
>    --- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=2893, 
> si_uid=1004} ---
>    write(2, "./src/grep: ", 12)            = 12 

Although this looks weird and it's not what I would expect, it's not a 
POSIX violation as far as I can see. The system is required to send a 
SIGPIPE signal in this case, but it is not required to deliver the 
SIGPIPE signal before 'write' returns with errno == EPIPE. Arguably it's 
a bug in GNU/Linux anyway.

Your patch is a step in the right direction, but needs a bit of cleanup; 
I plan to look into it more carefully later. Thanks!




This bug report was last modified 9 years and 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.