<?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>13891</bug_id>
          
          <creation_ts>2020-05-03 04:48:04 +0000</creation_ts>
          <short_desc>insane.bbclass: do_package_qa hangs when checking a FIFO (named pipe) file</short_desc>
          <delta_ts>2021-04-29 15:53:10 +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>2.6.4</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 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmed Hossam">Ahmed.Hossam</reporter>
          <assigned_to name="Trevor Woerner">twoerner</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>twoerner</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>87136</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmed Hossam">Ahmed.Hossam</who>
    <bug_when>2020-05-03 04:48:04 +0000</bug_when>
    <thetext>do_package_qa:package_qa_walk hangs when attempting to open a FIFO file in the package, specifically at elf.open() statement, this is because FIFOs block when opened for read.

To reproduce add the following to an example recipe:

DEPENDS += &quot;coreutils-native&quot;

FILES_${PN} += &quot; \
    /usr/run \
&quot;

do_install_append() {
    mkdir  -p ${D}/usr/run/${PN}
    mkfifo -m 0666 ${D}/usr/run/${PN}/fifo
}

P.S. It looks like this might be a regression as it was supposed to be fixed according to this mail in the mailing list: https://www.yoctoproject.org/pipermail/yocto/2016-February/028424.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87137</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmed Hossam">Ahmed.Hossam</who>
    <bug_when>2020-05-03 04:54:21 +0000</bug_when>
    <thetext>A very bad workaround is to skip qa for the recipe:
python do_package_qa() {
    pass
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87138</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmed Hossam">Ahmed.Hossam</who>
    <bug_when>2020-05-03 05:29:42 +0000</bug_when>
    <thetext>Reproduced on master SHA 7a5cc8659e4ba8f36bcb5322e246005d812efb59</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87163</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2020-05-07 07:38:11 +0000</bug_when>
    <thetext>Needs an automated test as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88809</commentid>
    <comment_count>4</comment_count>
    <who name="Trevor Woerner">twoerner</who>
    <bug_when>2020-12-24 12:43:12 +0000</bug_when>
    <thetext>One of the tests in insane.bbclass (package_qa_check_shebang_size()) tries to read the contents of the object looking for the #!. If the object is a fifo, any read(2) of its contents will hang forever, waiting for contents to appear.

The patch to fix this is as follows and has been submitted to the mailing list:

    diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
    index cf2165c517..105d2a5ce8 100644
    --- a/meta/classes/insane.bbclass
    +++ b/meta/classes/insane.bbclass
    @@ -87,7 +87,8 @@ def package_qa_add_message(messages, section, new_msg):
 
     QAPATHTEST[shebang-size] = &quot;package_qa_check_shebang_size&quot;
     def package_qa_check_shebang_size(path, name, d, elf, messages):
    -    if os.path.islink(path) or elf:
    +    import stat
    +    if os.path.islink(path) or stat.S_ISFIFO(os.stat(path).st_mode) or elf:
             return
 
         try:

The patch is here:
    https://lists.openembedded.org/g/openembedded-core/topic/master_next_patch_1_3/79198302</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88820</commentid>
    <comment_count>5</comment_count>
    <who name="Trevor Woerner">twoerner</who>
    <bug_when>2020-12-27 06:45:42 +0000</bug_when>
    <thetext>A patch to add an automated test is:
https://lists.openembedded.org/g/openembedded-core/message/146221</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90184</commentid>
    <comment_count>6</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-04-29 15:53:10 +0000</bug_when>
    <thetext>Fix in oe-core:

https://git.openembedded.org/openembedded-core/commit/?id=a7b1d22e93c8846d84a9855876038c2b38958dec

$ git branch -a --contains a7b1d22e93c
  hardknott
  master

Test:
https://git.openembedded.org/openembedded-core/commit/?id=53988b6389ce618d4cff52bd09ae91108beca354

$ git branch -a --contains 53988b6389ce618d4cff52bd09ae91108beca354
  hardknott
  master

Thanks Trevor!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>