This is the mail archive of the
mailing list for the elfutils project.
Problems with dwarf-getmacros test
- From: Ulf Hermann <ulf dot hermann at qt dot io>
- To: <elfutils-devel at sourceware dot org>
- Date: Mon, 8 May 2017 18:22:16 +0200
- Subject: Problems with dwarf-getmacros test
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=qt.io;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qtcompany.onmicrosoft.com; s=selector1-qt-io; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=I/Jvw6ltG6hzeP8zPQbNRRwG7t0my5VuWlE0jv52VOQ=; b=cvXLuBc4xxu43l+EjxmeHSPIVjWOL1EI1LaZABY09LK1zmVYRKN7L4aQGaCFcVbFa42pm/rn8bh5Q1HxhUiFaJLW4l1xy7vv3bA0FvBESWkrniwNlv0dlpLvXHwuCuGKTHyFF4vbDDcOqlgs7QDLGxHzvarPEwgIBKYmNOWNaEY=
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
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.