From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 971273858C2B; Tue, 9 May 2023 16:53:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 971273858C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1683651232; bh=smNJ4virozwYCEzlL9Gj5FxnywfxXRDAIEjsDa9AJhs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=f5A3H/UnaUWDQ/AAN2TbVcySdddIiNAGG0USDQc2pZOUJAH0MAJh1obmaNIuXknfh lxaQXaaRKBmn2pzLMsAwbHMxYZ0qxuMNXohZ1Ucc2p7pXYR5rr3P2FVrdPJ9QjqQwS jjib2kQWmjSQS9oiDdPVNPghvjIdbJ7mfA+EfogM= From: "marian.buschsieweke at ovgu dot de" To: gdb-prs@sourceware.org Subject: [Bug gdb/30431] segfault when inspecting remote variable Date: Tue, 09 May 2023 16:53:52 +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: marian.buschsieweke at ovgu dot de X-Bugzilla-Status: UNCONFIRMED 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=3D30431 --- Comment #3 from Marian Buschsieweke --- btw, the obvious "fix" seems to work here: --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -752,15 +752,15 @@ obj_section =3D bmsym.minsym->obj_section (bmsym.objfile); /* Relocate address, unless there is no section or the variable is a TLS variable. */ - if (obj_section =3D=3D NULL - || (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) !=3D= 0) + if (obj_section =3D=3D NULL || + (obj_section->the_bfd_section && (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) !=3D 0)) addr =3D bmsym.minsym->value_raw_address (); else addr =3D bmsym.value_address (); if (overlay_debugging) addr =3D symbol_overlayed_address (addr, obj_section); /* Determine address of TLS variable. */ - if (obj_section + if (obj_section && obj_section->the_bfd_section && (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) !=3D= 0) addr =3D target_translate_tls_address (obj_section->objfile, addr); } I'm not sure if obj_section->the_bfd_section being NULL was just forgotten = to be taken into account, or if this is rather a symptom of some deeper issue. --=20 You are receiving this mail because: You are on the CC list for the bug.=