<?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>7993</bug_id>
          
          <creation_ts>2015-07-14 12:43:15 +0000</creation_ts>
          <short_desc>pseudo: select returns immediately on FIFO</short_desc>
          <delta_ts>2015-09-22 15:13:11 +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>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</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>1.9 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Seebs">seebs</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>ross.burton</cc>
    
    <cc>seebs</cc>
    
    <cc>yp.pseudo.watcher</cc>
    
    <cc>yp.watcher</cc>
          
          <qa_contact name="Daniel Istrate">daniel.alexandrux.istrate</qa_contact>
          <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>52341</commentid>
    <comment_count>0</comment_count>
      <attachid>2588</attachid>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-07-14 12:43:15 +0000</bug_when>
    <thetext>Created attachment 2588
Test script to demonstrate the issue

With a recent change in BitBake we are creating a FIFO for each shell task and then writing to it when bbnote/bbwarn/bberror etc. are called (see bug 5275 for details). Unfortunately this has exposed a bug in pseudo: calling select() on a FIFO created with mkfifo() under pseudo returns immediately instead of waiting until there is some data to read, even when the FIFO is opened read/write. This has led to a performance regression.

A test case is attached - run it outside of pseudo and it behaves correctly, only printing what is echoed into the FIFO; run it under pseudo and it will print out empty strings repeatedly.

Richard also has a patch which does appear to fix the issue but needs work:

http://git.yoctoproject.org/cgit.cgi/poky-contrib/patch/?id=ef004bfbad695dcd7c9001b7529181ae72d45162</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52566</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-07-23 20:41:44 +0000</bug_when>
    <thetext>Fixed in pseudo 1.6.7, merged in oe-core 0295947a2ccc66037f9c20f06b4b69a781a046bd.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54463</commentid>
    <comment_count>2</comment_count>
    <who name="Daniel Istrate">daniel.alexandrux.istrate</who>
    <bug_when>2015-09-22 15:13:11 +0000</bug_when>
    <thetext>Verified on master: 7b86c771c80d0759c2ca0e57c46c4c966f89c49e

Steps to verify:
1. Download the attached script and run it
2. In another terminal run: echo test &gt; /tmp/testfifo --&gt; You should see the echoed message in the first terminal where the script is running.

Now to test for pseudo:
1. Start the pseudo env with: bitbake m4 -c devshell 
2. In the shell that pops up copy the attached script and run it
3. In another terminal run: echo test &gt; /tmp/testfifo --&gt; You should see the echoed message in the pseudo env where the script is running.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>2588</attachid>
            <date>2015-07-14 12:43:15 +0000</date>
            <delta_ts>2015-07-14 12:43:15 +0000</delta_ts>
            <desc>Test script to demonstrate the issue</desc>
            <filename>testpipe2.py</filename>
            <type>text/x-python</type>
            <size>700</size>
            <attacher name="Paul Eggleton">bluelightning</attacher>
            
              <data encoding="base64">aW1wb3J0IHN5cwppbXBvcnQgb3MKaW1wb3J0IGZjbnRsCmltcG9ydCBlcnJubwppbXBvcnQgc2Vs
ZWN0CgpkZWYgbm9uYmxvY2tpbmdmZChmZCk6CiAgICBmY250bC5mY250bChmZCwgZmNudGwuRl9T
RVRGTCwgZmNudGwuZmNudGwoZmQsIGZjbnRsLkZfR0VURkwpIHwgb3MuT19OT05CTE9DSykKCmZp
Zm9wYXRoID0gIi90bXAvdGVzdGZpZm8iCgppZiBvcy5wYXRoLmV4aXN0cyhmaWZvcGF0aCk6CiAg
ICBvcy51bmxpbmsoZmlmb3BhdGgpCgpvcy5ta2ZpZm8oZmlmb3BhdGgpCgp3aXRoIG9wZW4oZmlm
b3BhdGgsICdyKycpIGFzIGZpZm86CiAgICBybGlzdCA9IFtdCiAgICBub25ibG9ja2luZ2ZkKGZp
Zm8uZmlsZW5vKCkpCiAgICBybGlzdC5hcHBlbmQoZmlmbykKICAgIHdoaWxlIFRydWU6CiAgICAg
ICAgcix3LGUgPSBzZWxlY3Quc2VsZWN0IChybGlzdCwgW10sIFtdLCAxKQogICAgICAgIGlmIGZp
Zm8gaW4gcjoKICAgICAgICAgICAgdHJ5OgogICAgICAgICAgICAgICAgZGF0YSA9IGZpZm8ucmVh
ZCgpCiAgICAgICAgICAgIGV4Y2VwdCBJT0Vycm9yIGFzIGVycjoKICAgICAgICAgICAgICAgIGlm
IGVyci5lcnJubyA9PSBlcnJuby5FQUdBSU4gb3IgZXJyLmVycm5vID09IGVycm5vLkVXT1VMREJM
T0NLOgogICAgICAgICAgICAgICAgICAgIGRhdGEgPSBOb25lCgogICAgICAgICAgICBwcmludCAn
IicgKyBkYXRhICsgJyInCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>