bugmake - Bugs: bug #1517, $(eval ...) behaves strangely


bug #1517: $(eval ...) behaves strangely

Submitted by:  Paul D. Smith <psmith>
Submitted on:  Fri 25 Oct 2002 09:34:39 PM UTC  
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  Paul D. Smith <psmith> Open/Closed:  Closed
Component Version:  3.80 Operating System:  None
Fixed Release:  3.81 Triage Status:  None

Add a New Comment (Rich Markup)

You are not logged in

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


Thu 24 Mar 2005 02:37:08 AM UTC, comment #2: 

I have been experiencing this problem and have tried the attached patch provided by psmith, however the patch did not solve the problem.  When I applied the patch to make 3.80 it did not apply smoothly:

$ patch -p0 < ../eval-crash.diff
patching file variable.h
patching file expand.c
Hunk #1 succeeded at 564 (offset 19 lines).
patching file function.c
Hunk #1 succeeded at 1281 with fuzz 2 (offset 85 lines).

I'm running on AIX 5.2.  Are there any other work arounds to this problem?

Craig Jeffree <jeffree>
Fri 25 Oct 2002 09:43:33 PM UTC, comment #1: 

Greg was kind enough to send me a big chunk of his build environment to reproduce this bug, and I produced a fix based on that; I liked Toomas's fix but ended up keeping mine because there were subtle places Toomas's could fail.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Fri 25 Oct 2002 09:34:39 PM UTC, original submission:  

Using $(eval ...) can lead to fatal errors about allocating too much memory, or it can evaluate to a value (the manual says it always evaluates to the empty string).  See:

  e0 = $(foreach s,foobar,$(eval $s:))
  e1 = $(foreach s,foobar, $(eval $s:))

  all: ; @echo e0 == $(e0) e1 == $(e1)

  $ make
  e0 ==  e1 == f

The e0 value is correct, but e1 is wrong.

Greg McGary reported the fatal memory allocation manifestation.

The above manifestation was reported by Toomas Rosin (and he provided a patch).  It's the same bug but this one is easier to reproduce in a bug report :).

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.


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

Attach Files:

Attached Files
file #120:  eval-crash.diff added by psmith (2KiB - application/octet-stream - Patch to fix eval buffer mismanagement.)


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 add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.




Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-04-01 psmith Fixed Release4.0 => 3.81
2002-10-25 psmith StatusNone => (Error - Not Found)
    Open/ClosedOpen => (Error - Not Found)
    Fixed ReleaseNone => (Error - Not Found)

Back to the top

Powered by Savane 3.7