Bug 7993 - pseudo: select returns immediately on FIFO
Summary: pseudo: select returns immediately on FIFO
Status: VERIFIED FIXED
Alias: None
Product: Pseudo
Classification: Yocto Project Subprojects
Component: pseudo (show other bugs)
Version: unspecified
Hardware: All Multiple
: Medium+ normal
Target Milestone: 1.9 M2
Assignee: Seebs
QA Contact: Daniel Istrate
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-07-14 12:43 UTC by Paul Eggleton
Modified: 2015-09-22 15:13 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
Test script to demonstrate the issue (700 bytes, text/x-python)
2015-07-14 12:43 UTC, Paul Eggleton
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Eggleton 2015-07-14 12:43:15 UTC
Created attachment 2588 [details]
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
Comment 1 Ross Burton 2015-07-23 20:41:44 UTC
Fixed in pseudo 1.6.7, merged in oe-core 0295947a2ccc66037f9c20f06b4b69a781a046bd.
Comment 2 Daniel Istrate 2015-09-22 15:13:11 UTC
Verified on master: 7b86c771c80d0759c2ca0e57c46c4c966f89c49e

Steps to verify:
1. Download the attached script and run it
2. In another terminal run: echo test > /tmp/testfifo --> 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 > /tmp/testfifo --> You should see the echoed message in the pseudo env where the script is running.