Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: =?UTF-8?B?T8SfdXo=?= Newsgroups: gnu.bash.bug Subject: Re: signals ignored in a subshell Date: Mon, 6 Apr 2020 15:06:02 +0300 Lines: 47 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 1586174767 16181 209.51.188.17 (6 Apr 2020 12:06:07 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=D+QfSsQfrloqRfUJ+G9O2h1tSx1nCacIC1sD/HU4wrM=; b=Z5LwSelQoq+nYAew51kCWivQA21/lVXKsTjiZ8UMshqktVp7gkhX/p7DQbMu5h//x4 6p3Pyq0OGiM3461qfLSJd9sY5mpdTbUWlZRI4O/TfzaFpRCyS7A1++GOMUR63lYdiACb uIikfwmzN1RVHokpsPws406Rr2SuMsz9LgT68AKC6cpZN4P6tJtJjXVpp32ld02Ca+uS EhpjE70rGpWPz7/MOFZ545KgtDTuZDh1nSj+yA3cfeRvJ6Lp/sgjikiTaCntCXPIOPuH Gd0XAcsV/7d2kfzKi7oCopIQWTl86IsN1hhnl0cu6gnOTH4ts/mBFVPBcqtoge8FpFyt i4HQ== 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=D+QfSsQfrloqRfUJ+G9O2h1tSx1nCacIC1sD/HU4wrM=; b=hovTeyL57jxzjpB5aNT0zyzxg0Wq9p7/yDXGYsovll9lIDzbwt9kqaExJfuodBC++T 3arZOKr37oa/HByN00/ibbWREty76h6EH1nypvIRFUewPMyaCxrpie00/pve4mw+wRW4 lSy6t2FH+UIyuZLpqhv8yw4dlwIk0oFfjjy0oUNr+jOFR4ftQncoouSdPaTQnjNb8KV7 gEU2UNJo5FyWGIZv8nzineD+zsGw+lpoCD60GWaMwW4GcFokiieza8/M03mIO5Zm3NPE 4T1If3XqnjqdXDvLYHUSIP843sqbeP5ilwyG5DZpty2+OFuZNmFgC4lJVx6gMqfaQz7m Ntog== X-Gm-Message-State: AGi0PubtVcUDP0d1hYFVGs9fKYL2AHEwcaZiU0uk2m+nZQQh8k+PtK3P s58BqjqWNJOw5u/mT3WDxHkckVeG55FA7blyfr4= X-Google-Smtp-Source: APiQypJlfFdh95hxOMrNC6jScoCDXJC1n2mgUk8+vPdixr8wt/QDPBlHKl7kafCIu3Xtn+j2pJ3A6oQjsmyQg38NQ+c= X-Received: by 2002:a37:a948:: with SMTP id s69mr264893qke.393.1586174762472; Mon, 06 Apr 2020 05:06:02 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::732 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:16095 Or, is it that when job controls are enabled each synchronous command is run in its own process group and SIGINT is not sent to the shell at all? 6 Nisan 2020 Pazartesi tarihinde O=C4=9Fuz yazd= =C4=B1: > 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 handl= er >> 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=C4=9Fuz > > --=20 O=C4=9Fuz