On 26.01.26 17:50, Mark Wielaard wrote:
> Hi Hans,
>
> On Sat, 2026-01-24 at 09:35 +0100, Hans wrote:
>> Using the latest eu-unstrip (or an older) on a relatively big core
>> dump (>1G) results in a list with just three buildids
>> (eu-unstrip -n --core prog.core), although gdb lists more than 200
>> shared objects.
>>
>> Extracting the first page of each elf file in the core manually and
>> check with 'readelf -n <page>' reveal each buildid properly.
>>
>> Do you have any ideas why eu-unstrip is not dumping all the buildids
>> in the core dump although they are available in the core dump?
>
> No, sorry I don't immediately know what could cause that.
> How was the core file generated?
>
> Could you show the eu-unstrip -n --core prog.core output and the gdb
> list of shared objects?
>
> Thanks,
>
> Mark
Maybe this could be a hint: The loadable segments for the prog.core
are not sorted in ascending order.
PT_LOAD:
<snip>
Loadable segment entries in the program header table appear in ascending order,
sorted on the p_vaddr member.
readelf -W -l prog.core:
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz
Flg Align
NOTE 0x01e768 0x0000000000000000 0x0000000000000000 0x0f98f8
0x000000 0x4
LOAD 0x119000 0x00007f33c9b4b000 0x0000000000000000 0x000000
0x001000 0x1000
LOAD 0x119000 0x00007f33cafff000 0x0000000000000000 0x000000
0x001000 0x1000
<snip>
LOAD 0x119000 0x00007f33e5d50000 0x0000000000000000 0x000000
0x006000 R E 0x1000
LOAD 0x119000 0x00007f33fac4d000 0x0000000000000000 0x001000
0x0f3000 R 0x1000
LOAD 0x11a000 0x00007f33e5a1d000 0x0000000000000000 0x001000
0x00e000 R 0x1000
LOAD 0x11b000 0x00007f33e5d60000 0x0000000000000000 0x001000
0x001000 RW 0x1000
<snip>
Using ubuntu 24.04 with a 6.14.0-37-generic kernel and sigabrt another program
results in the correct buildids and the loadable segments are sorted.
I did a little debugging for eu_unstrip. As far as I could see more()
(resp. do_more()) returns to early (in core-file.c). Possibly because the
segments
are not sorted but that is just a guess.
I'm not sure why the debian kernel dumps out of order segments.
Hans