This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap 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: report a segment fault bug of systemtap


On Sat, 2014-01-11 at 13:10 -0500, Frank Ch. Eigler wrote:
> It seems like incomplete DWARF data can result in elfutils passing
> NULL char*'s to the stap translator, which the latter is not always
> prepared to tolerate.  We encountered this same problem here yesterday
> and committed a patch.

I quickly looked at the patch and I do think elfutils is allowed to
return NULL indeed. And you should guard against it.

dwarf_decl_file () will return NULL when there is no DW_AT_decl_file
attribute, if the value is zero (which indicates no source information
was recorded by the compiler) or if the .debug_line section isn't
valid/doesn't contain the indicated source file.

dwarf_diename () will return NULL when no DW_AT_name attribute can be
found (which isn't guaranteed to be produced by the compiler in all
cases). Or if the DW_AT_name is wrongly encoded (isn't a string).

In particular for CUs a DW_TAG_compile_unit often does have a name (the
primary source the compiler used), but a DW_TAG_partial_unit often
doesn't have one (since there it might be unclear whether there even is
a primary source file in that case).

Cheers,

Mark


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