bugmake - Bugs: bug #25697, Segmentation fault setting...

 
 

bug #25697: Segmentation fault setting .DEFAULT_GOAL

Submitter:  None
Submitted:  Tue 24 Feb 2009 10:00:22 PM UTC
Votes: 1
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.81 Operating System:  POSIX-Based
Fixed Release:  3.82 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 01 Jun 2009 02:29:00 AM UTC, comment #2: 

The issue here is by doing this:

.DEFAULT_GOAL := $(myDefaultGoal)  #restore the previous default rule

you are actually setting the .DEFAULT_GOAL variable to contain a single space rather than an empty string--make always preserves all TRAILING whitespace after a value, so any space between the value and a comment, for example, is included in the value.

Obviously make should not crash even so, and I've fixed this bug; now you'll get:

make: * No targets.  Stop.

I also noticed make wasn't expanding this variable before use, which is wrong.  Fixed that too.

Paul D. Smith <psmith>
Group administrator
Wed 25 Feb 2009 02:16:34 AM UTC, comment #1: 

Can reproduce with latest make from CVS.  ns is null at the penultimate line:

2175                 /* In case user set .DEFAULT_GOAL to a non-existent target
2176                    name let's just enter this name into the table and let
2177                    the standard logic sort it out. */
2178                 if (default_goal_file == 0)
2179                   {
2180                     struct nameseq *ns;
2181                     char *p = *default_goal_name;
2182
2183                     ns = multi_glob (
2184                       parse_file_seq (&p, '\0', sizeof (struct nameseq), 1),
2185                       sizeof (struct nameseq));
2186
2187                     /* .DEFAULT_GOAL should contain one target. */
2188                     if (ns->next != 0)
2189                       fatal (NILF, _(".DEFAULT_GOAL contains more than one target"));

Martin Dorey <mdorey>
Tue 24 Feb 2009 10:00:22 PM UTC, original submission:  

The attached makefile causes a segmentation fault which seems to be due the line:

.DEFAULT_GOAL := $(myDefaultGoal)

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #17526:  test.mak added by None (233B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by jbezem (Voted in favor of this item)
  • -email is unavailable- added by mdorey (Posted a comment)
  •  

    There is 1 vote 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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-07-28 psmith Fixed Release4.0 3.82
    2009-06-01 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.0
    2009-04-16 jbezem Carbon-Copy- Added jbezem
    2009-02-24 None Attached File- Added test.mak, #17526

    Back to the top

    Powered by Savane 3.14-3b9d.
    Corresponding source code