public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/30630] New: remote.c:8352: internal-error: wait: Assertion `!async_event_handler_marked (rs->remote_async_inferior_event_token)' failed.
@ 2023-07-12  9:16 christian.prochaska@genode-labs.com
  2023-08-23  4:28 ` [Bug gdb/30630] " rajesh.palla at amd dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: christian.prochaska@genode-labs.com @ 2023-07-12  9:16 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30630
           Summary: remote.c:8352: internal-error: wait: Assertion
                    `!async_event_handler_marked
                    (rs->remote_async_inferior_event_token)' failed.
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: christian.prochaska@genode-labs.com
  Target Milestone: ---

I got this error while working on a custom GDB stub which sends two initial
stop replies and could reproduce it with gdbserver with the following test:

#include <pthread.h>
#include <stdio.h>
#include <unistd.h>

void *thread_func(void *)
{
        sleep(1000);
}

int main()
{
        printf("pid: %u\n", getpid());
        pthread_t t;
        pthread_create(&t, 0, thread_func, 0);
        pthread_join(t, 0);
        return 0;
}

---

$ ./test 
pid: 13129
^Z
[1]+  Stopped                 ./test
$ ./gdbserver --attach :5555 13129 &
[2] 13578
$ Attached; pid = 13129
Listening on port 5555

$ ./gdb -ex "set non-stop on" -ex "target extended-remote :5555"
GNU gdb (GDB) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Remote debugging using :5555
Remote debugging from host 127.0.0.1, port 59942
Reading /.../test from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to
access files locally instead.
Reading /.../test from remote target...
Reading symbols from target:/.../test...
../../gdb-13.2/gdb/remote.c:8352: internal-error: wait: Assertion
`!async_event_handler_marked (rs->remote_async_inferior_event_token)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
----- Backtrace -----
0x55e67dce9cbb gdb_internal_backtrace_1
        ../../gdb-13.2/gdb/bt-utils.c:122
0x55e67dce9cbb _Z22gdb_internal_backtracev
        ../../gdb-13.2/gdb/bt-utils.c:168
0x55e67e09ea1c internal_vproblem
        ../../gdb-13.2/gdb/utils.c:396
0x55e67e09ec3a _Z15internal_verrorPKciS0_P13__va_list_tag
        ../../gdb-13.2/gdb/utils.c:476
0x55e67e1e787e _Z18internal_error_locPKciS0_z
        ../../gdb-13.2/gdbsupport/errors.cc:58
0x55e67dfaac74
_ZN13remote_target4waitE6ptid_tP17target_waitstatus10enum_flagsI16target_wait_flagE
        ../../gdb-13.2/gdb/remote.c:8351
0x55e67e04cb78
_Z11target_wait6ptid_tP17target_waitstatus10enum_flagsI16target_wait_flagE
        ../../gdb-13.2/gdb/target.c:2579
0x55e67dfa2e18 _ZN13remote_target28process_initial_stop_repliesEi
        ../../gdb-13.2/gdb/remote.c:4579
0x55e67dfacfe6 _ZN13remote_target14start_remote_1Eii
        ../../gdb-13.2/gdb/remote.c:5020
0x55e67dfad668 _ZN13remote_target12start_remoteEii
        ../../gdb-13.2/gdb/remote.c:5072
0x55e67dfad668 _ZN13remote_target6open_1EPKcii
        ../../gdb-13.2/gdb/remote.c:5875
0x55e67e04d211 open_target
        ../../gdb-13.2/gdb/target.c:853
0x55e67dd1e0bf _Z8cmd_funcP16cmd_list_elementPKci
        ../../gdb-13.2/gdb/cli/cli-decode.c:2543
0x55e67e05cfcd _Z15execute_commandPKci
        ../../gdb-13.2/gdb/top.c:690
0x55e67defca94 catch_command_errors
        ../../gdb-13.2/gdb/main.c:513
0x55e67defcbb0 execute_cmdargs
        ../../gdb-13.2/gdb/main.c:608
0x55e67defe31b captured_main_1
        ../../gdb-13.2/gdb/main.c:1299
0x55e67defefca captured_main
        ../../gdb-13.2/gdb/main.c:1320
0x55e67defefca _Z8gdb_mainP18captured_main_args
        ../../gdb-13.2/gdb/main.c:1345
0x55e67dc2850a main
        ../../gdb-13.2/gdb/gdb.c:32
---------------------
../../gdb-13.2/gdb/remote.c:8352: internal-error: wait: Assertion
`!async_event_handler_marked (rs->remote_async_inferior_event_token)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) Recursive internal problem.


Fatal signal: Aborted
----- Backtrace -----
0x55e67dce9cbb gdb_internal_backtrace_1
        ../../gdb-13.2/gdb/bt-utils.c:122
0x55e67dce9cbb _Z22gdb_internal_backtracev
        ../../gdb-13.2/gdb/bt-utils.c:168
0x55e67de0d98a handle_fatal_signal
        ../../gdb-13.2/gdb/event-top.c:956
0x7f14ab8f2f0f ???
0x7f14ab8f2e87 ???
0x7f14ab8f47f0 ???
0x55e67dc2611f abort_with_message
        ../../gdb-13.2/gdb/utils.c:183
0x55e67e09eb2f internal_vproblem
        ../../gdb-13.2/gdb/utils.c:343
0x55e67e09ec3a _Z15internal_verrorPKciS0_P13__va_list_tag
        ../../gdb-13.2/gdb/utils.c:476
0x55e67e1e787e _Z18internal_error_locPKciS0_z
        ../../gdb-13.2/gdbsupport/errors.cc:58
0x55e67dfaac74
_ZN13remote_target4waitE6ptid_tP17target_waitstatus10enum_flagsI16target_wait_flagE
        ../../gdb-13.2/gdb/remote.c:8351
0x55e67e04cb78
_Z11target_wait6ptid_tP17target_waitstatus10enum_flagsI16target_wait_flagE
        ../../gdb-13.2/gdb/target.c:2579
0x55e67de9be49 do_target_wait_1
        ../../gdb-13.2/gdb/infrun.c:3736
0x55e67deae47a operator()
        ../../gdb-13.2/gdb/infrun.c:3795
0x55e67deae47a do_target_wait
        ../../gdb-13.2/gdb/infrun.c:3814
0x55e67deae47a _Z20fetch_inferior_eventv
        ../../gdb-13.2/gdb/infrun.c:4172
0x55e67dca3ac0 _Z26check_async_event_handlersv
        ../../gdb-13.2/gdb/async-event.c:337
0x55e67e1e8a9c _Z16gdb_do_one_eventi
        ../../gdb-13.2/gdbsupport/event-loop.cc:221
0x55e67e05a3c0 _Z20gdb_readline_wrapperPKc
        ../../gdb-13.2/gdb/top.c:1173
0x55e67e09de5e defaulted_query
        ../../gdb-13.2/gdb/utils.c:924
0x55e67e09e19a _Z5queryPKcz
        ../../gdb-13.2/gdb/utils.c:1016
0x55e67e09eaef internal_vproblem
        ../../gdb-13.2/gdb/utils.c:407
0x55e67e09ec3a _Z15internal_verrorPKciS0_P13__va_list_tag
        ../../gdb-13.2/gdb/utils.c:476
0x55e67e1e787e _Z18internal_error_locPKciS0_z
        ../../gdb-13.2/gdbsupport/errors.cc:58
0x55e67dfaac74
_ZN13remote_target4waitE6ptid_tP17target_waitstatus10enum_flagsI16target_wait_flagE
        ../../gdb-13.2/gdb/remote.c:8351
0x55e67e04cb78
_Z11target_wait6ptid_tP17target_waitstatus10enum_flagsI16target_wait_flagE
        ../../gdb-13.2/gdb/target.c:2579
0x55e67dfa2e18 _ZN13remote_target28process_initial_stop_repliesEi
        ../../gdb-13.2/gdb/remote.c:4579
0x55e67dfacfe6 _ZN13remote_target14start_remote_1Eii
        ../../gdb-13.2/gdb/remote.c:5020
0x55e67dfad668 _ZN13remote_target12start_remoteEii
        ../../gdb-13.2/gdb/remote.c:5072
0x55e67dfad668 _ZN13remote_target6open_1EPKcii
        ../../gdb-13.2/gdb/remote.c:5875
0x55e67e04d211 open_target
        ../../gdb-13.2/gdb/target.c:853
0x55e67dd1e0bf _Z8cmd_funcP16cmd_list_elementPKci
        ../../gdb-13.2/gdb/cli/cli-decode.c:2543
0x55e67e05cfcd _Z15execute_commandPKci
        ../../gdb-13.2/gdb/top.c:690
0x55e67defca94 catch_command_errors
        ../../gdb-13.2/gdb/main.c:513
0x55e67defcbb0 execute_cmdargs
        ../../gdb-13.2/gdb/main.c:608
0x55e67defe31b captured_main_1
        ../../gdb-13.2/gdb/main.c:1299
0x55e67defefca captured_main
        ../../gdb-13.2/gdb/main.c:1320
0x55e67defefca _Z8gdb_mainP18captured_main_args
        ../../gdb-13.2/gdb/main.c:1345
0x55e67dc2850a main
        ../../gdb-13.2/gdb/gdb.c:32
---------------------
A fatal error internal to GDB has been detected, further
debugging is not possible.  GDB will now terminate.

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.

Remote side has terminated connection.  GDBserver will reopen the connection.
Listening on port 5555
Aborted (core dumped)

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

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

end of thread, other threads:[~2023-10-10 16:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-12  9:16 [Bug gdb/30630] New: remote.c:8352: internal-error: wait: Assertion `!async_event_handler_marked (rs->remote_async_inferior_event_token)' failed christian.prochaska@genode-labs.com
2023-08-23  4:28 ` [Bug gdb/30630] " rajesh.palla at amd dot com
2023-08-23 18:13 ` tromey at sourceware dot org
2023-08-31 23:34 ` Mikhail.Terekhov at dell dot com
2023-09-01  0:02 ` Mikhail.Terekhov at dell dot com
2023-09-01  0:23 ` Mikhail.Terekhov at dell dot com
2023-09-01  1:00 ` christian.prochaska@genode-labs.com
2023-09-01 15:15 ` Mikhail.Terekhov at dell dot com
2023-09-05 22:59 ` Mikhail.Terekhov at dell dot com
2023-10-02 22:12 ` Mikhail.Terekhov at dell dot com
2023-10-03 13:48 ` simon.marchi at polymtl dot ca
2023-10-10 16:42 ` cvs-commit 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).