Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* crasher in C++ ABI code
@ 2002-09-12 17:23 Michael Snyder
  2002-09-12 17:34 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Snyder @ 2002-09-12 17:23 UTC (permalink / raw)
  To: gdb-patches; +Cc: jimb, drow

Attention, all you c++_abi_savvy folk...

I found a crasher bug while running the gdb testsuite on a COFF 
toolchain.  TYPE_VPTR_FIELDNO returned -1; I haven't looked into
this mechanism, but I assume that's a mistake.  When it was applied
via value_field, of course it yielded a garbage value.

So looking at coffread.c, I see that there are no references
to vptr_fieldno nor vptr_basetype -- these fields are never
initialized.

I'm just wondering where to go from here.  Is it possible to 
obtain these values from COFF?  If not, perhaps their access
methods should check for an invalid value?

Michael


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

* Re: crasher in C++ ABI code
  2002-09-12 17:23 crasher in C++ ABI code Michael Snyder
@ 2002-09-12 17:34 ` Daniel Jacobowitz
  2002-09-12 18:02   ` Michael Snyder
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2002-09-12 17:34 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches, jimb

On Thu, Sep 12, 2002 at 05:23:16PM -0700, Michael Snyder wrote:
> Attention, all you c++_abi_savvy folk...
> 
> I found a crasher bug while running the gdb testsuite on a COFF 
> toolchain.  TYPE_VPTR_FIELDNO returned -1; I haven't looked into
> this mechanism, but I assume that's a mistake.  When it was applied
> via value_field, of course it yielded a garbage value.
> 
> So looking at coffread.c, I see that there are no references
> to vptr_fieldno nor vptr_basetype -- these fields are never
> initialized.

They're initialized in alloc_type to -1... and further by stabs and
dwarf2.

> I'm just wondering where to go from here.  Is it possible to 
> obtain these values from COFF?  If not, perhaps their access
> methods should check for an invalid value?

COFF is not the issue.  coffread is just like elfread; it's an object
file reader.  The question is where your debug information comes from.
Mdebug?  Stabs?  DWARF-2?  If it's real mdebug instead of
stabs-in-mdebug, you're squat out of luck for C++.

Also, TYPE_VPTR_FIELDNO is often -1 by design; see
fill_in_vptr_fieldno and the comment above it.

 -  Is fill_in_vptr_fieldno getting called?
 -  If it were called would it succeed?
 -  Probably its return value needs to be checked somewhere.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: crasher in C++ ABI code
  2002-09-12 17:34 ` Daniel Jacobowitz
@ 2002-09-12 18:02   ` Michael Snyder
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Snyder @ 2002-09-12 18:02 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches, jimb

Daniel Jacobowitz wrote:
> 
> On Thu, Sep 12, 2002 at 05:23:16PM -0700, Michael Snyder wrote:
> > Attention, all you c++_abi_savvy folk...
> >
> > I found a crasher bug while running the gdb testsuite on a COFF
> > toolchain.  TYPE_VPTR_FIELDNO returned -1; I haven't looked into
> > this mechanism, but I assume that's a mistake.  When it was applied
> > via value_field, of course it yielded a garbage value.
> >
> > So looking at coffread.c, I see that there are no references
> > to vptr_fieldno nor vptr_basetype -- these fields are never
> > initialized.
> 
> They're initialized in alloc_type to -1... and further by stabs and
> dwarf2.
> 
> > I'm just wondering where to go from here.  Is it possible to
> > obtain these values from COFF?  If not, perhaps their access
> > methods should check for an invalid value?
> 
> COFF is not the issue.  coffread is just like elfread; it's an object
> file reader.  The question is where your debug information comes from.
> Mdebug?  Stabs?  DWARF-2?  If it's real mdebug instead of
> stabs-in-mdebug, you're squat out of luck for C++.
> 
> Also, TYPE_VPTR_FIELDNO is often -1 by design; see
> fill_in_vptr_fieldno and the comment above it.
> 
>  -  Is fill_in_vptr_fieldno getting called?
>  -  If it were called would it succeed?
>  -  Probably its return value needs to be checked somewhere.

Yes, I've found it, I'm about to submit a patch.


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

end of thread, other threads:[~2002-09-13  1:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-12 17:23 crasher in C++ ABI code Michael Snyder
2002-09-12 17:34 ` Daniel Jacobowitz
2002-09-12 18:02   ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox