This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/23555] Segmentation fault on attempt to print warning that getcwd failed
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Mon, 19 Nov 2018 18:34:13 +0000
- Subject: [Bug gdb/23555] Segmentation fault on attempt to print warning that getcwd failed
- Auto-submitted: auto-generated
- References: <bug-23555-4717@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=23555
--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-8.2-branch branch has been updated by Tom Tromey
<tromey@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9ec912f34410c33de581b5af4a0773c12b4fe20a
commit 9ec912f34410c33de581b5af4a0773c12b4fe20a
Author: Tom Tromey <tom@tromey.com>
Date: Fri Oct 5 14:54:35 2018 -0600
Avoid crash when calling warning too early
I noticed that if you pass the name of an existing file (not a
directory) as the argument to --data-directory, gdb will crash:
$ ./gdb -nx --data-directory ./gdb
../../binutils-gdb/gdb/target.c:590:56: runtime error: member call on
null pointer of type 'struct target_ops'
This was later reported as PR gdb/23838.
This happens because warning ends up calling
target_supports_terminal_ours, which calls current_top_target, which
returns nullptr this early.
This fixes the problem by handling this case specially in
target_supports_terminal_ours. I also changed
target_supports_terminal_ours to return bool.
2018-11-08 Tom Tromey <tom@tromey.com>
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.
gdb/testsuite/ChangeLog
2018-11-08 Tom Tromey <tom@tromey.com>
PR gdb/23555:
PR gdb/23838:
* gdb.base/warning.exp: New file.
--
You are receiving this mail because:
You are on the CC list for the bug.