Hi there, We noticed many gzip segfault errors on our build machine when doing either do_rootfs or do_populate_sdk for images on which the man pages are enabled.
We traced this to mandb, run from the postinst script injected by manpages.bbclass, which invokes gzip to scan compressed manpages. Our diagnostic is that mandb is executed via qemuwrapper with LD_LIBRARY_PATH set to the rootfs lib dirs, which is expected since mandb is from the rootfs. However, PATH is not set to the rootfs bin dirs, but instead to the various sysroots and wrapper paths, so it is gzip from recipe-sysroot-native that is executed, using ld-linux from the rootfs. But it turns out that the ld-linux and libs from rootfs are incompatible with those of recipe-sysroot-native, which results in a segfault in ld-linux. I fixed this in our builds by simply adding -E PATH=$D${bindir}:$D${base_bindir} to the qemuwrapper command line in scripts/postinst-intercepts/update_mandb. However, I do wonder if the correct fix would not be in qemu.bbclass to systematically set that option for any qemuwrapper invocation, as the problem can potentially affect any tool executed via qemuwrapper that spawns or execs some other executable using PATH to locate it. We encountered this on kirkstone, but our local kirkstone branch has this commit backported: https://git.openembedded.org/openembedded-core/commit/?id=fbd8a57aa307bfda70a08cb78af3c97f05c39a3a Hence the modification of scripts/postinst-intercepts/update_mandb and not manpages.bbclass The problem does not occur when building images for machines which are not x86-64 based, since the build host and target architectures are not compatible. Note also that the segfault is gone with the above mentioned fix, but gzip does not run successfully since /bin/gzip from the rootfs is an absolute symlink to the active alternative (e.g., /bin/gzip.gzip), which does not exist on the build host, but that is another problem, at least the segfault is gone. Would fixing qemu.bbclass make sense? If yes, how extensive should that be? For instance, explicitly passing the right dirs for PATH to qemu_wrapper_cmdline, like it is done for LD_LIBRARY_PATH? Or just implicitly setting it in qemu_wrapper_cmdline? Sincerely, Diego -- Diego Santa Cruz, PhD Technology Architect spinetix.com
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#206094): https://lists.openembedded.org/g/openembedded-core/message/206094 Mute This Topic: https://lists.openembedded.org/mt/109114254/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-