From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 28A73386547E; Thu, 4 Jan 2024 22:13:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28A73386547E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1704406401; bh=SiDlUNxy6qrUCl9Nx/jsy+KiByOtMnx3D1Etx1sgA6M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Uxq0e90ygeDEpmKPt4so+jkapwFdi0yy7MsmbJVWbl3ds09/6JHTi7kDsvBuhPAZK LCY0vkylmhGplOGHLVTus1iIgcSL82+bIIrKA8Tou/wpdSvWoopMMWoxqBxU3uzSo2 Pm5hQZN599ryExFy5M5jAVxekoVBHDQnREyFdN/I= From: "ssbssa at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug gdb/23555] Segmentation fault on attempt to print warning that getcwd failed Date: Thu, 04 Jan 2024 22:13:19 +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: 8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ssbssa at sourceware dot org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: sergiodj at sergiodj dot net X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D23555 Hannes Domani changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ssbssa at sourceware dot o= rg --- Comment #7 from Hannes Domani --- (In reply to Sourceware Commits from comment #5) > The master branch has been updated by Tom Tromey : >=20 > https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git; > h=3D20f0d60db4fb5083779c4c9182bbc692f7d2bac5 >=20 > commit 20f0d60db4fb5083779c4c9182bbc692f7d2bac5 > Author: Tom Tromey > Date: Fri Oct 5 14:54:35 2018 -0600 >=20 > Avoid crash when calling warning too early >=20=20=20=20=20 > I noticed that if you pass the name of an existing file (not a > directory) as the argument to --data-directory, gdb will crash: >=20=20=20=20=20 > $ ./gdb -nx --data-directory ./gdb > ../../binutils-gdb/gdb/target.c:590:56: runtime error: member call > on null pointer of type 'struct target_ops' >=20=20=20=20=20 > This was later reported as PR gdb/23838. >=20=20=20=20=20 > This happens because warning ends up calling > target_supports_terminal_ours, which calls current_top_target, which > returns nullptr this early. >=20=20=20=20=20 > This fixes the problem by handling this case specially in > target_supports_terminal_ours. I also changed > target_supports_terminal_ours to return bool. >=20=20=20=20=20 > gdb/ChangeLog > 2018-11-08 Tom Tromey >=20=20=20=20=20 > PR gdb/23555: > PR gdb/23838: > * target.h (target_supports_terminal_ours): Return bool. > * target.c (target_supports_terminal_ours): Handle case where > current_top_target returns nullptr. Return bool. >=20=20=20=20=20 > gdb/testsuite/ChangeLog > 2018-11-08 Tom Tromey >=20=20=20=20=20 > PR gdb/23555: > PR gdb/23838: > * gdb.base/warning.exp: New file. Can this be closed? --=20 You are receiving this mail because: You are on the CC list for the bug.=