Skip to contentSkip to conversation

lsof fails with python exception when bitbake is finished

DISCUSSION Martin Jansa 3 participants 3 messages May 5, 2016

lore
Share & tools
lore
#0 lore raw

I haven't checked what leads to this error, but with latest oe-core and bitbake I've noticed ugly python exception after successful build with bitbake:

Summary: There were 35 WARNING messages shown.
Process ProcessServer-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap

    self.run()

File "/OE/bitbake/lib/bb/server/process.py", line 104, in run
bb.cooker.server_main(self.cooker, self.main)
File "/OE/bitbake/lib/bb/cooker.py", line 1692, in server_main
cooker.post_serve()
File "/OE/bitbake/lib/bb/cooker.py", line 1627, in post_serve
procs = subprocess.check_output(["lsof", '-w', lockfile], stderr=subprocess.STDOUT)
File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['lsof', '-w', '/OE/bitbake.lock']' returned non-zero exit status 1 /OE/$ lsof -w /OE/bitbake.lock
/OE/$ echo $?
1
/OE/$ ls -lah bitbake.lock
-rw-rw-r-- 1 mjansa mjansa 0 May 5 13:19 bitbake.lock

$ lsof -v
lsof version information:
    revision: 4.86
    latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/
    latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ
    latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man
    constructed: Sun Dec 2 02:36:48 UTC 2012
    constructed by and on: buildd@allspice
    compiler: cc
    compiler version: 4.7.2 (Ubuntu/Linaro 4.7.2-12ubuntu1) 
    compiler flags: -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -DLINUXV=37000 -DGLIBCV=216 -DHASIPv6 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAS_STRFTIME -DLSOF_VSTR="3.7.0" -O
    loader flags: -L./lib -llsof -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now
    system info: Linux allspice 3.2.0-33-generic #52-Ubuntu SMP Thu Oct 18 16:29:15 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
    Anyone can list all files.
    /dev warnings are disabled.
    Kernel ID check is disabled.

Is this expected?

#1 lore raw
Quoted 11 lines · Martin Jansa

I haven't checked what leads to this error, but with latest oe-core and bitbake
I've noticed ugly python exception after successful build with bitbake:

Summary: There were 35 WARNING messages shown.
Process ProcessServer-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in
_bootstrap

    self.run()
Quoted 17 lines

File "/OE/bitbake/lib/bb/server/process.py", line 104, in run
bb.cooker.server_main(self.cooker, self.main)
File "/OE/bitbake/lib/bb/cooker.py", line 1692, in server_main
cooker.post_serve()
File "/OE/bitbake/lib/bb/cooker.py", line 1627, in post_serve
procs = subprocess.check_output(["lsof", '-w', lockfile],
stderr=subprocess.STDOUT)
File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['lsof', '-w', '/OE/bitbake.lock']' returned non-zero exit status 1
/OE/$ lsof -w /OE/bitbake.lock
/OE/$ echo $?
1
/OE/$ ls -lah bitbake.lock
-rw-rw-r-- 1 mjansa mjansa 0 May 5 13:19 bitbake.lock

I'd suggest catching that exception at 1627 of cooker.py and at least printing exc.output, so we can see if lsof showed any errors.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
#2 lore raw
Quoted 31 lines · Christopher Larson

On Thu, May 5, 2016 at 8:31 AM, Martin Jansa <[email protected] <mailto:[email protected]>> wrote:

I haven't checked what leads to this error, but with latest oe-core and bitbake I've noticed ugly python exception after successful build with bitbake:

Summary: There were 35 WARNING messages shown.
Process ProcessServer-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/OE/bitbake/lib/bb/server/process.py", line 104, in run
bb.cooker.server_main(self.cooker, self.main)
File "/OE/bitbake/lib/bb/cooker.py", line 1692, in server_main
cooker.post_serve()
File "/OE/bitbake/lib/bb/cooker.py", line 1627, in post_serve
procs = subprocess.check_output(["lsof", '-w', lockfile],
stderr=subprocess.STDOUT)
File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['lsof', '-w', '/OE/bitbake.lock']' returned non-zero exit status 1
/OE/$ lsof -w /OE/bitbake.lock
/OE/$ echo $?
1
/OE/$ ls -lah bitbake.lock
-rw-rw-r-- 1 mjansa mjansa 0 May 5 13:19 bitbake.lock

Quoted 2 lines

I'd suggest catching that exception at 1627 of cooker.py and at least printing exc.output, so we can see if lsof showed any errors.

We recently found this as well. In our case it turns out we have a process (background) that was started by a special feature of our build. (similar to the pseudo daemon, but with a 60 second timeout.) This kept the lock file open, and 9 times out of 10, we'd end the build with the typical waiting on a process message, but very now and then we'd get the lsof you saw.

(we fixed it by closing the fd's on the fork/exec for the background item.)

--Mark

Quoted 8 lines
Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics