From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 469803847725; Wed, 3 Apr 2024 19:16:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 469803847725 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712171785; bh=eJFuwe235kOmM41EkYH6momOv33JI/u4e2J6YBlXE7I=; h=From:To:Subject:Date:From; b=KItTuvbimtDHN4HT32TMCgM0uXbJF5aErOD684kxBBUMy9nYabAWmTITRbF3pju6h qTTwxH5qOlOGSdTxJM1NJAG3LYRYmEpOfOcZ09fu7d48Cpe0D9mxfwHS9f6l8j8GLL Yjwq/li8/LrgVtowV4MGuR67NovZo7RaDQAqr7Fo= From: "bernd.edlinger at hotmail dot de" To: gdb-prs@sourceware.org Subject: [Bug threads/31602] New: Sporadic test failures in gdb.threads/signal-command-handle-nopass.exp Date: Wed, 03 Apr 2024 19:16:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: threads X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bernd.edlinger at hotmail dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31602 Bug ID: 31602 Summary: Sporadic test failures in gdb.threads/signal-command-handle-nopass.exp Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: threads Assignee: unassigned at sourceware dot org Reporter: bernd.edlinger at hotmail dot de Target Milestone: --- I observe a 1 out of 10-20 test failure in gdb.threads/signal-command-handle-nopass.exp on host system: devuan Daedalus with Linux version 6.1.0-18-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debi= an 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) while make check-gdb RUNTESTFLAGS=3D"gdb.threads/signal-command-handle-nopass.exp"; do :; done stops always after a few repeates with a failure break in the handler as follows: FAIL: gdb.threads/signal-command-handle-nopass.exp: step-over yes: signal SIGUSR1 =3D=3D=3D gdb Summary =3D=3D=3D # of expected passes 16 # of unexpected failures 1 /home/ed/gnu/gdb-build-1/gdb/gdb version 15.0.50.20240401-git -nw -nx -q -= iex "set height 0" -iex "set width 0" -data-directory /home/ed/gnu/gdb-build-1/gdb/data-directory=20 =3D=3D=3D gdb Summary =3D=3D=3D # of expected passes 16 # of unexpected failures 1 /home/ed/gnu/gdb-build-1/gdb/gdb version 15.0.50.20240401-git -nw -nx -q -= iex "set height 0" -iex "set width 0" -data-directory /home/ed/gnu/gdb-build-1/gdb/data-directory=20 make[3]: *** [Makefile:226: do-check-single] Error 1 make[3]: Leaving directory '/home/ed/gnu/gdb-build-1/gdb/testsuite' make[2]: *** [Makefile:161: check] Error 2 make[2]: Leaving directory '/home/ed/gnu/gdb-build-1/gdb/testsuite' make[1]: *** [Makefile:1969: check] Error 2 make[1]: Leaving directory '/home/ed/gnu/gdb-build-1/gdb' make: *** [Makefile:12412: check-gdb] Error 2 Failure happens both with step over and without. log file shows this when the failure happens: (gdb) PASS: gdb.threads/signal-command-handle-nopass.exp: step-over yes: th= read 1 selected=20 signal SIGUSR1^M=20 Continuing with signal SIGUSR1.^M=20 ^M=20 Thread 1 "signal-command-" received signal SIGUSR1, User defined signal 1.^= M=20 0x00007ffff7e59847 in pthread_create () from /lib/x86_64-linux-gnu/libc.so.= 6^M=20 (gdb) FAIL: gdb.threads/signal-command-handle-nopass.exp: step-over yes: si= gnal SIGUSR1=20 info threads^M=20 Id Target Id Frame ^M=20 * 1 Thread 0x7ffff7dcd740 (LWP 28333) "signal-command-" 0x00007ffff7e598= 47 in pthread_create () from /lib/x86_64-linux-gnu/libc.so.6^M=20 2 Thread 0x7ffff7dcc6c0 (LWP 28336) "signal-command-" thread_function (arg=3D0x0) at /home/ed/gnu/gdb-build-1/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/= gdb.threads/signal-command-handle-nopass.c:34^M=20 (gdb) PASS: gdb.threads/signal-command-handle-nopass.exp: step-over yes: th= read 1 got the signal=20 Expected behavior would be break in handler, not in pthread_create. Even if I modify the test case to continue there and wait for the breakpoin= t to be hit later, that does not happen. It looks like the pthread_create catch= es the SIGUSR1. The problem seems to go away if I change the test to allow the pthread_crea= te to complete before the first breakpoint is hit as follows: diff --git a/gdb/testsuite/gdb.threads/signal-command-handle-nopass.c b/gdb/testsuite/gdb.threads/signal-command-handle-nopass.c index 6d82bd6f256..9e065ec5303 100644 --- a/gdb/testsuite/gdb.threads/signal-command-handle-nopass.c +++ b/gdb/testsuite/gdb.threads/signal-command-handle-nopass.c @@ -35,6 +35,13 @@ thread_function (void *arg) usleep (1); } +void * +thread_function1 (void *arg) +{ + usleep (10); + return thread_function (arg); +} + int main (void) { @@ -42,7 +49,7 @@ main (void) int i; signal (SIGUSR1, handler); - pthread_create (&child_thread, NULL, thread_function, NULL); + pthread_create (&child_thread, NULL, thread_function1, NULL); pthread_join (child_thread, NULL); return 0; Well it looks a bit as if the pthread_create is broken here. And probably a KFAIL would be more appropriate? --=20 You are receiving this mail because: You are on the CC list for the bug.=