<?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>14133</bug_id>
          
          <creation_ts>2020-11-23 16:57:28 +0000</creation_ts>
          <short_desc>pseudo crashing on aarch64/ubuntu 20.04 with coreutils-native</short_desc>
          <delta_ts>2021-01-14 14:08:34 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Pseudo</product>
          <component>pseudo</component>
          <version>unspecified</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>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.3 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>naveen.kumar.saini</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>yp.pseudo.watcher</cc>
    
    <cc>yp.watcher</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>88661</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2020-11-23 16:57:28 +0000</bug_when>
    <thetext>If the host is ubuntu 20.04 (possibly more) and a recipe DEPENDS=coreutils-native, then during do_package_write_rpm and friends `cp` (from coreutils-native) segfaults.

Attaching a gdb shows the crash is happening inside pseudo:

#0  0x0000fffff7f95780 in ?? ()
    from target:libpseudo.so
#1  0x0000fffff7f95dc0 in pseudo_fix_path ()
    from target:libpseudo.so
#2  0x0000fffff7f6a6a0 in pseudo_root_path ()
    from target:libpseudo.so
#3  0x0000fffff7f85ab0 in llistxattr ()

The current reproducer is ubuntu 20.04 on aarch64.  Can&apos;t make it happen on ubuntu 18.04 on x86-64, I&apos;m guessing this is a glibc version thing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88662</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2020-11-23 17:08:08 +0000</bug_when>
    <thetext>I can reproduce on two aarch64 boxes running Ubuntu 20.04.

RP can not reproduce on an x86-64 running 20.04.

Will continue trying to isolate the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88663</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2020-11-23 17:47:22 +0000</bug_when>
    <thetext>Reproduces on the aarch64 ubuntu 20.04 and 18.04 autobuilder workers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88668</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2020-11-23 19:00:01 +0000</bug_when>
    <thetext>Does not reproduce on the ubuntu 20.04 x86-64 worker.

Looking very much like its aarch64-specific.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88669</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2020-11-23 19:02:56 +0000</bug_when>
    <thetext>pseudo run_tests.sh fails on my aarch64 builder, but passes on my x86 machine.

$ ./run_tests.sh
setfacl: testdir/f1: Operation not supported
92: Fail, unable to call setfacl
test-acl: Failed.
getfattr: f1: Operation not supported
setfattr: f1: Operation not supported
test-xattr: Failed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88671</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2020-11-23 22:10:23 +0000</bug_when>
    <thetext>Ignore comment #4, that&apos;s what happens when you don&apos;t have libattr/libacl headers.

So I can reliably make cp segfault inside pseudo doing xattr operations inside bitbake.  I cannot reliably make the same happen outside. I have a test case, running in the same file system (tmpfs), doing the same cp call with the same cp binary, and it works fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88852</commentid>
    <comment_count>6</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2021-01-04 14:36:49 +0000</bug_when>
    <thetext>*** Bug 14173 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88876</commentid>
    <comment_count>7</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2021-01-06 15:45:01 +0000</bug_when>
    <thetext>So RP&apos;s hint when I first saw this was 100% correct, I don&apos;t know why my testing failed when I tried his solution.

The problem is that cp links to libattr which ships its own llistxattr() functions which simply call the libc functions.  pseudo works around that by using versioned lookup, but glibc on arm has the symbols in a different version.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88892</commentid>
    <comment_count>8</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2021-01-08 14:14:49 +0000</bug_when>
    <thetext>Patches for pseudo are on the list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88921</commentid>
    <comment_count>9</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2021-01-14 14:08:34 +0000</bug_when>
    <thetext>Fixed on the oe-core branch and upgraded in oe-core 11a3a9203ad595e7fa92acf442a7f3216d6e3830.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>