public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: cygwin@cygwin.com
Subject: Re: Regression (last snapshot)
Date: Fri, 02 Aug 2019 21:58:00 -0000	[thread overview]
Message-ID: <1d2c03d5-8534-405e-b150-c899508712fc@redhat.com> (raw)
In-Reply-To: <400eebe3-3ba9-5448-85a8-92e6e0dfdf0c@cornell.edu>


[-- Attachment #1.1: Type: text/plain, Size: 1608 bytes --]

On 8/2/19 4:53 PM, Ken Brown wrote:

>>> Putting this all together, Eric's explanation is indeed correct.  All
>>> processes created by xwin-xdg-menu via fork/exec inherit the property of
>>> ignoring SIGPIPE.
>>>
>>> I don't know if this is a bug, but it certainly leads to surprising
>>> behavior.  Jon, maybe xwin-xdg-menu needs to call signal(SIGPIPE,
>>> SIG_DFL) either after calling gtk_init() or before calling exec()?
>>
>> How does that relate to this only happening in the latest snapshot, and not in
>> the current release, or any Linux system?
> 
> It does happen in the current release, as I said earlier in the thread.
> 
> There's no way to test it on Linux.  xwin-xdg-menu is a Cygwin-specific 
> program (written by Jon).

>> I would certainly expect any shell (or any other program handling pipes) to set
>> or reset SIGPIPE handling, rather than accept any default.
> 
> Take a look at the bash source code and the grep source code.  You'll 
> see that neither one of them does this.  And I don't know why you would 
> expect it.

Worse, POSIX explicitly requires that the shell is unable to reset
SIGPIPE back to SIG_DFL if it was inherited ignored (try it - you CANNOT
use the 'trap' command to undo an inherited ignored SIGPIPE, even though
it can be used to undo signals ignored locally). It is generally
considered bad practice to leak ignored SIGPIPE into a child process,
even if it makes sense in the parent process.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-08-02 21:58 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-20 22:55 Houder
2019-07-21  9:38 ` Houder
2019-07-21  9:42   ` Houder
2019-07-22 12:23 ` Ken Brown
2019-07-22 13:44   ` Ken Brown
2019-07-22 15:20     ` Corinna Vinschen
2019-07-22 15:53       ` Corinna Vinschen
2019-07-22 16:45         ` Corinna Vinschen
2019-07-22 18:47           ` Houder
2019-07-26 22:12             ` Ken Brown
2019-07-27  0:14               ` Ken Brown
2019-07-27 10:21               ` Houder
2019-07-27 15:24                 ` Ken Brown
2019-07-27 16:25                   ` Houder
2019-07-29  8:45                   ` Corinna Vinschen
2019-07-29 13:18                     ` Ken Brown
2019-07-29 13:35                       ` Ken Brown
2019-07-29 13:48                         ` Corinna Vinschen
2019-07-29 13:47                       ` Corinna Vinschen
2019-07-29 14:26                         ` Ken Brown
2019-07-29 15:23                           ` Corinna Vinschen
2019-07-29 15:40                             ` Corinna Vinschen
2019-07-29 18:56                               ` Ken Brown
2019-07-31 15:53                                 ` Ken Brown
2019-07-31 18:00                                   ` Ken Brown
2019-08-01  9:01                                     ` Corinna Vinschen
2019-08-01 14:27                                     ` Jon Turney
2019-08-01 15:30                                       ` Ken Brown
2019-08-01 15:38                                         ` Eric Blake
2019-08-01 16:04                                           ` Corinna Vinschen
2019-08-01 21:17                                             ` Ken Brown
2019-08-02  2:32                                               ` Ken Brown
2019-08-02 14:34                                                 ` Ken Brown
2019-08-02 15:04                                                   ` Corinna Vinschen
2019-08-02 21:26                                                   ` Brian Inglis
2019-08-02 21:53                                                     ` Ken Brown
2019-08-02 21:58                                                       ` Eric Blake [this message]
2019-08-03  3:50                                                         ` Brian Inglis
2019-08-03 13:14                                                           ` Ken Brown
2019-08-04 16:52                                                   ` Houder
2019-08-01 10:03                                   ` Houder
2019-08-01 10:46                                     ` Houder
2019-08-01 12:20                                     ` Ken Brown
2019-08-01 14:29                                       ` Houder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1d2c03d5-8534-405e-b150-c899508712fc@redhat.com \
    --to=eblake@redhat.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).