https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100203

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
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='conformance.exp=wait_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

                === libstdc++ tests ===

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 target.
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

                === libstdc++ Summary ===

# of expected passes            5
# of unexpected failures        1
make[1]: Leaving directory
'/home/jakub/src/gcc/obj11/i686-pc-linux-gnu/libstdc++-v3/testsuite'

Reply via email to