<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>7299</bug_id>
          
          <creation_ts>2015-02-08 20:58:42 +0000</creation_ts>
          <short_desc>&quot;bitbake -g -u depexp &lt;package&gt;&quot; segfaults and hogs memory while connecting to server through ssh</short_desc>
          <delta_ts>2015-03-26 06:44:31 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>1.8</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Maxin B. John (inactive)">maxin.baby.john</reporter>
          <assigned_to name="Maxin B. John (inactive)">maxin.baby.john</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>bluelightning</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          <qa_contact name="Alexandru Georgescu">alexandru.c.georgescu</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>48627</commentid>
    <comment_count>0</comment_count>
    <who name="Maxin B. John (inactive)">maxin.baby.john</who>
    <bug_when>2015-02-08 20:58:42 +0000</bug_when>
    <thetext>Executing &quot;bitbake -g -u depexp &lt;package&gt;&quot; 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] &lt;defunct&gt;
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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48628</commentid>
    <comment_count>1</comment_count>
      <attachid>2400</attachid>
    <who name="Maxin B. John (inactive)">maxin.baby.john</who>
    <bug_when>2015-02-08 21:11:44 +0000</bug_when>
    <thetext>Created attachment 2400
proposed fix

Check whether DISPLAY is set and it functions as expected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48847</commentid>
    <comment_count>2</comment_count>
    <who name="Maxin B. John (inactive)">maxin.baby.john</who>
    <bug_when>2015-02-16 09:17:33 +0000</bug_when>
    <thetext>Fix accepted:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=b427750a5d8e2a2e1a675f68dea250eb25e94c8e</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49780</commentid>
    <comment_count>3</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2015-03-26 06:44:31 +0000</bug_when>
    <thetext>verified with master:5c76cebc24675edb3dff473fce9b67cedff615db</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>2400</attachid>
            <date>2015-02-08 21:11:44 +0000</date>
            <delta_ts>2015-02-08 21:11:44 +0000</delta_ts>
            <desc>proposed fix</desc>
            <filename>0001-depexp.py-Fix-segfault-if-DISPLAY-is-not-set.patch</filename>
            <type>text/plain</type>
            <size>1182</size>
            <attacher name="Maxin B. John (inactive)">maxin.baby.john</attacher>
            
              <data encoding="base64">RnJvbSBiNzc5MzYxMzg3YWViMTg2N2RlZTEwNzlmNjlkZDFiNzI1YTYwYTNlIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiAiTWF4aW4gQi4gSm9obiIgPG1heGluLmpvaG5AZW5lYS5jb20+
CkRhdGU6IFN1biwgOCBGZWIgMjAxNSAyMToxNTozMyArMDEwMApTdWJqZWN0OiBbUEFUQ0hdIGRl
cGV4cC5weTogRml4IHNlZ2ZhdWx0IGlmIERJU1BMQVkgaXMgbm90IHNldAoKYml0YmFrZSAtZyAt
dSBkZXBleHAgPHBhY2thZ2U+IHNlZ2ZhdWx0cyB3aGVuIERJU1BMQVkgaXMgbm90IHNldApwcm9w
ZXJseS4gRml4IGl0IHdpdGggYSBwcm9wZXIgY2hlY2suCgpTaWduZWQtb2ZmLWJ5OiBNYXhpbiBC
LiBKb2huIDxtYXhpbi5qb2huQGVuZWEuY29tPgotLS0KIGJpdGJha2UvbGliL2JiL3VpL2RlcGV4
cC5weSB8IDcgKysrKysrKwogMSBmaWxlIGNoYW5nZWQsIDcgaW5zZXJ0aW9ucygrKQoKZGlmZiAt
LWdpdCBhL2JpdGJha2UvbGliL2JiL3VpL2RlcGV4cC5weSBiL2JpdGJha2Uv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