[OE-core] [PATCH 1/2 RFC] rpm: Add workaround for debugedit-segv

Mark Hatle mark.hatle at windriver.com
Mon Mar 25 21:47:47 UTC 2013


On 3/25/13 2:32 PM, Mark Hatle wrote:
> On 3/25/13 12:45 PM, Phil Blundell wrote:
>> On Mon, 2013-03-25 at 12:10 -0500, Mark Hatle wrote:
>>> I'm going to look into identifying if the section is a NOBITS and skipping the
>>> whole operation if it is.
>>
>> That would mean that a change in the size of the .bss wouldn't have any
>> impact on the hash.  Maybe that's fine for your application though, I
>> dunno.
>
> I'm not completely familiar with how the buildid is calculated, other then an
> md5 hash over the sections themselves.  I can't think of a case where the
> contents of the sections wouldn't change along with the .bss and .plt size.
>
> (buildid is supposed to be used by gdb to find/verify that the debuginfo matches
> the binary actually being debugged...)
>
> Through my google search, I never found a full spec of what the buildid was
> supposed to contain, only a high-level description from an old Fedora 8 work
> item.  (Note, as long the buildid is consistent it really doesn't appear to
> matter how it was generated, just that both the app and debuginfo contain it.)

I've looked at the code some more.  It does checksum the header itself and then 
if it's got contents, it also adds the contents to the checksum.. That is where 
the failure appears to be happening:

           if (u.shdr.sh_type != SHT_NOBITS)
             {
               Elf_Data *d = elf_rawdata (dso->scn[i], NULL);
               if (d == NULL)
                 goto bad;
               process (d->d_buf, d->d_size);
             }

So it's specifically checking for SHT_NOBITS, but it's matching so it falls 
through and d->d_buf == 0, causing the failure.  I'll keep investigating, but 
somehow that value (u.shdr.sh_type) is wrong [or at least unexpected!].

--Mark

> --Mark
>
>
>> p.
>>
>>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>





More information about the Openembedded-core mailing list