public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [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
Date: Fri, 07 May 2021 17:48:30 +0000	[thread overview]
Message-ID: <bug-27812-4717-lkLXHgaOX5@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27812-4717@http.sourceware.org/bugzilla/>

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.

  parent reply	other threads:[~2021-05-07 17:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 12:46 [Bug threads/27812] New: " 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-27812-4717-lkLXHgaOX5@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).