]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Skip gdb.base/libsegfault.exp on Windows
authorPedro Alves <pedro@palves.net>
Tue, 23 Sep 2025 09:38:22 +0000 (10:38 +0100)
committerPedro Alves <pedro@palves.net>
Tue, 23 Sep 2025 09:42:51 +0000 (10:42 +0100)
Running gdb.base/libsegfault.exp on Cygwin/MSYS2 causes badness.

E.g. on Cygwin:

 $ make check-parallel TESTS="gdb.base/libsegfault.exp"
 ...
 Running /home/alves/gdb/src/gdb/testsuite/gdb.base/libsegfault.exp ...
       0 [main] expect 6611 C:\cygwin64\bin\expect.exe: *** fatal error in forked process - error while loading shared libraries: libSegFault.so: cannot open shared object file: No such file or directory
*** starting '"C:\cygwin64\bin\dumper.exe" -n "C:\cygwin64\bin\expect.exe" 8012' for pid 6611, tid 7992
 *** continuing pid 6611
 parent: sync byte write: broken pipe
 make[1]: *** [Makefile:320: check/gdb.base/libsegfault.exp] Error 255
 make[1]: Target 'do-check-parallel' not remade because of errors.
 make[1]: Leaving directory '/home/alves/gdb/build-cygwin-testsuite'
 outputs/gdb.base/libsegfault/gdb.sum: no recognised summary line
 outputs/gdb.base/libsegfault/gdb.log: no recognised summary line
 make: *** [Makefile:260: check-parallel] Error 2
 $

I.e., Expect's spawn fails, and that brings down the whole Expect
process.  The result is that in serial mode, the test run just stops.
And in parallel mode we end up with incomplete gdb.sum/gdb.log files,
which dg-extract-results.sh can't process.

Since libSegFault.so is a glibc feature that doesn't exist on
Cygwin/MSYS2, just skip the test there.

Approved-by: Kevin Buettner <kevinb@redhat.com>
Change-Id: I44bdbffa25a5d21c5019418b68776d334a57be26

gdb/testsuite/gdb.base/libsegfault.exp

index eab12ff57e12dfcb6a1fd21ce7c450a50f9552ad..a3883e1e20d9c323b12327729fa31741caa40be2 100644 (file)
 # the local machine.
 require {!is_remote host}
 
+# On Cygwin, the testcase would somehow end up trying to preload
+# libSegFault.so into the Expect process, which would fail and crash
+# it.  Since libSegFault.so is a glibc feature that doesn't exist on
+# Cygwin, just skip testing there.
+require {!expr {[isbuild "*-*-cygwin*"] && [ishost "*-*-cygwin*"]}}
+# Same when testing MinGW with MSYS2, as MSYS2 is really a Cygwin
+# fork.
+require {!expr {[isbuild "*-*-mingw*"] && [ishost "*-*-mingw*"]}}
+
 # Spawn GDB with LIB preloaded with LD_PRELOAD.  CMDLINE_OPTS are
 # command line options passed to GDB.