<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>16003</bug_id>
          
          <creation_ts>2025-10-14 16:43:51 +0000</creation_ts>
          <short_desc>patchelf issue causing qemu-img to segfault in ovmf recipe</short_desc>
          <delta_ts>2025-10-30 15:31:31 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>0.0.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.3 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Purdie">richard.purdie</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>mhalstead</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>yoann.congal</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>102934</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2025-10-14 16:43:51 +0000</bug_when>
    <thetext>https://autobuilder.yoctoproject.org/valkyrie/#/builders/37/builds/2714

This is a reproducibility build showing a segfault in the ovmf recipe in do_deploy.

It is enough to run the binary to see the segfault:

pokybuild@debian12-vk-3:~/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/sysroots-components/x86_64/qemu-system-native/usr/bin$ ./qemu-img 
Segmentation fault

Reproduction:

wget http://sstate.yoctoproject.org/all/universal/78/ea/sstate%3Aqemu-system-native%3Ax86_64-linux%3A10.1.1%3Ar0%3Ax86_64%3A14%3A78eaa8f4520be87b4afccd3eedea070dbedc5453219e96f16102bea454a964c8_populate_sysroot.tar.zst
zstd -d sstate\:qemu-system-native\:x86_64-linux\:10.1.1\:r0\:x86_64\:14\:78eaa8f4520be87b4afccd3eedea070dbedc5453219e96f16102bea454a964c8_populate_sysroot.tar.zst 
mv sstate\:qemu-system-native\:x86_64-linux\:10.1.1\:r0\:x86_64\:14\:78eaa8f4520be87b4afccd3eedea070dbedc5453219e96f16102bea454a964c8_populate_sysroot.tar sstate.tar
tar -xf sstate.tar
./recipe-sysroot-native/usr/bin/qemu-img 
qemu-img: Not enough arguments
Try &apos;./recipe-sysroot-native/usr/bin/qemu-img --help&apos; for more information
$ ~/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/sysroots-uninative/x86_64-linux/usr/bin/patchelf-uninative --set-interpreter /home/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 ./recipe-sysroot-native/usr/bin/qemu-img
pokybuild@debian12-vk-3:~/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/work/x86_64-linux/qemu-system-native/10.1.1/temp$ ./recipe-sysroot-native/usr/bin/qemu-img 
Segmentation fault

I was also able to reproduce this locally using my own local build.

So simply put:

Download the qemu sstate
Run patchelf-uninative from the uninative tarball on the binary to change the interpreter
It will segfault

Almost certainly due to a bug in patchelf.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102935</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2025-10-14 16:46:29 +0000</bug_when>
    <thetext>$ /media/build/poky/build/tmp/sysroots-uninative/x86_64-linux/usr/bin/patchelf-uninative --print-interpreter ./recipe-sysroot-native/usr/bin/qemu-img
/srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleA/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2

so the binary in sstate was produced by a reproducible build</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102944</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2025-10-15 17:00:26 +0000</bug_when>
    <thetext>Upgrading patchelf appears to fix it. We need to merge the fix, then build and issue a new uninative.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102960</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-10-16 14:50:55 +0000</bug_when>
    <thetext>We&apos;ll generate a new uninative for M4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102984</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Halstead">mhalstead</who>
    <bug_when>2025-10-16 22:31:29 +0000</bug_when>
    <thetext>Uninative 5.0rc1 is built and ready for testing. A patch is on the openembedded-core@lists.openembedded.org.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103156</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2025-10-30 15:31:31 +0000</bug_when>
    <thetext>This was merged and the issue is now hopefully resolved: https://git.yoctoproject.org/poky/commit/?id=cb478c6228f0654ded5ac19a8a8d2f8ba9a717af</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>