hush - memory leak?

Piotr Grudzinski piotr at powersmiths.com
Tue Dec 28 20:18:32 UTC 2010


>> Here is my 'top' output (how would I get output formated like your's?)
>
> By pressing 's'

When I press 's', top terminates with the following message:
top: no process info in /proc

> I would like you to try more things.
> For example:
>

Does "while true; do cat </dev/null; done" leak? - NO
Does "while true; do echo -n ""; done" leak? - NO
Does "while true; do cut </dev/null; done" leak? - YES
Does "while true; do grep qwerty </dev/null; done" leak? -YES

>
> Next experiment: find and set LEAK_HUNTING to 1 in hush.c:
>
> #define LEAK_HUNTING 1
>
> Build busybox, then run:
>
> # ./busybox hush -c 'i=1000; while test $((--i)) -ne 1; do sleep 0; done'
> 2>output
> # shell/hush_leaktool.sh
>
> Please do this test and send me your output.leaked file.

The output.leaked file is empty but my free mem went down from 10MB to 1MB.

I have noticed that if I change BUSYBOX_EXEC_PATH from /proc/self/exe to 
/bin/busybox the problem is gone.
The same problem is with bb 1.17.4 but I had BUSYBOX_EXEC_PATH set to 
/bin/busybox so I didn't see it.

--
Piotr





More information about the busybox mailing list