public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Keith Seitz <kseitz@firetalk.com>
To: Fernando Nasser <fnasser@cygnus.com>
Cc: tromey@cygnus.com, Insight List <insight@sourceware.cygnus.com>,
	gdb-local@cygnus.com
Subject: Re: core dump
Date: Wed, 19 Apr 2000 12:46:00 -0000	[thread overview]
Message-ID: <38FE0D0B.C4332BDA@firetalk.com> (raw)
In-Reply-To: <38FE0A58.FD220BF9@cygnus.com>

Fernando Nasser wrote:
> 
> Tom Tromey wrote:
> >
> > Insight once again got a segv while I had the watch window up.  This
> > time (as before, I think) it died when I re-ran my program (gcj).  I
> > had rebuilt the program and gdb had to reload it; I don't know whether
> > this happened or not.
> 
> 
> Despite the core happening when inside the update code for watched variables, the problem is
> unrelated to it.  There is no excuse for gdb's value_zero to dump core, but it seems that some
> variable (whatever you are whatching) had a bad formed type.  I would bet it is probably a bug in
> the gdb symbol reading or some compiler debug info malformation.
> 
> Unless someone knows of some limitation when calling value_zero().  There is nothing in the code
> that indicates that.  And it seems that it worked once, before Tom reloaded his program
> 
> Here is how Insight gets the type of a variable:
> 
>   /* To print the type, we simply create a zero value_ptr and
>      cast it to our type. We then typeprint this variable. */
>   val = value_zero (var->type, not_lval);
>   type_print (VALUE_TYPE (val), "", stb, -1);
> 
> Inside value_zero() allocate_value() is called and in its turn calls check_typedef().  The latter
> tries to recurse with TYPE_TARGET_TYPE (type), but that is not valid.  Why?  Nothing to do with
> Insight.
> 

I think that this kind of thing can also occur because re-running (and
reloading symbols) invalidates all of the variable code. The trees that
the variable object interface maintain contain LOTS of references to
transient memory which is invalidated whenever an executable is re-run
or symbols are reloaded. This is what makes it so fast compared to other
solutions. The side effect is, though, that gdbtk must be REALLY careful
about these buggers pointing to garbage because an objfile has been
reread.

I seem to recall adding something to gdbtk to catch this: whenever the
no_inferior hook is run, it should deletes all variables. Srctextwin,
watch, and locals windows should all do this... If not, you get
seemingly random crashes like this.

Keith
-- 
Why chat when you can Firetalk?
Firetalk ID: Keith (10320)
www.firetalk.com

  reply	other threads:[~2000-04-19 12:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-19 11:19 Tom Tromey
2000-04-19 12:35 ` Fernando Nasser
2000-04-19 12:46   ` Keith Seitz [this message]
2000-04-19 13:18     ` Fernando Nasser
2000-04-19 13:20       ` Tom Tromey
2000-04-19 13:24         ` Fernando Nasser
2000-04-19 13:44           ` Tom Tromey
2000-04-19 13:57             ` Fernando Nasser
2000-04-19 14:00               ` Tom Tromey
2000-04-19 14:10             ` Fernando Nasser

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=38FE0D0B.C4332BDA@firetalk.com \
    --to=kseitz@firetalk.com \
    --cc=fnasser@cygnus.com \
    --cc=gdb-local@cygnus.com \
    --cc=insight@sourceware.cygnus.com \
    --cc=tromey@cygnus.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).