This is the mail archive of the mailing list for the elfutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix bug using dwarf_next_unit to iterate over .debug_types

On 03/21/2012 07:54 AM, Tom Tromey wrote:
> If you call dwarf_next_unit to iterate over .debug_types, then call
> dwarf_offdie_types, you can see a failure if some earlier call
> happened to call __libdw_intern_next_unit via dwarf_formref_die.
> What happens is that __libdw_intern_next_unit updates the Dwarf's
> next_tu_offset, but does not add the TU to the TU search tree.  So,
> the call to dwarf_offdie_types does not find the TU in the tree, and
> will not search any more, causing a failure.

Hi Tom, can you clarify this failure mode?

I'm seeing a segfault in your debugtypes.exp test added to systemtap,
with my poor unpatched elfutils-0.153 on F16.  The call to
dwarf_offdie_types is returning NULL, which the calling code is not
prepared for.

So is the NULL return the extent of the failure?  Or is elfutils
generally borked after that?

And even apart from this bug, should we be ready for NULL return from
dwarf_offdie_types() anyway?  Same question for dwarf_offdie(), I guess.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]