On Fri, 2013-10-18 at 16:21 -0700, Josh Stone wrote:
On 10/10/2013 02:48 AM, Mark Wielaard wrote:
> Unfortunately you seem to be right, even if that is somewhat unlikely.
> [...]
> Please check the attached.
AFAICS, the tests you added don't even have any subprograms in their alt
files, let alone colliding DIE offsets. I grant you, it's hard to craft
such a collision, but I managed it. :P
Impressive and evil! :) Yeah, I admit I considered it only a theoretical
problem, because I couldn't create such a situation, but you proved me
wrong again...
See attached. I compiled these like so:
$ gcc -g -O2 test-offset-loop.c -o test-offset-loop
$ cp test-offset-loop test-offset-loop2
$ dwz test-offset-loop test-offset-loop2 -m test-offset-loop.alt
I didn't include loop2 in the tar, as it's just a copy to kick dwz into
action. The main file has subprograms [2e] "padding" and [63]
"main",
where the alt has [5a] "get_errno" and [63] "is_error".
Without your patch, allfcts lists get_errno, is_error, padding, main,
but then main's [63] makes it revert as if it were back at is_error, so
it repeats padding, main, padding, main, ...
With your addr patch, it terminates correctly.
I'm not sure how to add this test though, because while testrun_compare
could see success just fine, it can't handle the unpatched failing case
with infinite output. Feel free to take and commit my test files if you
can figure this out.
We just have to truncate the output before running the compare to make
if fail fast (without the patch). Added your test as attached and pushed
to master.
Thanks,
Mark