output anything. It returns 0 or 1 as its exit code, so "exit `[
-f $file ]`" always expands to "exit " (equivalent to exit 0).
Instead, use test(1) to check for file existence.
Signed-off-by: Ben Elliston <bje@gnu.org>
(local_exec, standard_close): Use it.
The code that tries to make sure that a process dies in
lib/remote.exp:remote_close can kill the wrong process due to PID-reuse
races. The GDB buildbots show frequent misterious FAILs that turns out
are caused by this. The problem is this bit here:
exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid)
&& sleep 5 && (kill $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid) &"
...
catch "wait -i $shell_id"
When this procedure is called to close the GDB process, GDB exits
promptly, but that whole cascade of kills carries on in the background,
thus potentially killing the unfortunate process that manages to be
spawned by one of the next tests and happens to reuse that $pid. [1]
So to fix this, kill that no-longer-needed pipeline as soon as "wait"
returns. There are two places in the DejaGnu with a similar pipeline,
so move that to a shared procedure.
[1] GDB'S testsuite spawns thousands of GDB instances and even more
inferior processes, and of those inferiors, some spawn thousands of
short lived threads in quick succession. Since threads and processes
share the number space in Linux, all that causes PID recycling
frequently. In addition, GDB's testsuite has a parallel test mode that
runs several tests/DejaGnu instances at the same time, further widening
the race window.
Signed-off-by: Ben Elliston <bje@gnu.org>
possibly introduced in a conversion of .texi to SGML Docbook.
* doc/user.xml: Likewise.
* doc/ref.xml: Likewise.
* doc/dejagnu.texi: Regenerate.
Signed-off-by: Ben Elliston <bje@gnu.org>
(dynamic_linker_flag): Use get_library_dirlist to find dynamic
linker.
(rpath_flags): Use get_library_dirlist to set rpath.
Signed-off-by: Ben Elliston <bje@gnu.org>
instead of appending it.
Some GCC testcases need explicit GCC options to properly run. For
example gcc.target/i386/pr32219-1.c has -fpie specified explicitly:
/* { dg-options "-O2 -fpie" } */
But with multlib, eg:
make check-gcc RUNTESTFLAGS="--target_board='unix{-fpic}'"
-fpic is appended to the command line options, which overrides the command
line options specified by dg-options. multlib flags should be placed at
the beginning of the command line options, not at the end. This patch
updates default_target_compile to prepend multilib_flags, instead of
appending it.
Signed-off-by: Ben Elliston <bje@gnu.org>