bugmake - Bugs: bug #14527, ($foreach entry) crashed system...

 
 

bug #14527: ($foreach entry) crashed system with "virtual memory exhausted"

Submitter:  Vitaly Teslenko <vitalyt>
Submitted:  Wed 14 Sep 2005 07:53:59 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.80 Operating System:  Any
Fixed Release:  3.81 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 26 Sep 2005 05:07:58 AM UTC, comment #4: 

By the way, I looked briefly at the CodeGuard log file.  Most of the messages I checked were in the hash.c functions, which I get from the id-utils package.  Although the error it reports is very technically a problem, I'm not aware of any real system where it would fail.  Basically we subtract one from a pointer (so it points to before the memory block), then we add one to it before we ever dereference it.

Paul D. Smith <psmith>
Group administrator
Mon 26 Sep 2005 05:02:41 AM UTC, comment #3: 

I found the memory leak.  Every time a shell command evaluated to an empty string (just whitespace etc.) some memory was leaked.  Because you had space-only lines in your define/enddef, there was an empty line for every one of the 4000+ files in the variable.  This caused a lot of leaked memory.

The patch below should fix the bug: it will be included in the next release of GNU make.  Note that make still acts pretty inefficiently there: it allocates far too much memory for every file in the list.  But, at least all that memory is now freed.

Paul D. Smith <psmith>
Group administrator
Thu 22 Sep 2005 07:42:20 AM UTC, comment #2: 

I have tried to build gmake 3.81 beta 3 by Borland C++ Builder 6 compiler with CodeGuard and got a huge log file with errors like 'Resource leak: The memory block was never freed'. After that I investigated the sources and check several bugs... For example, there is exist structure which stored pointer to dynamic memory, but when structure is destroying it's member pointer never freed. I attached log file and hope it help you to fix bugs... May be it is a good time to rewrite gnu make on C++, because memory bugs in ะก is very complicated... :(

Vitaly Teslenko <vitalyt>
Wed 14 Sep 2005 05:40:34 PM UTC, comment #1: 

Only the project admins can change the status of a bug.  All you needed to do was post a note to the previous bug saying "still a problem, please re-open."

I'll look at this.  Thanks for attaching the makefile.

Paul D. Smith <psmith>
Group administrator
Wed 14 Sep 2005 07:53:59 AM UTC, original submission:  

Sorry, but I don't know how to change bug status from Duplicated to Open..
I ran simple makefile for building my SDK, which just copy files from project dir into SDK dir. But ($foreach entry) command crashed the system with "virtual memory exhausted". Checked on WinXP, AIX 5.2. Bug is reproduced on Gmake 3.81 beta3
The reason is construction like:

define PrintName

@echo $(entry)

endef

all:
$(foreach entry, $(FILELIST), $(PrintName))

where FILELIST is
FILELIST=C:\Development\MoneyProject\Sources\Version10\HotFix11\Module1234\file2.cpp \
C:\Development\MoneyProject\Sources\Version10\HotFix11\Module1234\file2.cpp \
C:\Development\MoneyProject\Sources\Version10\HotFix11\Module1234\file3.h \
C:\Development\MoneyProject\Sources\Version10\HotFix11\Module1234\file4.imp \
...

Vitaly Teslenko <vitalyt>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #3051:  81mem.diff added by psmith (1KiB - text/x-patch - Patch to fix the memory leak.)
file #3162:  gmake3813bugs.zip added by vitalyt (442KiB - application/x-zip-compressed - CodeGuard log for GNU make 3.81 beta3)
file #3241:  makefile added by vitalyt (332KiB - text/plain - File for reproducing bug)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 8 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-04-01 psmith Fixed Release4.0 3.81
2005-09-26 psmith Attached File- Added 81mem.diff, #3002
2005-09-26 psmith StatusNone Fixed
    Assigned toNone psmith
    Open/ClosedOpen Closed
    Fixed ReleaseNone 4.0
2005-09-22 vitalyt Attached File- Added gmake3813bugs.zip, #2984
2005-09-14 vitalyt Attached File- Added makefile, #2951

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code