Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: =?UTF-8?B?T8SfdXo=?= 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: References: <23276.1586024838@jinx.noi.kre.to> <16086.1586068489@jinx.noi.kre.to> <45c766ba-4489-bd7b-40c7-32fed37461f9@case.edu> 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 , "bug-bash@gnu.org" To: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <23276.1586024838@jinx.noi.kre.to> <16086.1586068489@jinx.noi.kre.to> <45c766ba-4489-bd7b-40c7-32fed37461f9@case.edu> Xref: csiph.com gnu.bash.bug:16094 > > That's not how read is defined to behave. wait has special wording defini= ng > what happens when it receives a signal. Bash default mode behaves as I > described previously -- trapping the signal and returning from the handle= r > 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? --=20 O=C4=9Fuz