Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Daniel Mills Newsgroups: gnu.bash.bug Subject: INT still propagating to child processes when trapped Date: Tue, 10 Jul 2018 22:59:16 -0400 Lines: 45 Approved: bug-bash@gnu.org Message-ID: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: usenet.stanford.edu 1531277973 23313 208.118.235.17 (11 Jul 2018 02:59:33 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=G6C4QHMgv6KVTZaNq61B5RVCSALWDFLZ5NMwko7QYtM=; b=D36wE048vg2rW66VUv8JNZhqIsUDirm3e2oaWhnVOTid0xglTDQlc8f/izfqgQtziG B/RFLvByykJQ3lkzuYwthHS8HLEdcmusfL2yq+I9lTZCWHVAbjPvyl82yL3ernyUiSsh lCMTgS/K7bNNRKjG4gUIM5OQotw+TgIMRkeyKq8M95cq4yRY+8L84mC1hiU/Sdkk0IWv DgoG56TS0faRAepZ3wYVFeTF7NHZQVCrjlrYN6oHajIrh28G+fXNsYs/x5ycjv+mSSQ/ tUrcHfKYKsgt3aCFzGXCmBWIxEsFgSUOHx7mFcdiX0Wg249HDW2eBJlPk1lHPtA5mVpH qMYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=G6C4QHMgv6KVTZaNq61B5RVCSALWDFLZ5NMwko7QYtM=; b=RXnClXfWWOtfN21owm/WIkkH7y4/YgjeiXavBMeMJpQyQs0jkeS4wGSDcwTAydCeGU dJX8b78XkuJf42jGvKTqSmD6A+ZfachhslwYHCk26cqPGymy+o0UU7zwCuFz9gqd5aF0 0uGn999lSpE34OUOBZorPhXKOsZHg+4lo+oyCze7+5OQKQmqc7GMyZG0S6tDBIpkfQ2L q0zfxnOE4+MJEH1jBdaMiJe7IkFV45T5Rf38sS5aXWLFczcqbi38lvIRUqyZnr4UY5dl VAKw3KTplv46h1iiaBMTkP1BjFyxOtH6u8+3p4f5J1cY92EDuoBa66lamMqwmi/Tghw3 aw/g== X-Gm-Message-State: AOUpUlE0nO4R5V6ACMSjjq0z2ZXt2y0KgbtChr1+km1Sdh7S+hX3wRr1 tV51cKs2LxRskL3wjnPMW+5Zyj8D5T080R/M9m/s3A== X-Google-Smtp-Source: AAOMgpccWbl1/TslhN8Dk7l+/r4/SpzPnqdQxOPdhsbkcIW0jMKTAAjeY1PeuVM20VwU/fZOqj2fyaWOG190Aur21as= X-Received: by 2002:a24:c2c2:: with SMTP id i185-v6mr6160259itg.76.1531277967205; Tue, 10 Jul 2018 19:59:27 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::22b X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14326 Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/bin' -DSTANDARD_UTILS_PATH='/usr/bin' -DSYS_BASHRC='/etc/bash.bashrc' -DSYS_BASH_LOGOUT='/etc/bash.bash_logout' -DNON_INTERACTIVE_LOGIN_SHELLS -Wno-parentheses -Wno-format-security uname output: Linux djdev 4.17.5-1-ARCH #1 SMP PREEMPT Sun Jul 8 17:27:31 UTC 2018 x86_64 GNU/Linux Machine Type: x86_64-unknown-linux-gnu Bash Version: 4.4 Patch Level: 23 Release Status: release Description: After an INT trap, forked processes are still sent INT when ^C is used on a running script. Repeat-By: #!/bin/bash { trap 'echo "foo :("' EXIT sleep 30 echo foo } & foo=$! { trap 'echo "bar :("' EXIT sleep 32 echo bar } & bar=$! trap 'kill "$foo"' INT read sleep 60 ################################### Run this script in bash 3.x and hit ^C, and you get "foo :(", as expected. Run it with bash 4.4, and you also get "bar :(". I would not expect this.