FS#45891 - [bash] script shows memory leak
Attached to Project:
Arch Linux
Opened by Sijie Bu (butangmucat) - Tuesday, 04 August 2015, 09:00 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Monday, 23 November 2015, 20:18 GMT
Opened by Sijie Bu (butangmucat) - Tuesday, 04 August 2015, 09:00 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Monday, 23 November 2015, 20:18 GMT
|
Details
Description:
I saw this on the Red Hat bug tracker and reproduced on my Arch Linux installation. Bash is eating up memory when dealing with a special script. The original bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1245233 Additional info: sijie@sijie-t900 ~ $ pacman -Q bash bash 4.3.039-1 bash --version GNU bash,版本 4.3.39(1)-release (x86_64-unknown-linux-gnu) Steps to reproduce: I simply followed the steps in the original Red Hat bug report. sijie@sijie-t900 ~ $ cat loop.sh #!/bin/bash run() { local -a A=(); local -a A=(); } while :; do run; done sijie@sijie-t900 ~ $ cat test2.sh #!/bin/bash $(readlink /proc/$$/exe) loop.sh & SHPID=$! sleep 1 MEM=$(ps p $SHPID o "%z" | grep -v VSZ) echo "memory consumption: $MEM" sleep 15 MEM2=$(ps p $SHPID o "%z" | grep -v VSZ) kill $SHPID echo "memory consumption: $MEM2" #compare memory consumption [ $MEM -eq $MEM2 ] sijie@sijie-t900 ~ $ ./test2.sh memory consumption: 43244 memory consumption: 443468 |
This task depends upon
Closed by Bartłomiej Piotrowski (Barthalion)
Monday, 23 November 2015, 20:18 GMT
Reason for closing: Fixed
Additional comments about closing: bash 4.3.042-4
Monday, 23 November 2015, 20:18 GMT
Reason for closing: Fixed
Additional comments about closing: bash 4.3.042-4
With https://aur.archlinux.org/packages/bash-devel-git/
[~]./test2.sh
memory consumption: 14888
memory consumption: 14888
./test2.sh: line 13: 26605 Terminated $(readlink /proc/$$/exe) loop.sh