From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 256BA3858C2A; Tue, 31 Oct 2023 15:53:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 256BA3858C2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1698767599; bh=8fghqow+xX+eOhpLzo8tLQ3mZPrXOY0jf2TUATu5xDc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DHKTm1Jz/8EmJWYGunPHG7Kq1D9e4uqENPte14NxJvQKDmi8AKTLeNxoXHabZZfMm 7Ehs1MCWfx6fAr7WcvhMBR3yz2MRzAVlXfJ7vLtMtWmcYlLDNS0SOA7QVD1bM3BybV 8HCI+xd3kUUhu6ltKototQe2zYI5VBtHXaSs5DLw= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/30547] [gdb, s390x, ppc64] segfault in for_each_block Date: Tue, 31 Oct 2023 15:53:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 13.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW 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: Message-ID: In-Reply-To: References: 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=3D30547 --- Comment #3 from Tom de Vries --- I set a watchpoint: ... (gdb) p reg_obj $3 =3D (registry *) 0x12ee2e80 (gdb) p *reg_obj $4 =3D {m_fields =3D std::vector of length 1, capacity 1 =3D {0x0}} (gdb) what *reg_obj type =3D registry (gdb) p *(registry *) 0x12ee2e80 $5 =3D {m_fields =3D std::vector of length 1, capacity 1 =3D {0x0}} (gdb) watch *(registry *) 0x12ee2e80 Watchpoint 2: *(registry *) 0x12ee2e80 ... and ran into: ... Watchpoint 2: *(registry *) 0x12ee2e80 Old value =3D {m_fields =3D std::vector of length 1, capacity 1 =3D {0x1332= 2180}} New value =3D {m_fields =3D std::vector of length 39665389, capacity 396653= 89 =3D { 0x00003fffb738b4f0 in .__libc_free () from /lib64/libc.so.6 (gdb) bt #0 0x00003fffb738b4f0 in .__libc_free () from /lib64/libc.so.6 #1 0x000000001176e760 in operator delete (p=3D0x12ee2e80) at /home/vries/gdb/src/gdbsupport/new-op.cc:109 #2 0x00000000108fffa8 in program_space::~program_space (this=3D0x13312100, __in_chrg=3D) at /home/vries/gdb/src/gdb/progspace.c:125 #3 0x000000001068e44c in delete_inferior (inf=3D0x13327290) at /home/vries/gdb/src/gdb/inferior.c:290 #4 0x000000001068ef6c in prune_inferiors () at /home/vries/gdb/src/gdb/inferior.c:480 #5 0x00000000106a72d4 in fetch_inferior_event () at /home/vries/gdb/src/gdb/infrun.c:4558 #6 0x0000000010672994 in inferior_event_handler (event_type=3DINF_REG_EVEN= T) at /home/vries/gdb/src/gdb/inf-loop.c:42 #7 0x000000001071bef0 in handle_target_event (error=3D0, client_data=3D0x0= ) at /home/vries/gdb/src/gdb/linux-nat.c:4243 #8 0x0000000011764ec8 in handle_file_event (file_ptr=3D0x1311beb0, ready_m= ask=3D1) at /home/vries/gdb/src/gdbsupport/event-loop.cc:573 #9 0x00000000117654a0 in gdb_wait_for_event (block=3D0) at /home/vries/gdb/src/gdbsupport/event-loop.cc:694 #10 0x0000000011763ac8 in gdb_do_one_event (mstimeout=3D-1) at /home/vries/gdb/src/gdbsupport/event-loop.cc:217 #11 0x0000000010c5936c in wait_sync_command_done () at /home/vries/gdb/src/gdb/top.c:427 #12 0x0000000010c59470 in maybe_wait_sync_command_done (was_sync=3D0) at /home/vries/gdb/src/gdb/top.c:444 #13 0x0000000010c59c08 in execute_command (p=3D0x1329c830 "", from_tty=3D0)= at /home/vries/gdb/src/gdb/top.c:577 #14 0x0000000010576c60 in command_handler (command=3D0x1329c828 "continue")= at /home/vries/gdb/src/gdb/event-top.c:552 #15 0x0000000010c58f90 in read_command_file (stream=3D0x12ff05b0) at /home/vries/gdb/src/gdb/top.c:342 #16 0x0000000010323214 in script_from_file (stream=3D0x12ff05b0,=20 file=3D0x3ffffffff6a2 "./build/gdb/testsuite/outputs/gdb.base/vfork-follow-parent/gdb.in.2") at /home/vries/gdb/src/gdb/cli/cli-script.c:1642 #17 0x00000000102f99c8 in source_script_from_stream (stream=3D0x12ff05b0,=20 file=3D0x3ffffffff6a2 "./build/gdb/testsuite/outputs/gdb.base/vfork-follow-parent/gdb.in.2",=20 file_to_open=3D0x12f57e28 "./build/gdb/testsuite/outputs/gdb.base/vfork-follow-parent/gdb.in.2") at /home/vries/gdb/src/gdb/cli/cli-cmds.c:730 #18 0x00000000102f9b94 in source_script_with_search ( file=3D0x3ffffffff6a2 "./build/gdb/testsuite/outputs/gdb.base/vfork-follow-parent/gdb.in.2", from_tty=3D0,=20 search_path=3D0) at /home/vries/gdb/src/gdb/cli/cli-cmds.c:775 ---Type to continue, or q to quit--- #19 0x00000000102f9c7c in source_script ( file=3D0x3ffffffff6a2 "./build/gdb/testsuite/outputs/gdb.base/vfork-follow-parent/gdb.in.2", from_tty=3D0) at /home/vries/gdb/src/gdb/cli/cli-cmds.c:784 #20 0x000000001078c7c4 in catch_command_errors (command=3D@0x12867548: 0x10= 2f9c44 ,=20 arg=3D0x3ffffffff6a2 "./build/gdb/testsuite/outputs/gdb.base/vfork-follow-parent/gdb.in.2", from_tty=3D0,=20 do_bp_actions=3Dfalse) at /home/vries/gdb/src/gdb/main.c:513 #21 0x000000001078cadc in execute_cmdargs (cmdarg_vec=3D0x3fffffffec18, file_type=3DCMDARG_FILE,=20 cmd_type=3DCMDARG_COMMAND, ret=3D0x3fffffffec48) at /home/vries/gdb/src/gdb/main.c:610 #22 0x000000001078e848 in captured_main_1 (context=3D0x3fffffffeee0) at /home/vries/gdb/src/gdb/main.c:1293 #23 0x000000001078eb1c in captured_main (data=3D0x3fffffffeee0) at /home/vries/gdb/src/gdb/main.c:1314 #24 0x000000001078ec14 in gdb_main (args=3D0x3fffffffeee0) at /home/vries/gdb/src/gdb/main.c:1343 #25 0x000000001001a180 in main (argc=3D8, argv=3D0x3ffffffff358) at /home/vries/gdb/src/gdb/gdb.c:39 (gdb)=20 ... So, AFAIU we have program_space::~program_space: ... if (!gdbarch_has_shared_address_space (target_gdbarch ())) delete this->aspace; ... which calls the address space destructor, which deletes: ... /* Per aspace data-pointers required by other GDB modules. */ registry registry_fields; ... which invalidates: ... static const registry::key target_dcache_aspace_key; ... --=20 You are receiving this mail because: You are on the CC list for the bug.=