From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DAC0B385840B; Tue, 8 Aug 2023 10:04:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAC0B385840B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1691489099; bh=IhUDYrN8AiMK+fMh5p7AKtGLODG2gxO1ZG3/Wtd89o8=; h=From:To:Subject:Date:From; b=vK9/wzuv1BXTod3eCuTvONgmq1Fv7eClt90e5+4m75WB3DetpsaX1pTSbSHTxiw6Q gX21qRqlLeg9gD+WvimvoYGWphPwDOFBMuYcaz++2eBNqLd85on0cT7AzfH/BRki1d p/0U3Z+iW1T3eRS5dxGmfCp9QWuuBbwaJIb1UJpo= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug cli/30735] New: [gdb/cli] demangler warnings missing until later command Date: Tue, 08 Aug 2023 10:04:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: cli X-Bugzilla-Version: HEAD 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D30735 Bug ID: 30735 Summary: [gdb/cli] demangler warnings missing until later command Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: cli Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- I wanted to test this patch ( https://sourceware.org/pipermail/gdb-patches/attachments/20230808/90334ae3/= attachment.bin ) in more detail so I added this code: ... diff --git a/gdb/cp-support.c b/gdb/cp-support.c index 0300727434d..18addf936ac 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -1666,6 +1666,7 @@ gdb_demangle (const char *name, int options) { report_failed_demangle (copy.c_str (), core_dump_allowed, crash_signal); + gdb_assert (false); }); result =3D NULL; ... and ran the testsuite. That didn't trigger anything, so some unit test would probably be a good id= ea. Then I decided to force it, by doing: ... diff --git a/bfd/bfd.c b/bfd/bfd.c index e43a388ac72..4ec4d09c972 100644 --- a/bfd/bfd.c +++ b/bfd/bfd.c @@ -2635,6 +2635,11 @@ bfd_demangle (bfd *abfd, const char *name, int optio= ns) size_t pre_len; bool skip_lead; + char *p =3D NULL; + *p =3D 0; + skip_lead =3D (abfd !=3D NULL && *name !=3D '\0' && bfd_get_symbol_leading_char (abfd) =3D=3D *name); ... That indeed did the trick: ... $ gdb -q -batch a.out -ex start Temporary breakpoint 1 at 0x40051b /data/vries/gdb/src/gdb/cp-support.c:1584: demangler-warning: unable to demangle '_init' (demangler failed with signal 11) Attempting to dump core. /data/vries/gdb/src/gdb/cp-support.c:1598: demangler-warning: unable to demangle '_init' (demangler failed with signal 11) A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) [answered Y; input not from terminal] This is a bug, please report it. For instructions, see: . ... However, we have: ... $ gdb.sh -q -batch a.out $ ... What happened here is that: - demangling was triggered, - the sigsegv was triggered, - the warning was scheduled using run_on_main_thread, but - it was never printed. --=20 You are receiving this mail because: You are on the CC list for the bug.=