From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by sourceware.org (Postfix) with ESMTPS id A531F386F442 for ; Sat, 16 May 2020 12:56:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A531F386F442 Received: by mail-lj1-x230.google.com with SMTP id a21so5058875ljj.11 for ; Sat, 16 May 2020 05:56:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=6AQUp7VdTzilV7667uwk1YTJfIrmGmvMv382ppQK+fs=; b=LCkNm3tP1gEGqgiGjscau92kK6YPfmQ44MRv2TMHzQ3sWugaohM0V8thuvPeO01WAk 2oNsON87HHdQpUgty1au8JQTf7uKltW3kmktLgaqxdj3awaCdvePu0lETNgvnd27Emvv E2kXT641iVN1LglZJtX5N2pe0lM6i7wHra0KNNY3UmsxZD9/m44rEA5Dd/U8fT4ugOhx UJCjqPGTRKhEmin2ZnSz+GiGJUQHjfZ0EJT8qAuU4kOZcNhsFGRw5FixngcN4xftRpnV xSwDcwKx68+w5TtA+JrrJkXLpkkRNNV4Jz+5YmubQQLKvoakqPpMgW21/JPyagPf/MLH UvXw== X-Gm-Message-State: AOAM533w4Uto7yEJ7Axgiz4g8eYNT1i0lK3X+ZVVbYG0zfEKZHlXAWgn 51/OoAG+4qRpNyGLNheazYxaSGCE9f4HF7+oDdy/LI4ibBc= X-Google-Smtp-Source: ABdhPJyN3MQwQVihks7mUJhYPaKoIzZ8ZU8hEDeDPqGnrDgGOUUBbr9HTDpGtXCt9XQ03Q2i3FD+DSC/wJjl/kY2QkI= X-Received: by 2002:a2e:8884:: with SMTP id k4mr5303022lji.267.1589633791928; Sat, 16 May 2020 05:56:31 -0700 (PDT) MIME-Version: 1.0 From: William Tambe Date: Sat, 16 May 2020 08:56:20 -0400 Message-ID: Subject: Target sim crashes when recording for reverse debugging; find_inferior_ptid returns null To: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 12:56:35 -0000 ../../iron-toolchain/binutils/gdb/process-stratum-target.c:47: internal-error: virtual gdbarch* process_stratum_target::thread_architecture(ptid_t): Assertion `inf != NULL' failed. Above is the crash that occur after issuing following gdb commands: target sim load record si The crash occurs because find_inferior_ptid() returns NULL. >From below backtrace, is it possible to determine what could be the cause of find_inferior_ptid() returning NULL ? (gdb) record (gdb) si Thread 1 "iron-elf-gdb" hit Breakpoint 1, process_stratum_target::thread_architecture (this=, ptid=...) at ../../iron-toolchain/binutils/gdb/process-stratum-target.c:47 47 gdb_assert (inf != NULL); => 0x00005555557cd709 : 48 83 c4 20 add $0x20,%rsp 0x00005555557cd70d : 48 85 c0 test %rax,%rax 0x00005555557cd710 : 74 0c je 0x5555557cd71e (gdb) p inf $2 = (inferior *) 0x555555cc3d90 (gdb) bt #0 process_stratum_target::thread_architecture (this=, ptid=...) at ../../iron-toolchain/binutils/gdb/process-stratum-target.c:47 #1 0x00005555557df091 in record_full_target::resume (this=0x555555bc8fb0 , ptid=..., step=0, signal=GDB_SIGNAL_0) at ../../iron-toolchain/binutils/gdb/record-full.c:1078 #2 0x0000555555865670 in target_resume (ptid=..., step=0, signal=GDB_SIGNAL_0) at ../../iron-toolchain/binutils/gdb/target.h:1326 #3 0x00005555557531ab in do_target_resume (resume_ptid=..., step=0, sig=GDB_SIGNAL_0) at ../../iron-toolchain/binutils/gdb/infrun.c:2264 #4 0x000055555575af02 in resume_1 (sig=GDB_SIGNAL_0) at ../../iron-toolchain/binutils/gdb/infrun.c:2653 #5 resume (sig=GDB_SIGNAL_0) at ../../iron-toolchain/binutils/gdb/infrun.c:2666 #6 0x000055555575bca0 in keep_going_pass_signal (ecs=0x7fffffffd870) at ../../iron-toolchain/binutils/gdb/infrun.c:8044 #7 0x000055555575bfd1 in start_step_over () at ../../iron-toolchain/binutils/gdb/infrun.c:2049 #8 0x0000555555761f1e in proceed (addr=addr@entry=18446744073709551615, siggnal=siggnal@entry=GDB_SIGNAL_DEFAULT) at ../../iron-toolchain/binutils/gdb/infrun.c:3130 #9 0x000055555574b091 in step_1 (skip_subroutines=0, single_inst=, count_string=) at ../../iron-toolchain/binutils/gdb/infcmd.c:1047 #10 0x000055555566125a in cmd_func (cmd=, args=, from_tty=) at ../../iron-toolchain/binutils/gdb/cli/cli-decode.c:2004 #11 0x0000555555880073 in execute_command (p=, p@entry=0x555555e2ec70 "si", from_tty=1) at ../../iron-toolchain/binutils/gdb/top.c:655 #12 0x000055555570c755 in command_handler (command=0x555555e2ec70 "si") at ../../iron-toolchain/binutils/gdb/event-top.c:588 #13 0x000055555570d631 in command_line_handler (rl=...) at ../../iron-toolchain/binutils/gdb/event-top.c:773 #14 0x000055555570cfcc in gdb_rl_callback_handler (rl=0x555555ccfb60 "si") at /usr/include/c++/9/bits/unique_ptr.h:153 #15 0x000055555590ffe8 in rl_callback_read_char () at ../../../iron-toolchain/binutils/readline/readline/callback.c:281 #16 0x000055555570c276 in gdb_rl_callback_read_char_wrapper_noexcept () at ../../iron-toolchain/binutils/gdb/event-top.c:177 #17 0x000055555570ce85 in gdb_rl_callback_read_char_wrapper (client_data=) at ../../iron-toolchain/binutils/gdb/event-top.c:193 #18 0x000055555570c198 in stdin_event_handler (error=, client_data=0x555555c087e0) at ../../iron-toolchain/binutils/gdb/event-top.c:516 #19 0x0000555555993226 in gdb_wait_for_event (block=block@entry=1) at ../../iron-toolchain/binutils/gdbsupport/event-loop.cc:673 #20 0x000055555599349b in gdb_wait_for_event (block=1) at ../../iron-toolchain/binutils/gdbsupport/event-loop.cc:569 #21 gdb_do_one_event () at ../../iron-toolchain/binutils/gdbsupport/event-loop.cc:215 #22 0x00005555557856a5 in start_event_loop () at ../../iron-toolchain/binutils/gdb/main.c:356 #23 captured_command_loop () at ../../iron-toolchain/binutils/gdb/main.c:416 #24 0x00005555557875e5 in captured_main (data=) at ../../iron-toolchain/binutils/gdb/main.c:1254 #25 gdb_main (args=) at ../../iron-toolchain/binutils/gdb/main.c:1269 #26 0x00005555555da2b0 in main (argc=, argv=) at ../../iron-toolchain/binutils/gdb/gdb.c:32 (gdb) c Continuing. iron-gdb: iron_process_record: addr == 0x1f448 Thread 1 "iron-elf-gdb" hit Breakpoint 1, process_stratum_target::thread_architecture (this=, ptid=...) at ../../iron-toolchain/binutils/gdb/process-stratum-target.c:47 47 gdb_assert (inf != NULL); => 0x00005555557cd709 : 48 83 c4 20 add $0x20,%rsp 0x00005555557cd70d : 48 85 c0 test %rax,%rax 0x00005555557cd710 : 74 0c je 0x5555557cd71e (gdb) p inf $3 = (inferior *) 0x555555cc3d90 (gdb) bt #0 process_stratum_target::thread_architecture (this=, ptid=...) at ../../iron-toolchain/binutils/gdb/process-stratum-target.c:47 #1 0x00005555557e56e3 in get_thread_regcache (target=0x555555bc9060 , ptid=...) at ../../iron-toolchain/binutils/gdb/regcache.c:373 #2 0x00005555557e57c4 in get_thread_regcache (thread=) at ../../iron-toolchain/binutils/gdb/target.h:1323 #3 0x000055555575e507 in handle_signal_stop (ecs=0x7fffffffde10) at ../../iron-toolchain/binutils/gdb/infrun.c:5874 #4 0x000055555576061c in handle_inferior_event (ecs=) at ../../iron-toolchain/binutils/gdb/infrun.c:5585 #5 0x00005555557615bd in fetch_inferior_event (client_data=) at ../../iron-toolchain/binutils/gdb/infrun.c:4027 #6 0x000055555560b43a in check_async_event_handlers () at ../../iron-toolchain/binutils/gdb/async-event.c:295 #7 0x000055555599345b in gdb_do_one_event () at ../../iron-toolchain/binutils/gdbsupport/event-loop.cc:194 #8 0x00005555557856a5 in start_event_loop () at ../../iron-toolchain/binutils/gdb/main.c:356 #9 captured_command_loop () at ../../iron-toolchain/binutils/gdb/main.c:416 #10 0x00005555557875e5 in captured_main (data=) at ../../iron-toolchain/binutils/gdb/main.c:1254 #11 gdb_main (args=) at ../../iron-toolchain/binutils/gdb/main.c:1269 #12 0x00005555555da2b0 in main (argc=, argv=) at ../../iron-toolchain/binutils/gdb/gdb.c:32 (gdb) c Continuing. 0x0001f44a 713 struct task_struct *tsk = current; => 0x0001f44a : f6 51 ld32 %5, %1 0x0001f44c : 82 44 li8 %4, 0x24 # 36 0x0001f44e : b8 40 add %4, %sp 0x0001f450 : f2 54 st32 %5, %4 (gdb) si Thread 1 "iron-elf-gdb" hit Breakpoint 1, process_stratum_target::thread_architecture (this=, ptid=...) at ../../iron-toolchain/binutils/gdb/process-stratum-target.c:47 47 gdb_assert (inf != NULL); => 0x00005555557cd709 : 48 83 c4 20 add $0x20,%rsp 0x00005555557cd70d : 48 85 c0 test %rax,%rax 0x00005555557cd710 : 74 0c je 0x5555557cd71e (gdb) p inf $4 = (inferior *) 0x0 (gdb) bt #0 process_stratum_target::thread_architecture (this=, ptid=...) at ../../iron-toolchain/binutils/gdb/process-stratum-target.c:47 #1 0x00005555557df091 in record_full_target::resume (this=0x555555bc8fb0 , ptid=..., step=0, signal=GDB_SIGNAL_0) at ../../iron-toolchain/binutils/gdb/record-full.c:1078 #2 0x0000555555865670 in target_resume (ptid=..., step=0, signal=GDB_SIGNAL_0) at ../../iron-toolchain/binutils/gdb/target.h:1326 #3 0x00005555557531ab in do_target_resume (resume_ptid=..., step=0, sig=GDB_SIGNAL_0) at ../../iron-toolchain/binutils/gdb/infrun.c:2264 #4 0x000055555575af02 in resume_1 (sig=GDB_SIGNAL_0) at ../../iron-toolchain/binutils/gdb/infrun.c:2653 #5 resume (sig=GDB_SIGNAL_0) at ../../iron-toolchain/binutils/gdb/infrun.c:2666 #6 0x000055555575bca0 in keep_going_pass_signal (ecs=0x7fffffffdac0) at ../../iron-toolchain/binutils/gdb/infrun.c:8044 #7 0x000055555576254b in proceed (addr=addr@entry=18446744073709551615, siggnal=siggnal@entry=GDB_SIGNAL_DEFAULT) at ../../iron-toolchain/binutils/gdb/infrun.c:3198 #8 0x000055555574b091 in step_1 (skip_subroutines=0, single_inst=, count_string=) at ../../iron-toolchain/binutils/gdb/infcmd.c:1047 #9 0x000055555566125a in cmd_func (cmd=, args=, from_tty=) at ../../iron-toolchain/binutils/gdb/cli/cli-decode.c:2004 #10 0x0000555555880073 in execute_command (p=, p@entry=0x5555560cdcd0 "si", from_tty=1) at ../../iron-toolchain/binutils/gdb/top.c:655 #11 0x000055555570c755 in command_handler (command=0x5555560cdcd0 "si") at ../../iron-toolchain/binutils/gdb/event-top.c:588 #12 0x000055555570d631 in command_line_handler (rl=...) at ../../iron-toolchain/binutils/gdb/event-top.c:773 #13 0x000055555570cfcc in gdb_rl_callback_handler (rl=0x5555560ca130 "si") at /usr/include/c++/9/bits/unique_ptr.h:153 #14 0x000055555590ffe8 in rl_callback_read_char () at ../../../iron-toolchain/binutils/readline/readline/callback.c:281 #15 0x000055555570c276 in gdb_rl_callback_read_char_wrapper_noexcept () at ../../iron-toolchain/binutils/gdb/event-top.c:177 #16 0x000055555570ce85 in gdb_rl_callback_read_char_wrapper (client_data=) at ../../iron-toolchain/binutils/gdb/event-top.c:193 #17 0x000055555570c198 in stdin_event_handler (error=, client_data=0x555555c087e0) at ../../iron-toolchain/binutils/gdb/event-top.c:516 #18 0x0000555555993226 in gdb_wait_for_event (block=block@entry=1) at ../../iron-toolchain/binutils/gdbsupport/event-loop.cc:673 #19 0x000055555599349b in gdb_wait_for_event (block=1) at ../../iron-toolchain/binutils/gdbsupport/event-loop.cc:569 #20 gdb_do_one_event () at ../../iron-toolchain/binutils/gdbsupport/event-loop.cc:215 #21 0x00005555557856a5 in start_event_loop () at ../../iron-toolchain/binutils/gdb/main.c:356 #22 captured_command_loop () at ../../iron-toolchain/binutils/gdb/main.c:416 #23 0x00005555557875e5 in captured_main (data=) at ../../iron-toolchain/binutils/gdb/main.c:1254 #24 gdb_main (args=) at ../../iron-toolchain/binutils/gdb/main.c:1269 #25 0x00005555555da2b0 in main (argc=, argv=) at ../../iron-toolchain/binutils/gdb/gdb.c:32 (gdb) c Continuing. ../../iron-toolchain/binutils/gdb/process-stratum-target.c:47: internal-error: virtual gdbarch* process_stratum_target::thread_architecture(ptid_t): Assertion `inf != NULL' failed.