public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb/gdb-8.2-branch] Avoid crash when calling warning too early
@ 2018-11-19 19:08 sergiodj+buildbot
  2018-11-19 19:19 ` Failures on RHEL-s390x-m64, branch gdb-8.2-branch sergiodj+buildbot
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: sergiodj+buildbot @ 2018-11-19 19:08 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT 9ec912f34410c33de581b5af4a0773c12b4fe20a ***

Author: Tom Tromey <tom@tromey.com>
Branch: gdb-8.2-branch
Commit: 9ec912f34410c33de581b5af4a0773c12b4fe20a

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.


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-11-20  1:12 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19 19:08 [binutils-gdb/gdb-8.2-branch] Avoid crash when calling warning too early sergiodj+buildbot
2018-11-19 19:19 ` Failures on RHEL-s390x-m64, branch gdb-8.2-branch sergiodj+buildbot
2018-11-19 21:31 ` Failures on Fedora-s390x-m64, " sergiodj+buildbot
2018-11-19 22:01 ` Failures on Debian-s390x-native-extended-gdbserver-m64, " sergiodj+buildbot
2018-11-19 22:21 ` Failures on Fedora-i686, " sergiodj+buildbot
2018-11-19 22:29 ` Failures on Debian-s390x-native-gdbserver-m64, " sergiodj+buildbot
2018-11-19 22:42 ` Failures on Debian-s390x-m64, " sergiodj+buildbot
2018-11-19 22:46 ` Failures on Fedora-x86_64-cc-with-index, " sergiodj+buildbot
2018-11-19 22:57 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " sergiodj+buildbot
2018-11-19 23:07 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2018-11-19 23:14 ` Failures on Fedora-x86_64-native-gdbserver-m64, " sergiodj+buildbot
2018-11-19 23:17 ` Failures on Fedora-x86_64-m64, " sergiodj+buildbot
2018-11-19 23:31 ` Failures on Fedora-x86_64-m32, " sergiodj+buildbot
2018-11-20  0:17 ` Failures on Fedora-x86_64-native-gdbserver-m32, " sergiodj+buildbot
2018-11-20  0:50 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, " sergiodj+buildbot
2018-11-20  2:09 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " sergiodj+buildbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).