Bug 7299 - "bitbake -g -u depexp <package>" segfaults and hogs memory while connecting to server through ssh
Summary: "bitbake -g -u depexp <package>" segfaults and hogs memory while connecting t...
Status: VERIFIED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: PC Multiple
: Medium+ critical
Target Milestone: 1.8
Assignee: Maxin B. John (inactive)
QA Contact: Alexandru Georgescu
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-02-08 20:58 UTC by Maxin B. John (inactive)
Modified: 2015-03-26 06:44 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
proposed fix (1.15 KB, patch)
2015-02-08 21:11 UTC, Maxin B. John (inactive)
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maxin B. John (inactive) 2015-02-08 20:58:42 UTC
Executing "bitbake -g -u depexp <package>" in the Yocto build server connected through SSH resulted in Segfault. We can re-create the same scenario in local machine with these steps:  

$ cd poky
$ source oe-init-build-env
$ unset DISPLAY
$ bitbake -g -u depexp python
Segmentation fault (core dumped)

Even-though, the program seems to be segfaulted, this creates a number of background processes which continues to run:

$ ps ax|grep python
12074 pts/0    Dl     7:52 python /home/maxin/poky/bitbake/bin/bitbake -g -u depexp python
12729 pts/0    Dl     3:08 python /home/maxin/poky/bitbake/bin/bitbake -g -u depexp python
12733 pts/0    Z      0:00 [python] <defunct>
12735 pts/0    Sl     0:58 python /home/maxin/poky/bitbake/bin/bitbake -g -u depexp python
12736 pts/0    Sl     0:58 python /home/maxin/poky/bitbake/bin/bitbake -g -u depexp python
12737 pts/0    Sl     0:58 python /home/maxin/poky/bitbake/bin/bitbake -g -u depexp python
12738 pts/0    Sl     0:59 python /home/maxin/poky/bitbake/bin/bitbake -g -u depexp python


While trying to debug the segfault, I have executed this command a number of times in the server and that unintentionally consumed a lot of memory which kicked the OOM killer. That virtually took the server down as it killed the ssh server.

(This script can start the OOM killer in my i7 machine as a normal user)

#!/bin/bash
for i in {1..50}
do
    rm bitbake.lock
    bitbake -g -u depexp python
done
Comment 1 Maxin B. John (inactive) 2015-02-08 21:11:44 UTC
Created attachment 2400 [details]
proposed fix

Check whether DISPLAY is set and it functions as expected.
Comment 3 Alexandru Georgescu 2015-03-26 06:44:31 UTC
verified with master:5c76cebc24675edb3dff473fce9b67cedff615db