[bitbake-devel] lsof fails with python exception when bitbake is finished

Mark Hatle mark.hatle at windriver.com
Thu May 5 16:51:31 UTC 2016


On 5/5/16 11:29 AM, Christopher Larson wrote:
> 
> On Thu, May 5, 2016 at 8:31 AM, Martin Jansa <martin.jansa at gmail.com
> <mailto:martin.jansa at gmail.com>> 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
> 
> 
> 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

> -- 
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Maintainer - Tslib
> Senior Software Engineer, Mentor Graphics
> 
> 




More information about the bitbake-devel mailing list