BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001398 [BusyBox] Other minor always 06-20-07 23:12 02-13-08 08:55
Reporter weedy View Status public  
Assigned To BusyBox
Priority normal Resolution unable to reproduce  
Status closed   Product Version 1.4.x
Summary 0001398: possible memory leak
Description I am running this script on a operwrt router with BusyBox v1.4.2 and the mem usage just keeps rising. is there a way around this?

VPNlist="/etc/storelist" #tunnel list
while :; do
        ping -c 3 4.2.2.2 >&- 2>&- || continue
        # if 4.2.2.2 exists ping will have a exitcode equal to 0 (only need this check once)

        while read IP STORE JUNK; do # may not need JUNK, but it doesn't hurt
                ping -c 2 "$IP" >&- 2>&- && continue
                ping -c 3 4.2.2.2 >&- 2>&- || continue
                # if ${IP} doesn't exist ping will have a exitcode not equal to 0
                ipsec auto --replace $STORE >&- 2>&-
                ipsec auto --up $STORE >&- 2>&- &
        done < "$VPNlist"
done
Additional Information
Attached Files

- Relationships

- Notes
(0002494)
vda
06-21-07 06:32

What shell do you use?
 
(0002495)
weedy
06-21-07 09:54

/bin/sh -> busybox
 
(0002578)
weedy
07-08-07 15:08

anything?
 
(0002579)
bernhardf
07-08-07 15:12

Your comment does not tell us what shell you are using.
So.. What shell do you use?
 
(0002580)
weedy
07-08-07 22:51

i (ssh'ed in) use ash /bin/ash -> busybox
script uses /bin/sh -> busybox
if this isnt what you mean could you be more specific?
 
(0002593)
vda
07-12-07 06:10

There is no "/bin/sh" shell. Do ls -l /bin/sh, and you will see that it is most likely a symlink. If it is a symlink to (for example) msh - bingo, you are using msh. If it is a symlink to /whatever/busybox, look into your busybox .config file. If you see (for example):

CONFIG_FEATURE_SH_IS_LASH=y

then "sh" is actually lash in your busybox.
 
(0002595)
weedy
07-12-07 23:25

like i said /bin/sh -> busybox
lrwxrwxrwx 1 root root 7 Jul 7 17:05 /bin/sh -> busybox

but yeah didnt know you ment the config. as you can see its ash
#
# Shells
#
CONFIG_FEATURE_SH_IS_ASH=y
CONFIG_ASH=y
 
(0002596)
vda
07-13-07 08:39

I run this script under current svn's ash:

#!/bin/sh
VPNlist="storelist" #tunnel list
while :; do
        ping -c 1 127.0.0.1 >&- 2>&- || continue
        while read IP STORE JUNK; do # may not need JUNK, but it doesn't hurt
                echo ping -c 2 "$IP"
                echo ping -c 3 4.2.2.2
                echo ipsec auto --replace $STORE
                echo ipsec auto --up $STORE
        done < "$VPNlist"
        ps -o pid,vsz,args | grep "^$$ "
done

storelist contains just one string (any string, it is not important what exactly is there). And I see steady memory usage (vsz doesn't grow).

Can you try it? If it works for you too (vsz doesn't grow), try with YOUR storelist, then start uncommenting pings/ipsecs/etc and let us know at which step exactly is will start to leak again.
 
(0004454)
vda
02-13-08 08:55

Reporter is not responding.
 

- Issue History
Date Modified Username Field Change
06-20-07 23:12 weedy New Issue
06-20-07 23:12 weedy Status new => assigned
06-20-07 23:12 weedy Assigned To  => BusyBox
06-21-07 06:32 vda Note Added: 0002494
06-21-07 09:54 weedy Note Added: 0002495
07-08-07 15:08 weedy Note Added: 0002578
07-08-07 15:12 bernhardf Note Added: 0002579
07-08-07 22:51 weedy Note Added: 0002580
07-12-07 06:10 vda Note Added: 0002593
07-12-07 23:25 weedy Note Added: 0002595
07-13-07 08:39 vda Note Added: 0002596
02-13-08 08:55 vda Status assigned => closed
02-13-08 08:55 vda Note Added: 0004454
02-13-08 08:55 vda Resolution open => unable to reproduce


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker