public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb/gdb-7.11-branch] btrace: fix PR gdb/19829
@ 2016-03-17 11:28 sergiodj+buildbot
  2016-03-17 11:30 ` Failures on AIX-POWER7-plain, branch gdb-7.11-branch sergiodj+buildbot
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: sergiodj+buildbot @ 2016-03-17 11:28 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT 2ef34d11f61d79dcb152713aa059051d8cd3295d ***

Author: Markus Metzger <markus.t.metzger@intel.com>
Branch: gdb-7.11-branch
Commit: 2ef34d11f61d79dcb152713aa059051d8cd3295d

btrace: fix PR gdb/19829

This is a backport of

33b4777ca1b7 btrace, frame: fix crash in get_frame_type
a038fa3e14a4 stack: check frame_unwind_caller_id
2f3ef606b912 frame: add skip_tailcall_frames

In skip_artificial_frames we repeatedly call get_prev_frame_always until we get
a non-inline and non-tailcall frame assuming that there must be such a frame
eventually.

For record targets, however, we may have a frame chain that consists only of
artificial frames.  This leads to a crash in get_frame_type when dereferencing a
NULL frame pointer.

Change skip_artificial_frames and skip_tailcall_frames to return NULL in such a
case and modify each caller to cope with a NULL return.

In frame_unwind_caller_pc and frame_unwind_caller_arch, we simply assert that
the returned value is not NULL.  Their caller was supposed to check
frame_unwind_caller_id before calling those functions.

In other cases, we thrown an error.

In infcmd further move the skip_tailcall_frames call to the forward-stepping
case since we don't need a frame for reverse execution and we don't want to fail
because of that.  Reverse-finish does make sense for a tailcall frame.

gdb/
	* frame.h (skip_tailcall_frames): New.
	* infcmd.c (finish_command): Call skip_tailcall_frames.
	* frame.c (skip_artificial_frames): Return NULL if only artificial frames
	are found.  Update comment.
	(frame_pop): Call skip_tailcall_frames.
	(frame_unwind_caller_id): Handle NULL return.
	(frame_unwind_caller_pc, frame_unwind_caller_arch): Assert that
	skip_artificial_frames does not return NULL.
	(frame_pop): Add an error if only tailcall frames are found.
	* infcmd.c (finish_command): Move skip_tailcall_frames call into forward-
	execution case.  Add an error if only tailcall frames are found.
	* stack.c (frame_info): Check frame_unwind_caller_id.

testsuite/
	* gdb.btrace/tailcall-only.exp: New.
	* gdb.btrace/tailcall-only.c: New.
	* gdb.btrace/x86_64-tailcall-only.S: New.
	* gdb.btrace/i686-tailcall-only.S: New.


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

end of thread, other threads:[~2016-03-18 10:01 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-17 11:28 [binutils-gdb/gdb-7.11-branch] btrace: fix PR gdb/19829 sergiodj+buildbot
2016-03-17 11:30 ` Failures on AIX-POWER7-plain, branch gdb-7.11-branch sergiodj+buildbot
2016-03-17 11:47 ` Failures on RHEL-s390x-m64, " sergiodj+buildbot
2016-03-18  0:03 ` Failures on Fedora-i686, " sergiodj+buildbot
2016-03-18  0:13 ` Failures on Fedora-x86_64-m32, " sergiodj+buildbot
2016-03-18  0:21 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " sergiodj+buildbot
2016-03-18  0:28 ` Failures on Fedora-x86_64-cc-with-index, " sergiodj+buildbot
2016-03-18  0:32 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2016-03-18  0:41 ` Failures on Fedora-x86_64-native-gdbserver-m64, " sergiodj+buildbot
2016-03-18  0:45 ` Failures on Fedora-x86_64-m64, " sergiodj+buildbot
2016-03-18  0:47 ` Failures on Fedora-x86_64-native-gdbserver-m32, " sergiodj+buildbot
2016-03-18  1:32 ` Failures on Fedora-s390x-m64, " sergiodj+buildbot
2016-03-18  1:37 ` Failures on Debian-s390x-native-gdbserver-m64, " sergiodj+buildbot
2016-03-18  1:50 ` Failures on Debian-s390x-m64, " sergiodj+buildbot
2016-03-18  2:31 ` Failures on Debian-s390x-native-extended-gdbserver-m64, " sergiodj+buildbot
2016-03-18  5:14 ` Failures on Fedora-ppc64be-native-gdbserver-m64, " sergiodj+buildbot
2016-03-18  5:37 ` Failures on Fedora-ppc64be-native-extended-gdbserver-m64, " sergiodj+buildbot
2016-03-18  6:28 ` Failures on Debian-i686, " sergiodj+buildbot
2016-03-18  6:55 ` Failures on Debian-i686-native-gdbserver, " sergiodj+buildbot
2016-03-18  7:38 ` Failures on Debian-i686-native-extended-gdbserver, " sergiodj+buildbot
2016-03-18  9:07 ` Failures on Fedora-ppc64le-native-extended-gdbserver-m64, " sergiodj+buildbot
2016-03-18  9:17 ` Failures on Fedora-ppc64le-cc-with-index, " sergiodj+buildbot
2016-03-18  9:26 ` Failures on Debian-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2016-03-18  9:39 ` Failures on Fedora-ppc64le-native-gdbserver-m64, " sergiodj+buildbot
2016-03-18  9:45 ` Failures on Debian-x86_64-m64, " sergiodj+buildbot
2016-03-18  9:49 ` Failures on Fedora-ppc64le-m64, " sergiodj+buildbot
2016-03-18 10:01 ` Failures on Debian-x86_64-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).