Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Skip gdb.base/libsegfault.exp on Cygwin
@ 2025-06-06 17:46 Pedro Alves
  2025-06-11 17:43 ` Kevin Buettner
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2025-06-06 17:46 UTC (permalink / raw)
  To: gdb-patches

Running gdb.base/libsegfault.exp on Cygwin, in parallel mode causes
badness:

 $ 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/rocm/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, for some reason.  The result is that 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, just skip the test there.

Change-Id: I44bdbffa25a5d21c5019418b68776d334a57be26
---
 gdb/testsuite/gdb.base/libsegfault.exp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gdb/testsuite/gdb.base/libsegfault.exp b/gdb/testsuite/gdb.base/libsegfault.exp
index eab12ff57e1..808ab046bc5 100644
--- a/gdb/testsuite/gdb.base/libsegfault.exp
+++ b/gdb/testsuite/gdb.base/libsegfault.exp
@@ -24,6 +24,12 @@
 # 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*"]}}
+
 # Spawn GDB with LIB preloaded with LD_PRELOAD.  CMDLINE_OPTS are
 # command line options passed to GDB.
 
-- 
2.49.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Skip gdb.base/libsegfault.exp on Cygwin
  2025-06-06 17:46 [PATCH] Skip gdb.base/libsegfault.exp on Cygwin Pedro Alves
@ 2025-06-11 17:43 ` Kevin Buettner
  2025-09-23  9:48   ` [pushed v2] " Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Buettner @ 2025-06-11 17:43 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Fri,  6 Jun 2025 18:46:48 +0100
Pedro Alves <pedro@palves.net> wrote:

> Running gdb.base/libsegfault.exp on Cygwin, in parallel mode causes
> badness:
> 
>  $ 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/rocm/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, for some reason.  The result is that 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, just skip the test there.
> 
> Change-Id: I44bdbffa25a5d21c5019418b68776d334a57be26

LGTM.

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pushed v2] Skip gdb.base/libsegfault.exp on Cygwin
  2025-06-11 17:43 ` Kevin Buettner
@ 2025-09-23  9:48   ` Pedro Alves
  0 siblings, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2025-09-23  9:48 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches, Hannes Domani

Hi!

On 2025-06-11 18:43, Kevin Buettner wrote:

> LGTM.
> 
> Approved-by: Kevin Buettner <kevinb@redhat.com>
> 

Thanks Kevin.

On IRC, Hannes mentioned he ran into this issue, which made me realize I forgot
to push this patch.  The version that I had posted only skipped the
test on Cygwin, as that was all that I was testing back then) but we see the
same when testing MinGW GDB with MSYS2, since MSYS2 is really a Cygwin fork.

I've pushed this version of the patch now, which is the same as before
but skips mingw too now.

--- 8< ---
Subject: [PATCH] Skip gdb.base/libsegfault.exp on Windows

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 | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gdb/testsuite/gdb.base/libsegfault.exp b/gdb/testsuite/gdb.base/libsegfault.exp
index eab12ff57e1..a3883e1e20d 100644
--- a/gdb/testsuite/gdb.base/libsegfault.exp
+++ b/gdb/testsuite/gdb.base/libsegfault.exp
@@ -24,6 +24,15 @@
 # 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.
 

base-commit: 9ca499644a21ceb3f946d1c179c38a83be084490
-- 
2.51.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-23  9:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-06 17:46 [PATCH] Skip gdb.base/libsegfault.exp on Cygwin Pedro Alves
2025-06-11 17:43 ` Kevin Buettner
2025-09-23  9:48   ` [pushed v2] " Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox