public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-100203-4-6yta6Rd8Mc@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100203-4@http.gcc.gnu.org/bugzilla/>

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'

  parent reply	other threads:[~2021-04-22 11:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 10:46 [Bug testsuite/100203] New: " jakub at gcc dot gnu.org
2021-04-22 11:03 ` [Bug testsuite/100203] " jakub at gcc dot gnu.org
2021-04-22 11:19 ` redi at gcc dot gnu.org
2021-04-22 11:23 ` jakub at gcc dot gnu.org [this message]
2021-04-22 11:26 ` redi at gcc dot gnu.org
2021-04-22 11:38 ` redi at gcc dot gnu.org
2021-04-22 11:59 ` redi at gcc dot gnu.org
2021-04-22 15:15 ` msebor at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-100203-4-6yta6Rd8Mc@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).