#743 executing a shell scripts gives a memory leak

MSYS
closed
Earnie Boyd
None
out-of-date
Unknown
2013-02-05
2005-03-25
A. Haferburg
No

Hi!

I've been trying to run a configure script, which gave me a
huge memory leak. I've then created an empty script like
this:

$ vi e
:wq
$ chmod +x e

then I wrote a script f that calls this empty script 100 times.

for((i=0;i<100;i++))
do
./e
done

I've never written a shell script before, but it seems to work. :
-) Anyway, every time I call f, approximately 2700KB of
virtual memory are gone. (I check this in the task manager.)

environment:
Windows 2000 SP4
gcc version 3.4.2 (mingw-special)
GNU ld version 2.15.91 20040904
MinGW-3.2.0-rc-3.exe
MSYS-1.0.11-2004.04.30-1.exe

The configure script I executed was from the k3d project.
The task manager said, I was using 137740KB of memory. I
ran
./configure --without-docbook --without-gnome --without-gts
--without-imagemagick --without-jpeg --without-openexr
--without-plib --without-png --without-python --without-tiff

Memory consumption climbed up to 243396KB, then I got
the error messages below. I also noted that the process IDs
for the stuff called from the script climbed up to values
>30000, which seems unusual to me.

If you need to know anything else or want me to try sth,
please drop me a mail. (Does sf.net do this automatically if
someone adds a comment to this bug?)

Thanks
A. Haferburg

said error message:

0 [main] sh 31396 sync_with_child: child 31404(0x2EC)
died before initiali zation with status code 0x80
9169 [main] sh 31396 sync_with_child: *** child state
waiting for longjmp
./config.status: fork: Resource temporarily unavailable
13246 [main] sh 31396 sync_with_child: child
31408(0x350) died before initiali zation with status code
0x80
19424 [main] sh 31396 sync_with_child: *** child state
waiting for longjmp
./config.status: fork: Resource temporarily unavailable
./config.status: /bin/sed: Permission denied
0 [main] sh 20420 sync_with_child: child 31416(0x268)
died before initiali zation with status code 0x80
114 [main] sh 20420 sync_with_child: *** child state
waiting for longjmp
./config.status: fork: Resource temporarily unavailable
0 [main] sh 356 sync_with_child: child 31436(0x2BC)
died before initializa tion with status code 0x80
4152 [main] sh 356 sync_with_child: *** child state waiting
for longjmp
./configure: fork: Resource temporarily unavailable
8789 [main] sh 356 sync_with_child: child 31440(0x260)
died before initializa tion with status code 0x80
14492 [main] sh 356 sync_with_child: *** child state
waiting for longjmp
./configure: fork: Resource temporarily unavailable

Discussion

  • Hugh Perkins
    Hugh Perkins
    2005-06-02

    Logged In: YES
    user_id=844774

    I believe I have a similar problem to this. Its a critical
    blocking issue for me, because it means I cant actually run
    *any* configure script to completion, at least not using cccl
    (which obviously doubles the number of forks).

    Can we bump up the priority a little please?

     
  • Hans Becker
    Hans Becker
    2005-08-05

    Logged In: YES
    user_id=1324353

    I also can confirm this with WinXP SP1.

    I even tried within safe mode to exclude any running
    software which might have an influence. My memory went from
    462 of 512 MB free down to 240 MB free when configuring
    SDL12 without any options. Make started normally afterwars,
    but soon memory went down to 12 MB free and make aborted
    with severe fork errors.

    Env. used was MinGW 4.1.1 + msysDTK 1.0.1 + msys 1.0.10.
    Also tried older versions of MinGW(3.1.0.1) and msys(1.0.8),
    no change. Haven't tried building cvs msys yet, because the
    changelog didn't mention anything related to this issue.

    The script above climbed about the same amount of memory
    ahaferburg stated.

     
  • Earnie Boyd
    Earnie Boyd
    2005-08-05

    • labels: --> MSYS
    • priority: 5 --> 7
    • assigned_to: nobody --> earnie
     
  • Hans Becker
    Hans Becker
    2005-08-06

    Logged In: YES
    user_id=1324353

    Got an update regarding this:

    I've got a second pc, Via Epia M with a 1G C3 and 256 MB
    PC333. Also running WinXP SP1 on this one, same patchlevel.

    I copied the whole mingw/msys including all sources to that
    PC(same drive and directory). After this, I started both my
    PCs(main with 3,06 G Prescott Celeron and 512 MB PC400) and
    the above one in safe mode to have same conditions.

    Then I started a ./configure for SDL12.

    My main pc ran out of memory, but my second pc didn't!
    Memory was released as it should during the configure process.

    Could it be related to the cpu architecture? I'm not that
    familiar with C/C++ to do debugging with msys or mingw.

    Hope this information was useful.

     
  • Earnie Boyd
    Earnie Boyd
    2013-02-05

    If this continues as an issue with the latest MSYS release please open a new issue.

     
  • Earnie Boyd
    Earnie Boyd
    2013-02-05

    • labels: MSYS -->
    • status: open --> closed
    • resolution: --> out-of-date
    • category: --> Unknown
    • milestone: --> MSYS