From: Tom Tromey <tromey@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: Current GDB crashes when it sources Emacs's .gdbinit
Date: Wed, 15 Apr 2009 19:44:00 -0000 [thread overview]
Message-ID: <m3k55lg0sj.fsf@fleche.redhat.com> (raw)
In-Reply-To: <83ocuxlopc.fsf@gnu.org> (Eli Zaretskii's message of "Wed\, 15 Apr 2009 22\:08\:31 +0300")
>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
Eli> As far as I could see, it crashes when it reads this line of the
Eli> .gdbinit file supplied with Emacs:
Eli> if $tem[0] == 'w' && $tem[1] == 'i' && $tem[2] == 'n' && $tem[3] == 'd'
Sorry about that. I'm sending the appended fix throughq
regression testing.
Eli> #0 0x00002ae92925956f in obstack_free () from /lib/libc.so.6
Eli> #1 0x000000000044ce70 in do_my_cleanups (pmy_chain=0x8ee2b8,
Eli> old_chain=0xa2e3f0) at utils.c:389
[...]
Eli> (in fact, the
Eli> whole `struct obstack' pointed to by h looks garbled, at least to me):
Eli> I tried to debug this, but as I'm not very familiar with that part of
Eli> GDB (evaluate_expression, evaluate_subexp_c, and friends), I ran out
Eli> of time before I could find the villain. So I'm posting the
Eli> information here, in the hope that someone else could pick up where I
Eli> left off.
A situation where a cleanup is being called and the data is mangled
often means that some piece of code installed a cleanup referring to a
local variable and then forgot to manage the cleanup before a return.
That turned out to be the situation here. If the cleanup function is
unusual enough, a breakpoint in make_cleanup is the easy way to find
the bad call.
Tom
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 0c9e4f8..1fd83a4 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -941,7 +941,10 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
*pos += 2;
if (noside == EVAL_SKIP)
- return NULL;
+ {
+ do_cleanups (cleanup);
+ return NULL;
+ }
if ((dest_type & C_CHAR) != 0)
{
next prev parent reply other threads:[~2009-04-15 19:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-15 19:10 Eli Zaretskii
2009-04-15 19:44 ` Tom Tromey [this message]
2009-04-15 20:36 ` Eli Zaretskii
2009-04-15 21:07 ` Tom Tromey
2009-04-15 21:55 ` Tom Tromey
2009-04-15 22:15 ` Eli Zaretskii
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=m3k55lg0sj.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/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