public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Pallas <pallas@CS.Stanford.EDU>
To: sourcenav@sourceware.cygnus.com
Subject: Help with dbimp crash?
Date: Mon, 28 Aug 2000 15:59:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.10.10008281252040.12120-100000@olympus.transmeta.com> (raw)

I've been encountering a crash in dbimp that seems to be due to a dangling
pointer, but I'm having trouble understanding how this stuff is supposed
to work.

I've narrowed the problem down to an entry in a hash table whose key is a
pointer that isn't valid.  At first I thought the pointer was getting
stomped on, but I started tracing things more thoroughly and discovered
that the entry didn't change, and the pointer was valid at the time the
entry was added. The memory that it pointed to, however, actually went
away sometime later.

The troublesome insertion occurs when the stack looks like this:

HashTableSearchFunc
HashTableAdd
f_MacroFind
f_TokenMacroInput

The value of item.key in HashTableAdd is a char pointer that was set to
sString.text in f_MacroFind.  This ultimately seems to be a pointer
derived from yytext in f_TokenInput.  Since yytext belongs to (f)lex,
expecting it to be stable and long-lived would be a mistake.

Could someone who actually understands this stuff tell me if I've got it
right?  If so, is it fixable?  I'm fairly petrified of trying a fix
without being sure of the problem and understanding how things are
supposed to work.  I really don't want to introduce a memory leak.

Thanks.
joe


             reply	other threads:[~2000-08-28 15:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-28 15:59 Joseph Pallas [this message]
2000-08-28 16:09 ` Syd Polk
2000-08-28 16:10   ` Ben Elliston
2000-08-28 16:10 ` Ben Elliston
2000-08-29  7:57   ` Joe Pallas

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=Pine.LNX.4.10.10008281252040.12120-100000@olympus.transmeta.com \
    --to=pallas@cs.stanford.edu \
    --cc=sourcenav@sourceware.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).