[meta-freescale] image-prelink (can) cause SIGSEGV on program startup (when run under GDB)

Christian Ege k4230r6 at gmail.com
Tue Jan 12 12:44:44 PST 2016


Hi Bjørn,
> Am 07.01.2016 um 10:49 schrieb Bjørn Forsman <bjorn.forsman at gmail.com>:
> 
> Hi Christian,
> 
> On 7 January 2016 at 10:40, Christian Ege <k4230r6 at gmail.com> wrote:
>> Hi Bjørn,
>> Am 07.01.2016 9:57 vorm. schrieb "Bjørn Forsman" <bjorn.forsman at gmail.com>:
>>> 
>>> Hi all,
>>> 
>>> Just FYI, I spent 2 days debugging why my application would fail to
>>> start when run under GDB (gdbserver). It received SIGSEGV _before_
>>> entering main. Turns out that by removing "image-prelink" from
>>> local.conf fixes it.
>>> 
>> From my experience image-prelink and using the OpenEmbedded SDKs is not
>> recommended. Maybe your SDK is older than your current rootfs this can cause
>> GDB to struggle.
> 
> Thanks for the data point. The thing is, debugging worked fine for a
> long time. But when I added another library dependency, things broke.
> 
> Unless the build system is completely borked, rootfs and SDK should be
> in sync. I explicitly rebuilt and re-flashed exactly to eliminate that
> kind of trouble.
We had trouble when stepping over some c library functions for example printf, one workaround 
was to copy the lib from the roof into the SDK.
> 
>> Anyway we had big issues when we tried to analyse stack backtraces with our
>> rootfs and marching SDK. Because the libc in the SDK is not prelinked and
>> the checksum check in GDB is not passed GDB barked out some warning.
> 
> I guess you mean warnings like:
> 
> (gdb) set sysroot
> ~/poky-toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
> warning: .dynamic section for
> "/home/bfo/poky-toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/libQt5Multimedia.so.5"
> is not at the expected address (wrong library or version mismatch?)
> warning: .dynamic section for
> "/home/bfo/poky-toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/libQt5Widgets.so.5"
> is not at the expected address (wrong library or version mismatch?)
> warning: .dynamic section for
> "/home/bfo/poky-toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/libQt5Gui.so.5"
> is not at the expected address (wrong library or version mismatch?)
> ...
> 
> The weird part is that these warnings seem to come no matter what
> (prelink or not). (I guess I should triple check that…)
yes, those messages. They disappeared after removing the prelink. I’ll double check when I am in the office tomorrow.
What kind of Toolchain are you using?
When you are using bitbake meta-toolchain you may have to create a sys root from your roots:
http://www.yoctoproject.org/docs/2.0/adt-manual/adt-manual.html#extracting-the-root-filesystem <http://www.yoctoproject.org/docs/2.0/adt-manual/adt-manual.html#extracting-the-root-filesystem> 
Or consider to switch to 

bitbare <your image> -c populate_sdk
http://www.yoctoproject.org/docs/2.0/adt-manual/adt-manual.html#optionally-building-a-toolchain-installer <http://www.yoctoproject.org/docs/2.0/adt-manual/adt-manual.html#optionally-building-a-toolchain-installer>


> 
>> Maybe there is a magic knob to tune but we did not found it. But the last
>> time I checked was in an older Yocto/OpenEmbedded environment.
> 
> I'm on early Yocto 2.0 / Jethro. I plan on updating soon, there are
> probably many fixes.
> 
> Best regards,
> Bjørn Forsman

Regards,
Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/meta-freescale/attachments/20160112/80895787/attachment.html>


More information about the meta-freescale mailing list