Problems with dwarf-getmacros test

Ulf Hermann ulf.hermann@qt.io
Tue May 9 14:11:00 GMT 2017


Hi,

I frequently get failures from the run-dwarf-getmacros.sh test, on 
testfile-macros:0xb. The test repeatedly outputs "(null)" instead of the 
actual macros and then runs into the assert at dwarf-getmacros.c:50. The 
failure is very nondeterministic, though. I haven't found a reliable way 
to trigger it.

Further examination reveals that the __libdw_in_section check in 
READ_AND_RELOCATE (libdwP.h:656), when called from __libdw_read_offset 
seems to be bogus. The "return -1" in there is what produces the null 
results and ultimately the assert. Experiments show that the address is 
frequently not in the section we're checking there, but still valid. 
Just dropping the check makes the test succeed.

I'm currently at a loss about why this happens. One thing that strikes 
me was that the additional dbg_ret mechamism was added in 2012 with 
commit 775375e3, but the check in READ_AND_RELOCATE was not adapted then.

However, the address is also not necessarily in dbg_ret at that point. 
Checking dbg_ret in addition to dbg still fails sometimes, and also that 
wouldn't explain the nondeterminism.

Ulf



More information about the Elfutils-devel mailing list