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

 
 

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

Submitted by:  Vitaly Teslenko <vitalyt>
Submitted on:  Wed 14 Sep 2005 07:53:59 AM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 3.80Operating System: Any
Fixed Release: 3.81Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
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

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 8 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 01 Apr 2006 07:17:46 AM UTCpsmithFixed Release4.0=>3.81
Mon 26 Sep 2005 05:07:58 AM UTCpsmithAttached File-=>Added 81mem.diff, #3002
Mon 26 Sep 2005 05:02:41 AM UTCpsmithStatusNone=>Fixed
  Assigned toNone=>psmith
  Open/ClosedOpen=>Closed
  Fixed ReleaseNone=>4.0
Thu 22 Sep 2005 07:42:21 AM UTCvitalytAttached File-=>Added gmake3813bugs.zip, #2984
Wed 14 Sep 2005 07:54:00 AM UTCvitalytAttached File-=>Added makefile, #2951

Back to the top


Powered by Savane 3.1-cleanup1