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

H.J. Lu hjl.tools@gmail.com
Fri Nov 24 22:20:00 GMT 2017


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.


-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Make-4-byte-minimum-alignment-for-PT_NOTE-segments.patch
Type: text/x-patch
Size: 1170 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20171124/7071d4b5/attachment.bin>


More information about the Binutils mailing list