public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
* Help with dbimp crash?
@ 2000-08-28 15:59 Joseph Pallas
  2000-08-28 16:09 ` Syd Polk
  2000-08-28 16:10 ` Ben Elliston
  0 siblings, 2 replies; 5+ messages in thread
From: Joseph Pallas @ 2000-08-28 15:59 UTC (permalink / raw)
  To: sourcenav

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


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

* Re: Help with dbimp crash?
  2000-08-28 15:59 Help with dbimp crash? Joseph Pallas
@ 2000-08-28 16:09 ` Syd Polk
  2000-08-28 16:10   ` Ben Elliston
  2000-08-28 16:10 ` Ben Elliston
  1 sibling, 1 reply; 5+ messages in thread
From: Syd Polk @ 2000-08-28 16:09 UTC (permalink / raw)
  To: Joseph Pallas, sourcenav

I am afraid the original developers who worked on that portion of 
Source-Navigator are long gone. This is not an area where we have much 
expertise anymore.

At 03:58 PM 8/28/00 -0700, Joseph Pallas wrote:
>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
>

Syd Polk		spolk@redhat.com
Engineering Manager	+1 415 777 9810 x 241
Red Hat, Inc.



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

* Re: Help with dbimp crash?
  2000-08-28 15:59 Help with dbimp crash? Joseph Pallas
  2000-08-28 16:09 ` Syd Polk
@ 2000-08-28 16:10 ` Ben Elliston
  2000-08-29  7:57   ` Joe Pallas
  1 sibling, 1 reply; 5+ messages in thread
From: Ben Elliston @ 2000-08-28 16:10 UTC (permalink / raw)
  To: Joseph Pallas; +Cc: sourcenav

   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.

The parsers pipe their output into dbimp.
Do you have an example of input that causes this problem?

Ben

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

* Re: Help with dbimp crash?
  2000-08-28 16:09 ` Syd Polk
@ 2000-08-28 16:10   ` Ben Elliston
  0 siblings, 0 replies; 5+ messages in thread
From: Ben Elliston @ 2000-08-28 16:10 UTC (permalink / raw)
  To: Syd Polk; +Cc: Joseph Pallas, sourcenav

   I am afraid the original developers who worked on that portion of
   Source-Navigator are long gone. This is not an area where we have much
   expertise anymore.

I'm game to take a look.

Ben

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

* Re: Help with dbimp crash?
  2000-08-28 16:10 ` Ben Elliston
@ 2000-08-29  7:57   ` Joe Pallas
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Pallas @ 2000-08-29  7:57 UTC (permalink / raw)
  To: Ben Elliston; +Cc: sourcenav

At 10:10 AM +1100 8/29/00, Ben Elliston wrote:
>The parsers pipe their output into dbimp.
>Do you have an example of input that causes this problem?

I do, but it's not that simple.  When I feed the saved trace back 
into dbimp, it insists on reopening the source files and gets unhappy 
if they're not there.  I'm sure this has something to do with the 
mysterious fact that the c++ parser is linked into dbimp.  This makes 
it hard for me to provide a simple test case (the source files are 
proprietary).

joe

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

end of thread, other threads:[~2000-08-29  7:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-28 15:59 Help with dbimp crash? Joseph Pallas
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

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).