<?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>5045</bug_id>
          
          <creation_ts>2013-08-23 15:32:45 +0000</creation_ts>
          <short_desc>smart fails with Cannot allocate memory</short_desc>
          <delta_ts>2013-10-07 13:40:12 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>11</classification_id>
          <classification>Runtime</classification>
          <product>Package Management Issues</product>
          <component>RPM</component>
          <version>1.5</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>normal</bug_severity>
          <target_milestone>1.5 M5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Stefan Stanacar">sstncr</reporter>
          <assigned_to name="Paul Eggleton">bluelightning</assigned_to>
          <cc>mark.hatle</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>35891</commentid>
    <comment_count>0</comment_count>
    <who name="Stefan Stanacar">sstncr</who>
    <bug_when>2013-08-23 15:32:45 +0000</bug_when>
    <thetext>poky commit: 199b1a8c7d7109d9b59d67bf4dcfeb03be07587a

I&apos;m seeing random failures for smart commands on qemu machines. Pretty hard to replicate them quite constantly, but it all comes down to how much free ram is available in the image (and what else I&apos;m doing at that moment). What follows is one of the &quot;gentle&quot; fails, because usually I get entire stack traces (when running as automated tests) or messages like:
BDB2053 Freeing read locks for locker 0x1fe2:                           
BDB2017 Freeing mutex for process: 

Easiest path to replicate has been this
 - start with fresh qemux86-64 core-image-sato (it&apos;s important to have an image with few RAM available).
 - make sure you have Internet acces in the image (or at least access to a smart repo with lots of packages, I usually server DEPLOY_DIR/rpm from a sato-sdk build)
  - run random smart commands, add a few channels, run smart update and them removes and installs

e.g:

root@qemux86-64:~# free
             total         used         free       shared      buffers
Mem:        117164        82580        34584            0         3208
-/+ buffers:              79372        37792
Swap:            0            0            0

# smart info python-smartpm &amp;&amp; smart query python-smartpm &amp;&amp; smart stats

...

root@qemux86-64:~# smart channel -y --add all type=rpm-md baseurl=http://autobuilder.yoctoproject.org/pub/nightly/20130820-1/rpm/all      

root@qemux86-64:~# smart channel -y --add x86_64 type=rpm-md baseurl=http://autobuilder.yoctoproject.org/pub/nightly/20130820-1/rpm/x86_64

root@qemux86-64:~# smart channel -y --add qemux86_64 type=rpm-md baseurl=http://autobuilder.yoctoproject.org/pub/nightly/20130820-1/rpm/qemux86_64

root@qemux86-64:~# smart channel --show
[x86_64]
type = rpm-md
baseurl = http://autobuilder.yoctoproject.org/pub/nightly/20130820-1/rpm/x86_64

[all]
type = rpm-md
baseurl = http://autobuilder.yoctoproject.org/pub/nightly/20130820-1/rpm/all

[rpmsys]
type = rpm-sys

[qemux86_64]
type = rpm-md
baseurl = http://autobuilder.yoctoproject.org/pub/nightly/20130820-1/rpm/qemux86_64
root@qemux86-64:~# smart update
Loading cache...
Updating cache...               ######################################## [100%]

Fetching information for &apos;x86_64&apos;...                                           
-&gt; http://autobuilder.yoctoproject.org/pub/nightly/20130820-1/.../repomd.xml   
repomd.xml                      ######################################## [ 16%]
-&gt; http://autobuilder.yoctoproject.org/pub/nightly/.../filelists.xml.gz        
filelists.xml.gz                ######################################## [ 25%]
-&gt; http://autobuilder.yoctoproject.org/pub/nightly/.../primary.xml.gz          
primary.xml.gz                  ######################################## [ 33%]
                                                                               
Fetching information for &apos;all&apos;...
-&gt; http://autobuilder.yoctoproject.org/pub/nightly/20130820-1/.../repomd.xml   
repomd.xml                      ######################################## [ 50%]
-&gt; http://autobuilder.yoctoproject.org/pub/nightly/.../primary.xml.gz          
primary.xml.gz                  ######################################## [ 58%]
-&gt; http://autobuilder.yoctoproject.org/pub/nightly/.../filelists.xml.gz        
filelists.xml.gz                ######################################## [ 66%]
                                                                               
Fetching information for &apos;qemux86_64&apos;...
-&gt; http://autobuilder.yoctoproject.org/pub/nightly/20130820-1/.../repomd.xml   
repomd.xml                      ######################################## [ 83%]
-&gt; http://autobuilder.yoctoproject.org/pub/nightly/.../primary.xml.gz          
primary.xml.gz                  ######################################## [ 91%]
-&gt; http://autobuilder.yoctoproject.org/pub/nightly/.../filelists.xml.gz        
filelists.xml.gz                ######################################## [100%]

Updating cache...               ######################################## [100%]

Channels have 6415 new packages.
Saving cache...

--

I got lucky this time, I tried 3 times not to have the process killed.

Usually (AutoBuilder builds) it dies with 

Saving cache...sh: line 1:  1086 Killed                  smart update)



root@qemux86-64:~# smart remove -y psplash-default
Loading cache...
Updating cache...               ######################################## [100%]

Computing transaction...

Removing packages (1):
  psplash-default-0.1+git0+afd4e228c6-r15@x86_64                                

50.9kB will be freed.

Committing transaction...                                                      
Preparing...                    ######################################## [  0%]
   1:Removing psplash-default   ######################################## [100%]
error: Couldn&apos;t fork %postun: Cannot allocate memory                           


Yay, here it goes (of course it doesn&apos;t remove the package). But that&apos;s not the only one seen. Random fails:

root@qemux86-64:~# rpm -e psplash-default
root@qemux86-64:~# rpm -e psplash        
root@qemux86-64:~# smart install psplash        

Preparing...                    ######################################## [  0%]
   1:Installing psplash         ######################################## [ 50%]
Output from psplash-0.1+git0+afd4e228c6-r15@x86_64:                            
error: Couldn&apos;t fork %post: Cannot allocate memory                             
   2:Installing psplash-default ######################################## [100%]
Output from psplash-default-0.1+git0+afd4e228c6-r15@x86_64:                    
error: Couldn&apos;t fork %post: Cannot allocate memory                             

Might be related to:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=4872
but that&apos;s for beagleboard.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36157</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2013-09-02 12:06:18 +0000</bug_when>
    <thetext>Patch sent to increase default memory size in runqemu to 256MB, which in my tests here resolves the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36160</commentid>
    <comment_count>2</comment_count>
    <who name="Stefan Stanacar">sstncr</who>
    <bug_when>2013-09-02 12:44:24 +0000</bug_when>
    <thetext>Same here, I tested a qemux86-64 with 256MB memory size and haven&apos;t seen anymore fails.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36181</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2013-09-03 08:23:04 +0000</bug_when>
    <thetext>Fix merged to master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=6ccd4d6a9d3910b6e729fe2d00056d8d325403c8</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37688</commentid>
    <comment_count>4</comment_count>
    <who name="Stefan Stanacar">sstncr</who>
    <bug_when>2013-10-07 13:40:12 +0000</bug_when>
    <thetext>Marking as Verified.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>