Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16094

signals ignored in a subshell

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Oğuz <oguzismailuysal@gmail.com>
Newsgroups gnu.bash.bug
Subject signals ignored in a subshell
Date Mon, 6 Apr 2020 15:03:45 +0300
Lines 36
Approved bug-bash@gnu.org
Message-ID <mailman.240.1586174629.2644.bug-bash@gnu.org> (permalink)
References <CAH7i3LqUZcV6shJv6nQoRkLp-zhBgTpWaUPKdzZwVC-W_0e8yw@mail.gmail.com> <23276.1586024838@jinx.noi.kre.to> <CAH7i3Lr5TTK+N-qC39+nmSo7jjhzDvPux39N4i2MyP5LCnnv5w@mail.gmail.com> <16086.1586068489@jinx.noi.kre.to> <CAH7i3LrwPy9J9+8BPgvT+BGtv39nQJ2H-prxWXu7mHYZ8UjodQ@mail.gmail.com> <45c766ba-4489-bd7b-40c7-32fed37461f9@case.edu> <CAH7i3Lr5zBub6yObXkwV78E0Oyct-bAu2+D2hocpT8NNyBqHLg@mail.gmail.com>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
X-Trace usenet.stanford.edu 1586174629 16165 209.51.188.17 (6 Apr 2020 12:03:49 GMT)
X-Complaints-To action@cs.stanford.edu
Cc Robert Elz <kre@munnari.oz.au>, "bug-bash@gnu.org" <bug-bash@gnu.org>
To "chet.ramey@case.edu" <chet.ramey@case.edu>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=exeocQov1gI/dxlli7+g4+BWOY8Q7jcUAHqPkGnXh5s=; b=HLmMZfxmea0AvekTnk8Ca5AqR2er3dDIj972yifyR79T5xlIZZmc07iTlFPw9go4tA Kbc4P0M9zguTz845EelbTOL6DAx1oxytCeQrvsCgr593+FnKaDHpbmzj+YUUj+69aVlV zVcj0EhCMxWav8r4qas7uTnhqFsEjXQnWtZrICj0Thf60ZvGxEcIFjYeeZoGOx42GQgK Al+vxix+hiBgncFXJdv1ngO9GVcY4ATd8LEu4nBFO6wPXSzzDLk7mjEMXPppU6pjqbgN VbMTe+0Y+/Ip1Nc+Q/QA2MLtyuC1jkF3O8oA4QQ5DZNFzs1MhwCaN0ZDyeokhKaEx2MI 5VYw==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=exeocQov1gI/dxlli7+g4+BWOY8Q7jcUAHqPkGnXh5s=; b=J+bU55+DDno9VJz6g1vh7mmv2zWnM0Et+C98kryN67U9phwVhfU91UUDk416K3v9ps hXbm4O7kxnULg735lrNbJ1SYjgwftzUc1XXn1qaAvV4D++8lZsbv0VBG4LOJ894FHa6w SCDIrm+09RaIvfaF2ubjq8IER5mUw3o7I67lHI1wJxYFC5/wxc5nuejRuZX1C8BdryCq J38q69/89J/PeOh4vLNjq8cSiOr+HyjcMq620fT+ghiGdT31xzb8nFqOwrKg3DRpNCfQ YbqHBihTJk8BENDVoLkbimtVsXliQfkCOEmyTUREhqsQUbWNS/OS1yxgXzWlIAuDFwRF xMIg==
X-Gm-Message-State AGi0PuaTot8Vw8VwqTqcJ6lgl+1oMdOAHteyi3NEhRJlzT3tHssckWk0 ub6+YNOx3cWCEOArjocXGmHWMC9D/swOhM6KksA=
X-Google-Smtp-Source APiQypKESOzbbk+XCp/75F5ZtGRSsIbvI3rJkyRWCqvB8s10fUg8pjwFVSpx2MCjImPhIze8QCRQoZTeLjanNQrfTwM=
X-Received by 2002:ac8:3f2c:: with SMTP id c41mr6567785qtk.338.1586174625587; Mon, 06 Apr 2020 05:03:45 -0700 (PDT)
In-Reply-To <45c766ba-4489-bd7b-40c7-32fed37461f9@case.edu>
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2607:f8b0:4864:20::82e
X-Content-Filtered-By Mailman/MimeDel 2.1.23
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <CAH7i3Lr5zBub6yObXkwV78E0Oyct-bAu2+D2hocpT8NNyBqHLg@mail.gmail.com>
X-Mailman-Original-References <CAH7i3LqUZcV6shJv6nQoRkLp-zhBgTpWaUPKdzZwVC-W_0e8yw@mail.gmail.com> <23276.1586024838@jinx.noi.kre.to> <CAH7i3Lr5TTK+N-qC39+nmSo7jjhzDvPux39N4i2MyP5LCnnv5w@mail.gmail.com> <16086.1586068489@jinx.noi.kre.to> <CAH7i3LrwPy9J9+8BPgvT+BGtv39nQJ2H-prxWXu7mHYZ8UjodQ@mail.gmail.com> <45c766ba-4489-bd7b-40c7-32fed37461f9@case.edu>
Xref csiph.com gnu.bash.bug:16094

Show key headers only | View raw


>
> That's not how read is defined to behave. wait has special wording defining
> what happens when it receives a signal. Bash default mode behaves as I
> described previously -- trapping the signal and returning from the handler
> results in the read being restarted -- and posix mode will run the trap
> handler before returning from the `read' builtin.
>

Okay, you're right, in posix mode the behavior is as expected. However I
still didn't get why job controls being enabled/disabled changes the way an
interactive shell handles signals in posix mode. Like

$ set -o posix
$
$ trap 'echo foo' INT
$
$ read
^Cfoo
$ sleep 5
^C
$
$ set +m
$
$ read
^Cfoo
$ sleep 5
^Cfoo

Is there a race condition here or does posix mandate this behavior for
built-in utilities?


-- 
Oğuz

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

signals ignored in a subshell Oğuz <oguzismailuysal@gmail.com> - 2020-04-06 15:03 +0300

csiph-web