Bug 14057

Summary: miniperl losing executable bit
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Richard Purdie <richard.purdie>
Component: coreAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, randy.macleod
Version: 3.2   
Target Milestone: 3.2 M4   
Hardware: x86   
OS: Multiple   
Whiteboard: AB-INT
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Richard Purdie 2020-09-22 04:07:52 UTC
on the autobuilder we have two cases in the same rebuild where the executable bit appears to have gotten lost from miniperl during do_install:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1374
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/1396

I looked into the first case and it appears perl is being rebuilt in the same build directory:

[pokybuild@fedora32-ty-1 temp]$ cat log.task_order 
do_populate_lic_setscene (3617924): log.do_populate_lic_setscene.3617924
do_deploy_source_date_epoch_setscene (3620882): log.do_deploy_source_date_epoch_setscene.3620882
do_fetch (3638805): log.do_fetch.3638805
do_unpack (3639683): log.do_unpack.3639683
do_patch (3645190): log.do_patch.3645190
do_populate_sysroot_setscene (591167): log.do_populate_sysroot_setscene.591167
do_prepare_recipe_sysroot (984810): log.do_prepare_recipe_sysroot.984810
do_configure (986675): log.do_configure.986675
do_configure_ptest_base (1419396): log.do_configure_ptest_base.1419396
do_compile (1420883): log.do_compile.1420883
do_compile_ptest_base (2144197): log.do_compile_ptest_base.2144197
do_install (2144961): log.do_install.2144961
do_install_ptest_base (2880655): log.do_install_ptest_base.2880655
do_package (4176783): log.do_package.4176783
do_packagedata (1021092): log.do_packagedata.1021092
do_package_write_rpm (1052535): log.do_package_write_rpm.1052535
do_package_qa (1099765): log.do_package_qa.1099765
do_package_write_deb_setscene (616007): log.do_package_write_deb_setscene.616007
do_packagedata_setscene (811406): log.do_packagedata_setscene.811406
do_package_setscene (820690): log.do_package_setscene.820690
do_package_qa (2466380): log.do_package_qa.2466380
do_package_write_ipk_setscene (3468933): log.do_package_write_ipk_setscene.3468933
do_populate_sysroot_setscene (27087): log.do_populate_sysroot_setscene.27087
do_prepare_recipe_sysroot (1567044): log.do_prepare_recipe_sysroot.1567044
do_configure (1579865): log.do_configure.1579865
do_configure_ptest_base (1896788): log.do_configure_ptest_base.1896788
do_compile (1897443): log.do_compile.1897443
do_compile_ptest_base (1993898): log.do_compile_ptest_base.1993898
do_install (1994185): log.do_install.1994185
do_package_qa_setscene (2695777): log.do_package_qa_setscene.2695777
do_package_write_rpm_setscene (2695800): log.do_package_write_rpm_setscene.2695800
do_populate_sysroot_setscene (2697910): log.do_populate_sysroot_setscene.2697910
do_packagedata_setscene (2700762): log.do_packagedata_setscene.2700762
do_packagedata_setscene (2814189): log.do_packagedata_setscene.2814189

The rebuild is due to a new version of glibc being installed during prepare_recipe_sysroot (systemd <-> sysvinit change?).

It seems when perl is being rebuilt within the same build dir, the executable bit can get lost.
Comment 1 Richard Purdie 2020-09-22 04:22:45 UTC
Staring more at this failure I note that:

a) miniperl_top is running "miniperl installperl" which is checking for +x on ${B}/perl.

b) ${B}/perl does have a+x

c) its looking like pseudo is causing the "+x" to disappear.

Based on that I looked and ${B}/perl does not have a database entry however the logs have:

inode mismatch: '/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-3511063/tmp/work/core2-64-poky-linux/perl/5.32.0-r0/perl-5.32.0/ext/Errno/Makefile' ino 153377415 in db, 153377401 in request.
inode mismatch: '/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-3511063/tmp/work/core2-64-poky-linux/perl/5.32.0-r0/perl-5.32.0/ext/Hash-Util/Makefile' ino 153377465 in db, 153377096 in request.
inode mismatch: '/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-3511063/tmp/work/core2-64-poky-linux/perl/5.32.0-r0/perl-5.32.0/ext/NDBM_File/Makefile' ino 153377468 in db, 153377098 in request.
inode mismatch: '/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-3511063/tmp/work/core2-64-poky-linux/perl/5.32.0-r0/perl-5.32.0/ext/FileCache/Makefile' ino 153377479 in db, 153377397 in request.
path mismatch [1 link]: ino 153377483 db '/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-3511063/tmp/work/core2-64-poky-linux/perl/5.32.0-r0/perl-5.32.0/ext/IPC-Open3/Makefile' req '/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-3511063/tmp/work/core2-64-poky-linux/perl/5.32.0-r0/perl-5.32.0/perl'.
db cleanup for server shutdown, 03:52:51.780
memory-to-file backup complete, 03:52:51.780.


with that path mismatch meaning the wrong permissions were likely reported. This is almost certainly a glitch where files were deleted outside of pseudo's knowledge, the inode reused and things broke.
Comment 2 Randy MacLeod 2020-10-08 08:09:52 UTC
Fix by pseudo changes in oe-core:

3006bbe776 pseudo: Add pathfix patch
e1e481f360 pseudo: Add may unlink patch
929a27bf6c pseudo: Fix xattr segfault
9ce621fa20 psuedo: Add tracking of linked files for fds
2db491d97d pseudo: Abort on mismatch patch
8defb687a2 pseudo: Add support for ignoring paths from the pseudo DB