public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug threads/27812] New: [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed
@ 2021-05-03 12:46 vries at gcc dot gnu.org
  2021-05-03 12:50 ` [Bug threads/27812] " vries at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2021-05-03 12:46 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27812

            Bug ID: 27812
           Summary: [m32] linux-nat.c:1765: internal-error: virtual void
                    linux_nat_target::resume(ptid_t, int, gdb_signal):
                    Assertion `signo == GDB_SIGNAL_0' failed
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: threads
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

On the openSUSE tumbleweed gdb package (based on gdb 10.1) when testing on
target board unix/-m32/-fno-PIE/-no-pie, I run into:
...
FAIL: gdb.threads/simultaneous-step-resume-breakpoint.exp: step thread 3
FAIL: gdb.threads/simultaneous-step-resume-breakpoint.exp: first continue
FAIL: gdb.threads/simultaneous-step-resume-breakpoint.exp: second continue (GDB
internal error)
FAIL: gdb.threads/simultaneous-step-resume-breakpoint.exp: third continue (the
program is no longer running)
...

In more detail:
...
(gdb) PASS: gdb.threads/simultaneous-step-resume-breakpoint.exp: step thread 2
step^M
sleep: Invalid argument^M
simultaneous-step-resume-breakpoint:
/home/abuild/rpmbuild/BUILD/gdb-10.1/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c:48:
func: Assertion `i == 0' failed.^M
^M
Thread 2 "simultaneous-st" received signal SIGABRT, Aborted.^M
[Switching to Thread 0xf7dcbb40 (LWP 24281)]^M
0xf7fd5159 in __kernel_vsyscall ()^M
(gdb) FAIL: gdb.threads/simultaneous-step-resume-breakpoint.exp: step thread 3
continue^M
Continuing.^M
sleep: Invalid argument^M
simultaneous-step-resume-breakpoint:
/home/abuild/rpmbuild/BUILD/gdb-10.1/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c:48:
func: Assertion `i == 0' failed.^M
^M
Thread 3 received signal SIGABRT, Aborted.^M
[Switching to Thread 0xf75cab40 (LWP 24294)]^M
Cannot remove breakpoints because program is no longer writable.^M
Further execution is probably impossible.^M
0xf7fd5159 in __kernel_vsyscall ()^M
(gdb) FAIL: gdb.threads/simultaneous-step-resume-breakpoint.exp: first continue
continue^M
Continuing.^M
../../gdb/linux-nat.c:1765: internal-error: virtual void
linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo ==
GDB_SIGNAL_0' failed.^M
A problem internal to GDB has been detected,^M
further debugging may prove unreliable.^M
Quit this debugging session? (y or n) FAIL:
gdb.threads/simultaneous-step-resume-breakpoint.exp: second continue (GDB
internal error)
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug threads/27812] [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed
  2021-05-03 12:46 [Bug threads/27812] New: [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed vries at gcc dot gnu.org
@ 2021-05-03 12:50 ` vries at gcc dot gnu.org
  2021-05-03 12:51 ` vries at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2021-05-03 12:50 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27812

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #0)
> On the openSUSE tumbleweed gdb package (based on gdb 10.1) when testing on
> target board unix/-m32/-fno-PIE/-no-pie, I run into:

Note: the package has included the patch from
https://sourceware.org/pipermail/gdb-patches/2021-March/177369.html , so it may
be fall out from that.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug threads/27812] [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed
  2021-05-03 12:46 [Bug threads/27812] New: [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed vries at gcc dot gnu.org
  2021-05-03 12:50 ` [Bug threads/27812] " vries at gcc dot gnu.org
@ 2021-05-03 12:51 ` vries at gcc dot gnu.org
  2021-05-06 15:18 ` vries at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2021-05-03 12:51 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27812

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 13417
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13417&action=edit
gdb.log

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug threads/27812] [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed
  2021-05-03 12:46 [Bug threads/27812] New: [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed vries at gcc dot gnu.org
  2021-05-03 12:50 ` [Bug threads/27812] " vries at gcc dot gnu.org
  2021-05-03 12:51 ` vries at gcc dot gnu.org
@ 2021-05-06 15:18 ` vries at gcc dot gnu.org
  2021-05-06 15:26 ` simark at simark dot ca
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2021-05-06 15:18 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27812

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
Hmm, that's a fedora test-case.

Anyway, reproduced on trunk:
...
$ for n in $(seq 1 100); do ./test.sh -m32 2>&1 | grep "internal error"; done
FAIL: gdb.threads/simultaneous-step-resume-breakpoint.exp: second continue (GDB
internal error)
^C
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug threads/27812] [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed
  2021-05-03 12:46 [Bug threads/27812] New: [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-05-06 15:18 ` vries at gcc dot gnu.org
@ 2021-05-06 15:26 ` simark at simark dot ca
  2021-05-06 15:29 ` vries at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: simark at simark dot ca @ 2021-05-06 15:26 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27812

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca

--- Comment #4 from Simon Marchi <simark at simark dot ca> ---
Am I crazy or... I don't see a
gdb.threads/simultaneous-step-resume-breakpoint.exp test.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug threads/27812] [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed
  2021-05-03 12:46 [Bug threads/27812] New: [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-05-06 15:26 ` simark at simark dot ca
@ 2021-05-06 15:29 ` vries at gcc dot gnu.org
  2021-05-06 15:41 ` simark at simark dot ca
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2021-05-06 15:29 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27812

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Simon Marchi from comment #4)
> Am I crazy or... I don't see a
> gdb.threads/simultaneous-step-resume-breakpoint.exp test.

It's a fedora test-case.  See
https://src.fedoraproject.org/rpms/gdb/blob/f34/f/gdb-simultaneous-step-resume-breakpoint-test.patch

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug threads/27812] [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed
  2021-05-03 12:46 [Bug threads/27812] New: [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-05-06 15:29 ` vries at gcc dot gnu.org
@ 2021-05-06 15:41 ` simark at simark dot ca
  2021-05-07 17:48 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: simark at simark dot ca @ 2021-05-06 15:41 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27812

--- Comment #6 from Simon Marchi <simark at simark dot ca> ---
(In reply to Tom de Vries from comment #5)
> (In reply to Simon Marchi from comment #4)
> > Am I crazy or... I don't see a
> > gdb.threads/simultaneous-step-resume-breakpoint.exp test.
> 
> It's a fedora test-case.  See
> https://src.fedoraproject.org/rpms/gdb/blob/f34/f/gdb-simultaneous-step-
> resume-breakpoint-test.patch

Ah, thanks.  I didn't understand what you meant by "Hmm, that's a fedora
test-case.", it's clear now.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug threads/27812] [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed
  2021-05-03 12:46 [Bug threads/27812] New: [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed vries at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-05-06 15:41 ` simark at simark dot ca
@ 2021-05-07 17:48 ` vries at gcc dot gnu.org
  2021-05-08  4:18 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2021-05-07 17:48 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27812

--- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> ---
OK, easier to reproduce in conjunction with stress -c 5.

Using this patch to produce a core file:
...
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 36a5fd4feb7..77c9a19eb40 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -755,11 +755,11 @@ proc gdb_internal_error_resync {} {
     while {$count < 10} {
        gdb_expect {
            -re "Quit this debugging session\\? \\(y or n\\) $" {
-               send_gdb "n\n" answer
+               send_gdb "y\n" answer
                incr count
            }
            -re "Create a core file of GDB\\? \\(y or n\\) $" {
-               send_gdb "n\n" answer
+               send_gdb "y\n" answer
                incr count
            }
            -re "$gdb_prompt $" {
...

When debugging the core file, we can see what triggers the assert: we have
signo == GDB_SIGNAL_ABRT:
...
(gdb) up
#6  0x00000000007e3d69 in linux_nat_target::resume (
    this=0x175cb60 <the_amd64_linux_nat_target>, ptid=..., step=0,
signo=GDB_SIGNAL_ABRT)
    at /home/vries/gdb_versions/devel/src/gdb/linux-nat.c:1715
1715          gdb_assert (signo == GDB_SIGNAL_0);
(gdb) p signo
$1 = GDB_SIGNAL_ABRT
...

Backtrace:
...
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007fbbbf3fba01 in __GI_abort () at abort.c:79
#2  0x0000000000b21f70 in dump_core () at
/home/vries/gdb_versions/devel/src/gdb/utils.c:204
#3  0x0000000000b22482 in internal_vproblem(internal_problem *, const char *,
int, const char *, typedef __va_list_tag __va_list_tag *) (problem=0x16f7780
<internal_error_problem>, 
    file=0xf1d080 "/home/vries/gdb_versions/devel/src/gdb/linux-nat.c",
line=1715, 
    fmt=0xf1cf98 "%s: Assertion `%s' failed.", ap=0x7ffd4707c1e8)
    at /home/vries/gdb_versions/devel/src/gdb/utils.c:414
#4  0x0000000000b2254a in internal_verror (
    file=0xf1d080 "/home/vries/gdb_versions/devel/src/gdb/linux-nat.c",
line=1715, 
    fmt=0xf1cf98 "%s: Assertion `%s' failed.", ap=0x7ffd4707c1e8)
    at /home/vries/gdb_versions/devel/src/gdb/utils.c:439
#5  0x0000000000dfb2d7 in internal_error (
    file=0xf1d080 "/home/vries/gdb_versions/devel/src/gdb/linux-nat.c",
line=1715, 
    fmt=0xf1cf98 "%s: Assertion `%s' failed.")
    at /home/vries/gdb_versions/devel/src/gdbsupport/errors.cc:55
#6  0x00000000007e3d69 in linux_nat_target::resume (
    this=0x175cb60 <the_amd64_linux_nat_target>, ptid=..., step=0,
signo=GDB_SIGNAL_ABRT)
    at /home/vries/gdb_versions/devel/src/gdb/linux-nat.c:1715
#7  0x00000000007fd6fb in thread_db_target::resume (this=0x16ea560
<the_thread_db_target>, 
    ptid=..., step=0, signo=GDB_SIGNAL_ABRT)
    at /home/vries/gdb_versions/devel/src/gdb/linux-thread-db.c:1828
#8  0x0000000000a83d83 in target_resume (ptid=..., step=0,
signal=GDB_SIGNAL_ABRT)
    at /home/vries/gdb_versions/devel/src/gdb/target.c:2663
#9  0x00000000007a2f19 in do_target_resume (resume_ptid=..., step=false,
sig=GDB_SIGNAL_ABRT)
    at /home/vries/gdb_versions/devel/src/gdb/infrun.c:2176
#10 0x00000000007a39f6 in resume_1 (sig=GDB_SIGNAL_ABRT)
    at /home/vries/gdb_versions/devel/src/gdb/infrun.c:2547
#11 0x00000000007a3ace in resume (sig=GDB_SIGNAL_ABRT)
    at /home/vries/gdb_versions/devel/src/gdb/infrun.c:2560
#12 0x00000000007b09fa in keep_going_pass_signal (ecs=0x7ffd4707c950)
    at /home/vries/gdb_versions/devel/src/gdb/infrun.c:8126
#13 0x00000000007a56ea in proceed (addr=18446744073709551615,
siggnal=GDB_SIGNAL_DEFAULT)
    at /home/vries/gdb_versions/devel/src/gdb/infrun.c:3255
#14 0x00000000007932ed in continue_1 (all_threads=0)
    at /home/vries/gdb_versions/devel/src/gdb/infcmd.c:681
#15 0x000000000079358b in continue_command (args=0x0, from_tty=1)
    at /home/vries/gdb_versions/devel/src/gdb/infcmd.c:773
#16 0x000000000058e840 in do_const_cfunc (c=0x2b6de20, args=0x0, from_tty=1)
    at /home/vries/gdb_versions/devel/src/gdb/cli/cli-decode.c:101
#17 0x00000000005926db in cmd_func (cmd=0x2b6de20, args=0x0, from_tty=1)
    at /home/vries/gdb_versions/devel/src/gdb/cli/cli-decode.c:2196
#18 0x0000000000aa7f8e in execute_command (p=0x2c4ea38 "", from_tty=1)
    at /home/vries/gdb_versions/devel/src/gdb/top.c:670
#19 0x00000000006e3b05 in command_handler (command=0x2c4ea30 "continue")
    at /home/vries/gdb_versions/devel/src/gdb/event-top.c:588
#20 0x00000000006e3f35 in command_line_handler (rl=...)
    at /home/vries/gdb_versions/devel/src/gdb/event-top.c:773
#21 0x0000000000ad07e8 in tui_command_line_handler (rl=...)
    at /home/vries/gdb_versions/devel/src/gdb/tui/tui-interp.c:268
#22 0x00000000006e32e0 in gdb_rl_callback_handler (rl=0x363e980 "continue")
    at /home/vries/gdb_versions/devel/src/gdb/event-top.c:218
#23 0x0000000000b8838d in rl_callback_read_char ()
    at /home/vries/gdb_versions/devel/src/readline/readline/callback.c:281
#24 0x00000000006e315d in gdb_rl_callback_read_char_wrapper_noexcept ()
    at /home/vries/gdb_versions/devel/src/gdb/event-top.c:176
#25 0x00000000006e31e4 in gdb_rl_callback_read_char_wrapper
(client_data=0x2a21750)
    at /home/vries/gdb_versions/devel/src/gdb/event-top.c:193
#26 0x00000000006e3954 in stdin_event_handler (error=0, client_data=0x2a21750)
    at /home/vries/gdb_versions/devel/src/gdb/event-top.c:515
#27 0x0000000000dfbff9 in handle_file_event (file_ptr=0x354c0d0, ready_mask=1)
    at /home/vries/gdb_versions/devel/src/gdbsupport/event-loop.cc:575
#28 0x0000000000dfc581 in gdb_wait_for_event (block=1)
    at /home/vries/gdb_versions/devel/src/gdbsupport/event-loop.cc:701
#29 0x0000000000dfb47f in gdb_do_one_event ()
    at /home/vries/gdb_versions/devel/src/gdbsupport/event-loop.cc:237
#30 0x0000000000814a68 in start_event_loop ()
    at /home/vries/gdb_versions/devel/src/gdb/main.c:421
#31 0x0000000000814b88 in captured_command_loop ()
    at /home/vries/gdb_versions/devel/src/gdb/main.c:481
#32 0x00000000008163a7 in captured_main (data=0x7ffd4707d240)
    at /home/vries/gdb_versions/devel/src/gdb/main.c:1353
#33 0x000000000081640d in gdb_main (args=0x7ffd4707d240)
    at /home/vries/gdb_versions/devel/src/gdb/main.c:1368
#34 0x0000000000417a0e in main (argc=9, argv=0x7ffd4707d348)
    at /home/vries/gdb_versions/devel/src/gdb/gdb.c:32
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug threads/27812] [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed
  2021-05-03 12:46 [Bug threads/27812] New: [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed vries at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2021-05-07 17:48 ` vries at gcc dot gnu.org
@ 2021-05-08  4:18 ` vries at gcc dot gnu.org
  2021-05-09  7:36 ` vries at gcc dot gnu.org
  2021-05-09  8:51 ` vries at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2021-05-08  4:18 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27812

--- Comment #8 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 13426
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13426&action=edit
gdb.log with set debug lin-lwp 1

...
Thread 3 received signal SIGABRT, Aborted.^M
[Switching to Thread 0xf74b3b40 (LWP 23473)]^M
Cannot remove breakpoints because program is no longer writable.^M
Further execution is probably impossible.^M
0xf7fd5159 in __kernel_vsyscall ()^M
(gdb) FAIL: gdb.threads/simultaneous-step-resume-breakpoint.exp: first continue
continue^M
Continuing.^M
[linux-nat] resume: Preparing to resume Thread 0xf7cb5700 (LWP 23468), 0,
inferior_ptid Thread 0xf7cb5700 (LWP 23468)^M
[linux-nat] resume: Short circuiting for status 0x0^M
[linux-nat] resume: Preparing to resume Thread 0xf74b3b40 (LWP 23473), Aborted,
inferior_ptid Thread 0xf74b3b40 (LWP 23473)^M
/home/vries/gdb_versions/devel/src/gdb/linux-nat.c:1715: internal-error:
virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion
`signo == GDB_SIGNAL_0' failed.^M
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug threads/27812] [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed
  2021-05-03 12:46 [Bug threads/27812] New: [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed vries at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2021-05-08  4:18 ` vries at gcc dot gnu.org
@ 2021-05-09  7:36 ` vries at gcc dot gnu.org
  2021-05-09  8:51 ` vries at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2021-05-09  7:36 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27812

--- Comment #9 from Tom de Vries <vries at gcc dot gnu.org> ---
Using this patch (so, disabling the assert, and printing a message that it
would have triggered otherwise):
...
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index c45e335a762..f0104f130cc 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1712,7 +1712,8 @@ linux_nat_target::resume (ptid_t ptid, int step, enum
gdb_signal
 signo)
     {
       /* FIXME: What should we do if we are supposed to continue
         this thread with a signal?  */
-      gdb_assert (signo == GDB_SIGNAL_0);
+      if (!((signo == GDB_SIGNAL_0)))
+       fprintf (stderr, "ASSERT TRIGGERED\n");

       linux_nat_debug_printf ("Short circuiting for status 0x%x",
                              lp->status);
...
I get:
...
(gdb) PASS: gdb.threads/simultaneous-step-resume-breakpoint.exp: step thread 2
step^M
sleep: Invalid argument^M
simultaneous-step-resume-breakpoint:
/home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c:48:
func: Assertion `i == 0' failed.^M
sleep: Invalid argument^M
simultaneous-step-resume-breakpoint:
/home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c:48:
func: Assertion `i == 0' failed.^M
^M
Thread 2 "simultaneous-st" received signal SIGABRT, Aborted.^M
[Switching to Thread 0xf7cb4b40 (LWP 18067)]^M
0xf7fd5159 in __kernel_vsyscall ()^M
(gdb) FAIL: gdb.threads/simultaneous-step-resume-breakpoint.exp: step thread 3
continue^M
Continuing.^M
^M
Thread 3 received signal SIGABRT, Aborted.^M
[Switching to Thread 0xf74b3b40 (LWP 18068)]^M
Cannot remove breakpoints because program is no longer writable.^M
Further execution is probably impossible.^M
0xf7fd5159 in __kernel_vsyscall ()^M
(gdb) FAIL: gdb.threads/simultaneous-step-resume-breakpoint.exp: first continue
continue^M
Continuing.^M
ASSERT TRIGGERED^M
^M
Program terminated with signal SIGABRT, Aborted.^M
The program no longer exists.^M
(gdb) FAIL: gdb.threads/simultaneous-step-resume-breakpoint.exp: second
continue
continue^M
The program is not being run.^M
(gdb) FAIL: gdb.threads/simultaneous-step-resume-breakpoint.exp: third continue
(the program is no longer running)
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug threads/27812] [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed
  2021-05-03 12:46 [Bug threads/27812] New: [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed vries at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2021-05-09  7:36 ` vries at gcc dot gnu.org
@ 2021-05-09  8:51 ` vries at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2021-05-09  8:51 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27812

--- Comment #10 from Tom de Vries <vries at gcc dot gnu.org> ---
I tried to modify the example a bit, because sleep saves and restores errno, so
I was not sure how reliable the perror was.

So I've added:
...
#include <time.h>

static inline unsigned int
mysleep (unsigned int seconds)
{
  struct timespec ts = { 0, 0 };
  ts.tv_sec = (time_t) seconds;
  if (nanosleep (&ts, &ts) < 0)
    {
      perror ("mysleep");
      return ts.tv_sec;
    }
  return 0;
}

#define sleep(s) mysleep (s)
...

Interestingly, I still got:
...
mysleep: Invalid argument^M
...

More interestingly, I ran into:
...
/home/vries/gdb_versions/devel/src/gdb/linux-nat.c:1914: internal-error: wait
returned unexpected status 0x86^M
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2021-05-09  8:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-03 12:46 [Bug threads/27812] New: [m32] linux-nat.c:1765: internal-error: virtual void linux_nat_target::resume(ptid_t, int, gdb_signal): Assertion `signo == GDB_SIGNAL_0' failed vries at gcc dot gnu.org
2021-05-03 12:50 ` [Bug threads/27812] " vries at gcc dot gnu.org
2021-05-03 12:51 ` vries at gcc dot gnu.org
2021-05-06 15:18 ` vries at gcc dot gnu.org
2021-05-06 15:26 ` simark at simark dot ca
2021-05-06 15:29 ` vries at gcc dot gnu.org
2021-05-06 15:41 ` simark at simark dot ca
2021-05-07 17:48 ` vries at gcc dot gnu.org
2021-05-08  4:18 ` vries at gcc dot gnu.org
2021-05-09  7:36 ` vries at gcc dot gnu.org
2021-05-09  8:51 ` vries at gcc dot gnu.org

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).