[PATCH] elf: Properly compute offsets of desc and next note

Simon Marchi simon.marchi@ericsson.com
Fri Nov 24 23:16:00 GMT 2017


On 2017-11-24 05:54 PM, H.J. Lu wrote:
> On Fri, Nov 24, 2017 at 2:42 PM, Simon Marchi <simon.marchi@ericsson.com> wrote:
>> On 2017-11-24 05:20 PM, H.J. Lu wrote:
>>> On Fri, Nov 24, 2017 at 12:53 PM, Simon Marchi
>>> <simon.marchi@ericsson.com> wrote:
>>>> Hi,
>>>>
>>>> Pedro found that this patch caused the GDB test "gdb.base/auxv.exp" to
>>>> consume memory until the machine becomes unresponsive.  I was able to
>>>> reproduce it too, so I chose to revert the patch, to reduce the risk
>>>> of it happening on other developer's machines and buildbot builders.
>>>>
>>>> The test can be ran with:
>>>>
>>>>   gdb/$ make check TESTS="gdb.base/auxv.exp"
>>>>
>>>> (It's a good idea to ctrl-C quickly enough :))
>>>>
>>>> After running the test once, I was able to reproduce the issue by starting
>>>> GDB manually like this:
>>>>
>>>>   gdb/$ ./gdb -ex "core /home/emaisin/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/auxv/auxv.corefile"
>>>>
>>>> There is an infinite loop in elf_parse_notes, the pointer "p" never
>>>> gets advanced.
>>>>
>>>
>>> This patch fixes the problem for me.  Please give it a try.
>>>
>>> Thanks.
>>
>> It works fine on my side, thanks.
>>
> 
> Here is the patch against master branch.   Please give it try.
> 
> Thanks.

That works fine too.

Simon



More information about the Binutils mailing list