delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/07/01/11:46:12

Sender: ml AT delorie DOT com
Message-ID: <33B917F7.45B3326B@cdata.tvnet.hu>
Date: Tue, 01 Jul 1997 16:45:11 +0200
From: Molnar Laszlo <molnarl AT cdata DOT tvnet DOT hu>
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Memory leak in bash

Hi Workers!

I think I've found a bug in the latest bash (bashb9.zip).
When I run the file test0.sh with "sh test0.sh", I get:

DPMI memory available: 22923 Kb
DPMI swap space available: 129297 Kb
DPMI memory available: 22911 Kb
DPMI swap space available: 129309 Kb
DPMI memory available: 22911 Kb
DPMI swap space available: 129309 Kb
DPMI memory available: 22911 Kb
DPMI swap space available: 129309 Kb
DPMI memory available: 22903 Kb
DPMI swap space available: 129317 Kb
DPMI memory available: 22887 Kb
DPMI swap space available: 129333 Kb
DPMI memory available: 22811 Kb
DPMI swap space available: 129217 Kb
DPMI memory available: 22491 Kb
DPMI swap space available: 129025 Kb
DPMI memory available: 21235 Kb
DPMI swap space available: 128617 Kb
DPMI memory available: 16235 Kb
DPMI swap space available: 127345 Kb
DPMI memory available: 119251 Kb
DPMI swap space available: 0 Kb

As you can see at the last step all of my 22 MB physical memory is full.
Why is this?

bye, Laszlo

ps: I've found this problem in perl5.004's Configure script.

Here are the 3 test files:

*--test0.sh----*
go32-v2 | grep DPMI

for i in 1 2 3 4 5 6 7 8 9 10
do
    . ./test1.sh         # if you change this line to "sh ./test1.sh"
    go32-v2 | grep DPMI  # then there is no problem!
done
*--eof---------* 

*--test1.sh----*
. ./test2.sh

cat >x <<ENDEND
blah-blah
ENDEND
*--eof---------*

*--test2.sh----*
cat >x <<ENDEND
blah-blah
ENDEND
*--eof---------*

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019