[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #50909] eval_makefile for $(MAKEFILES) doesn't add file name to str

From: enrique olaizola
Subject: [bug #50909] eval_makefile for $(MAKEFILES) doesn't add file name to strcache
Date: Mon, 1 May 2017 23:43:48 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0


                 Summary: eval_makefile for $(MAKEFILES) doesn't add file name
to strcache
                 Project: make
            Submitted by: gnuser17
            Submitted on: Tue 02 May 2017 03:43:47 AM UTC
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: SCM
        Operating System: POSIX-Based
           Fixed Release: None
           Triage Status: None



-- Problem:
When make parses the files form the environment variable MAKEFILES it sets the
associated ebuf.floc.filenm to the string passed in by the caller.

When dealing with files from MAKEFILES, the memory location used to hold the
name of said files is freed prior to executing their commands.

Consequently, when make tries to report error caught during the execution of
one of these files, it looks in ebuf.floc.filenm which points to memory that
has been freed.

-- Solution:
cache the makefile's name before calling eval_makefile

-- How to recreate the issue:
# Assuming you have a file named 'makefile' in the directory you are running
the commands from.
# I have provided the file I used in the attachments.
$- cp makefile m1
$- cp m1 m2
$- export MAKEFILES='makefile m1 m2'
$- make -j4 all

Please see:
  -- makefile: the makefile I used to generate the error and verify the fix
  -- run_*: files to compare the output the user sees pre and post fix
  -- valgrind_*: files to compare the running valgrind on make-4.2.1 pre and
post fix

I've tested this for make-4.2.1 as well as HEAD. 'make check' passes all tests


File Attachments:

Date: Tue 02 May 2017 03:43:47 AM UTC  Name: logs.tar.gz  Size: 2kB   By:

Date: Tue 02 May 2017 03:43:47 AM UTC  Name: makefile  Size: 18B   By:



Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]