[BusyBox 0003884]: msh bails out with "out of string space" error

bugs at busybox.net bugs at busybox.net
Sun Jul 20 16:03:55 PDT 2008


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=3884 
====================================================================== 
Reported By:                psl
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   3884
Category:                   Other
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             06-27-2008 02:33 PDT
Last Modified:              07-20-2008 16:03 PDT
====================================================================== 
Summary:                    msh bails out with "out of string space" error
Description: 
Hello,

I've tried the following simple script on the busybox' msh:
#!/bin/msh
while true; do
continue
done

Running the script, I've got the following:
# ./tt
out of string space
# 

Apparently, there is some memory leak in the implementation of
the msh.


====================================================================== 

---------------------------------------------------------------------- 
 vapier - 06-28-08 07:57  
---------------------------------------------------------------------- 
this is a known issue ... but i dont think i ever opened a report on it

the way msh implements "continue" and such constructs does not unwind
allocated space until you exit the whole loop

i dont think it could be fixed without some sign rearchitecting of the
code 

---------------------------------------------------------------------- 
 avn - 07-17-08 23:17  
---------------------------------------------------------------------- 
The attached patch fixes this issue on top of trunk.

The fix is to restore the "area number" after longjmp-ing from brkcont()
and free the space allocated by nested execute(). The allocations of the
nested execute() bear an area number one higher than the current area
number. 

---------------------------------------------------------------------- 
 vda - 07-20-08 16:03  
---------------------------------------------------------------------- 
Thanks for the patch! Seems to work. Applied in rev 22893. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-27-08 02:33  psl            New Issue                                    
06-27-08 02:33  psl            Status                   new => assigned     
06-27-08 02:33  psl            Assigned To               => BusyBox         
06-28-08 07:57  vapier         Note Added: 0008644                          
07-17-08 23:15  avn            File Added: 3884.diff                        
07-17-08 23:17  avn            Note Added: 0009724                          
07-20-08 16:03  vda            Status                   assigned => closed  
07-20-08 16:03  vda            Note Added: 0009864                          
======================================================================



More information about the busybox-cvs mailing list