Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Cc: Markus Metzger <markus.t.metzger@intel.com>
Subject: [patch] Fix cleanup in finish_command
Date: Wed, 19 Jun 2013 21:42:00 -0000	[thread overview]
Message-ID: <20130619211444.GA29379@host2.jankratochvil.net> (raw)

Hi,

I was getting core files (despite GDB PASSes all tests) with the patchset
	[patch v3 00/23] record-btrace: reverse
	http://sourceware.org/ml/gdb-patches/2013-06/msg00214.html
	Message-Id: <1370851496-32313-1-git-send-email-markus.t.metzger@intel.com>

It probably comes from:
	finish^M
	Run till exit from #0  0x00000000004005b5 in bar () at gdb/testsuite/gdb.btrace/x86-tailcall.c:24^M
	0x00000000004005d5 in main () at gdb/testsuite/gdb.btrace/x86-tailcall.c:37^M
	37        answer = foo ();^M
	This record target does not trace registers.^M
	(gdb) PASS: gdb.btrace/tailcall.exp: step, 1.1

It dumps core even without -lmcheck.

(Regression test is still running here.)


Jan


#0  in delete_breakpoint (bpt=0x3ab0780) at breakpoint.c:13494
#1  in finish_command_continuation (arg=0x3a202c0, err=1) at infcmd.c:1593
#2  in do_my_continuations_1 (pmy_chain=0x7fff5c1c8178, err=1) at continuations.c:59
#3  in do_my_continuations (list=0x3916278, err=1) at continuations.c:83
#4  in do_all_continuations_ptid (ptid=..., continuations_p=0x3916278, err=1) at continuations.c:191
#5  in do_all_continuations_thread_callback (thread=0x3916190, data=0x7fff5c1c8254) at continuations.c:202
#6  in do_all_continuations_thread (thread=0x3916190, err=1) at continuations.c:211
#7  in clear_thread_inferior_resources (tp=0x3916190) at thread.c:123
#8  in delete_thread_1 (ptid=..., silent=0) at thread.c:296
#9  in delete_thread (ptid=...) at thread.c:313
#10 in delete_thread_of_inferior (tp=0x3916190, data=0x7fff5c1c83b0) at inferior.c:182
#11 in iterate_over_threads (callback=0x8805ba <delete_thread_of_inferior>, data=0x7fff5c1c83b0) at thread.c:370
#12 in exit_inferior_1 (inftoex=0x37e3620, silent=0) at inferior.c:260
#13 in exit_inferior (pid=8817) at inferior.c:289
#14 in generic_mourn_inferior () at target.c:3679
#15 in inf_ptrace_mourn_inferior (ops=0x368a8f0) at inf-ptrace.c:179
#16 in linux_nat_mourn_inferior (ops=0x368a8f0) at linux-nat.c:4101
#17 in target_mourn_inferior () at target.c:2836
#18 in linux_nat_kill (ops=0x368a8f0) at linux-nat.c:4089
#19 in target_kill () at target.c:482
#20 in record_kill (t=0x1f1fca0 <record_btrace_ops>) at record.c:185
#21 in target_kill () at target.c:482
#22 in kill_or_detach (inf=0x37e3620, args=0x7fff5c1c86d0) at top.c:1311
#23 in iterate_over_inferiors (callback=0x856ed9 <kill_or_detach>, data=0x7fff5c1c86d0) at inferior.c:396
#24 in quit_force (args=0x0, from_tty=0) at top.c:1419
#25 in quit_command (args=0x0, from_tty=0) at ./cli/cli-cmds.c:334
#26 in quit_cover () at top.c:298
#27 in async_disconnect (arg=0x0) at event-top.c:860
#28 in invoke_async_signal_handlers () at event-loop.c:993
#29 in process_event () at event-loop.c:320
#30 in gdb_do_one_event () at event-loop.c:406
#31 in start_event_loop () at event-loop.c:431
#32 in cli_command_loop () at event-top.c:177
#33 in current_interp_command_loop () at interps.c:331
#34 in captured_command_loop (data=0x0) at main.c:260
#35 in catch_errors (func=0x751bbb <captured_command_loop>, func_args=0x0, errstring=0xfdf1f4 "", mask=6) at exceptions.c:546
#36 in captured_main (data=0x7fff5c1c8a80) at main.c:1055
#37 in catch_errors (func=0x751e6e <captured_main>, func_args=0x7fff5c1c8a80, errstring=0xfdf1f4 "", mask=6) at exceptions.c:546
#38 in gdb_main (args=0x7fff5c1c8a80) at main.c:1064
#39 in main (argc=5, argv=0x7fff5c1c8b88) at gdb.c:34


gdb/
2013-06-19  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* infcmd.c (finish_forward): Move discard_cleanups earlier.

diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 30621e4..4a32382 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1691,9 +1691,9 @@ finish_forward (struct symbol *function, struct frame_info *frame)
   cargs->function = function;
   add_continuation (tp, finish_command_continuation, cargs,
                     finish_command_continuation_free_arg);
+  discard_cleanups (old_chain);
   proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT, 0);
 
-  discard_cleanups (old_chain);
   if (!target_can_async_p ())
     do_all_continuations (0);
 }


             reply	other threads:[~2013-06-19 21:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-19 21:42 Jan Kratochvil [this message]
2013-06-20 14:42 ` Jan Kratochvil
2013-06-20 15:26   ` Joel Brobecker
2013-06-20 15:37     ` Metzger, Markus T
2013-06-20 16:45       ` Jan Kratochvil
2013-06-21  8:14         ` Metzger, Markus T
2013-06-21  8:23           ` Jan Kratochvil
2013-06-21  8:25             ` Metzger, Markus T
2013-07-02 14:50               ` Metzger, Markus T
2013-06-21 12:56           ` Jan Kratochvil
2013-06-20 16:06     ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130619211444.GA29379@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=markus.t.metzger@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox