Bug 9999

Summary: Random warning: Unrecognised command on FIFO
Product: [Build System, Metadata & Runtime] BitBake Reporter: Yi Zhao <yi.zhao>
Component: bitbakeAssignee: Ross Burton <ross.burton>
Status: VERIFIED FIXED QA Contact: Yi Zhao <yi.zhao>
Severity: normal    
Priority: Undecided CC: jose.perez.carranza, poky.bs.watcher, poky.watcher, ross.burton, yi.zhao
Version: 2.2   
Target Milestone: ---   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Used to work)
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
log.do_configure for rpm
none
log.do_install from glew none

Description Yi Zhao 2016-07-22 09:40:17 UTC
Git rev: master/36feb38045b7a2af86ece147fec54b0db3bf491f

Host OS: Debian 8, Ubuntu 16.04

Steps:
Set the environment and build core-image-sato-sdk:
$bitbake core-image-sato-sdk

When building the image, there are some warnings for packages:
###########################
WARNING: glew-1.13.0-r0 do_install: Unrecognised command '1.13.0-r0/image' on FIFO
WARNING: rpm-5.4.16-r0 do_configure: Unrecognised command 'erl' on FIFO
##############################

The warning appears randomly for random package. And only happens on Debian and Ubuntu, but not on Fedora.

Seems like the FIFO doesn't have enough size and the command has been truncated.

I attached the full log.
Comment 1 Yi Zhao 2016-07-22 09:41:32 UTC
Created attachment 3307 [details]
log.do_configure for rpm
Comment 2 Yi Zhao 2016-07-22 09:42:03 UTC
Created attachment 3308 [details]
log.do_install from glew
Comment 3 Ross Burton 2016-07-22 15:32:32 UTC
Is this a 32-bit or 64-bit host?

Can you run the following shell and report back what the output is:

sh -c '
  rm -f myfifo
  mkfifo myfifo
  yes produce_this_string_as_output | tee myfifo | wc -c &
  exec 3<&- 3<myfifo
  sleep 1
  exec 3<&-
  rm -f myfifo
'
Comment 4 Ross Burton 2016-07-22 15:52:38 UTC
If I build glew on my machine I get this log:

DEBUG: Executing shell function do_install
NOTE: make -j 20 SYSTEM=linux CC=x86_64-poky-linux-gcc -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2 --sysroot=/data/poky-master/tmp-glibc/sysroots/intel-corei7-64 LD=x86_64-poky-linux-gcc -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2 --sysroot=/data/poky-master/tmp-glibc/sysroots/intel-corei7-64 STRIP= LDFLAGS.EXTRA=-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now POPT= -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/data/poky-master/tmp-glibc/work/corei7-64-poky-linux/glew/1.13.0-r0=/usr/src/debug/glew/1.13.0-r0 -fdebug-prefix-map=/data/poky-master/tmp-glibc/sysroots/x86_64-linux= -fdebug-prefix-map=/data/poky-master/tmp-glibc/sysroots/intel-corei7-64=  -fstack-protector-strong -pie -fpie -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security GLEW_PREFIX=/usr BINDIR=/usr/bin LIBDIR=/usr/lib INCDIR=/usr/include/GL DESTDIR=/data/poky-master/tmp-glibc/work/corei7-64-poky-linux/glew/1.13.0-r0/image install.all

Whereas the log ends at:
[...] GLEW_PREFIX=/usr BINDIR=/usr/bin LIBDIR=/usr/lib INCDIR=/usr/include/GL DESTDIR=/buildarea1/sdk-automation-test/ubs-build/build-core2-64/tmp/work/core2-64-poky-linux/glew/

So for some reason it did a partial read.  I guess we need to buffer inside bitbake in case there's a partial write or read.
Comment 5 Yi Zhao 2016-07-25 03:21:52 UTC
(In reply to comment #3)
> Is this a 32-bit or 64-bit host?

The Debian 8 is 32-bit and Ubuntu 16.04 is 64-bit.

> 
> Can you run the following shell and report back what the output is:
> 
> sh -c '
>   rm -f myfifo
>   mkfifo myfifo
>   yes produce_this_string_as_output | tee myfifo | wc -c &
>   exec 3<&- 3<myfifo
>   sleep 1
>   exec 3<&-
>   rm -f myfifo
> '

Here is the result:

$ sh -c '
>   rm -f myfifo
>   mkfifo myfifo
>   yes produce_this_string_as_output | tee myfifo | wc -c &
>   exec 3<&- 3<myfifo
>   sleep 1
>   exec 3<&-
>   rm -f myfifo
> '
73728
Comment 6 Ross Burton 2016-07-25 22:32:51 UTC
Just sent a patch to the bitbake list, can you test it please?  I've never seen this myself.
Comment 7 Yi Zhao 2016-07-26 01:43:51 UTC
(In reply to comment #6)
> Just sent a patch to the bitbake list, can you test it please?  I've never
> seen this myself.

OK. I will apply the patch and re-test.
Comment 8 Ross Burton 2016-07-26 16:30:03 UTC
Fixed in bitbake 508112793ee7ace613f07695222997309a2ca58f.
Comment 9 Yi Zhao 2016-07-27 06:03:06 UTC
Verified with latest master branch:
master/039f47ad197a9a53109c9f3deadd9c35e62c056d