From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B44C93894423; Thu, 22 Apr 2021 11:23:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B44C93894423 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug testsuite/100203] Dejagnu timeouts don't work Date: Thu, 22 Apr 2021 11:23:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: testsuite X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:23:22 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100203 --- Comment #3 from Jakub Jelinek --- Note that bash documents its behavior: 'kill' kill [-s SIGSPEC] [-n SIGNUM] [-SIGSPEC] JOBSPEC or PID kill -l|-L [EXIT_STATUS] Send a signal specified by SIGSPEC or SIGNUM to the process named by job specification JOBSPEC or process ID PID. SIGSPEC is either a case-insensitive signal name such as 'SIGINT' (with or without the 'SIG' prefix) or a signal number; SIGNUM is a signal number. If SIGSPEC and SIGNUM are not present, 'SIGTERM' is used. The '-l' option lists the signal names. If any arguments are supplied when '-l' is given, the names of the signals corresponding to the arguments are listed, and the return status is zero. EXIT_STATUS is a number specifying a signal number or the exit status of a process terminated by a signal. The '-L' option is equivalent to '-l'. The return status is zero if at least one signal was successfully sent, or non-zero if an error occurs or an invalid option is encountered. but yes, it is different from the man 1 kill documentation. Just tried: --- /usr/share/dejagnu/remote.exp.jj 2020-07-27 18:54:19.000000000 +0200 +++ /usr/share/dejagnu/remote.exp 2021-04-22 13:12:21.843958084 +0200 @@ -76,7 +76,7 @@ proc close_wait_program { program_id pid # Send SIGINT to give the program a better chance to interrupt # whatever it might be doing and react to stdin closing. # eg, in case of GDB, this should get it back to the prompt. - exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid= )" + exec sh -c "exec > /dev/null 2>&1 && (env kill -2 $pgid || env kill= -2 $pid)" # If the program doesn't exit gracefully when stdin closes, # we'll need to kill it. But only do this after 'wait'ing a @@ -86,8 +86,8 @@ proc close_wait_program { program_id pid # PID reuse race. set secs 5 set sh_cmd "exec > /dev/null 2>&1" - append sh_cmd " && sleep $secs && (kill -15 $pgid || kill -15 $pid)" - append sh_cmd " && sleep $secs && (kill -9 $pgid || kill -9 $pid)" + append sh_cmd " && sleep $secs && (env kill -15 $pgid || env kill -= 15 $pid)" + append sh_cmd " && sleep $secs && (env kill -9 $pgid || env kill -9 $pid)" append sh_cmd " && sleep $secs" set exec_pid [exec sh -c "$sh_cmd" &] } @@ -104,7 +104,7 @@ proc close_wait_program { program_id pid # We reaped the process, so cancel the pending force-kills, as # otherwise if the PID is reused for some other unrelated # process, we'd kill the wrong process. - exec sh -c "exec > /dev/null 2>&1 && kill -9 $exec_pid" + exec sh -c "exec > /dev/null 2>&1 && env kill -9 $exec_pid" } return $res and with that change make check doesn't hang, but works as expected: make check RUNTESTFLAGS=3D'conformance.exp=3Dwait_notify.cc' make check-DEJAGNU make[1]: Entering directory '/home/jakub/src/gcc/obj11/i686-pc-linux-gnu/libstdc++-v3/testsuite' ... Native configuration is i686-pc-linux-gnu =3D=3D=3D libstdc++ tests =3D=3D=3D Schedule of variations: unix Running target unix Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target. Using /usr/share/dejagnu/config/unix.exp as generic interface file for targ= et. Using /home/jakub/src/gcc/libstdc++-v3/testsuite/config/default.exp as tool-and-target-specific interface file. Running /home/jakub/src/gcc/libstdc++-v3/testsuite/libstdc++-dg/conformance= .exp ... WARNING: program timed out. FAIL: 29_atomics/atomic_float/wait_notify.cc execution test =3D=3D=3D libstdc++ Summary =3D=3D=3D # of expected passes 5 # of unexpected failures 1 make[1]: Leaving directory '/home/jakub/src/gcc/obj11/i686-pc-linux-gnu/libstdc++-v3/testsuite'=