bugmake - Bugs: bug #54549, Segfault caused by makefile in...

 
 

bug #54549: Segfault caused by makefile in make version 4.2.1

Submitted by:  None
Submitted on:  Tue 21 Aug 2018 10:19:50 PM UTC  
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  Paul D. Smith <psmith> Open/Closed:  Closed
Component Version:  4.2.1 Operating System:  None
Fixed Release:  4.3 Triage Status:  None

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Sun 19 May 2019 11:52:42 PM UTC, comment #2: 

Fixed.  In this interesting situation we were merging two sets of variables, one of which was actually a subset of the other.  Then we'd free one which freed part of the other as well.  Check for this situation.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Tue 21 Aug 2018 10:47:12 PM UTC, comment #1: 

Reproduced in yesterday's (or so) git:

(gdb) bt
#0  __memcmp_sse4_1 () at ../sysdeps/x86_64/multiarch/memcmp-sse4.S:62
#1  0x0000000000411468 in hash_find_slot (ht=ht@entry=0x124d550, key=key@entry=0x1248820) at src/hash.c:108
#2  0x0000000000423ea6 in merge_variable_sets (from_set=<optimized out>, from_set=<optimized out>, to_set=0x124d550) at src/variable.c:767
#3  merge_variable_set_lists (setlist0=setlist0@entry=0x1248260, setlist1=0x6334d0 <global_setlist>) at src/variable.c:804
#4  0x000000000040c600 in rehash_file (from_file=<optimized out>, to_hname=0x123ddf0 "libcat.a") at src/file.c:307
#5  0x000000000041f5f9 in f_mtime (file=file@entry=0x1247d20, search=search@entry=1) at src/remake.c:1359
#6  0x000000000042001c in check_dep (file=0x1247d20, depth=2, depth@entry=1, this_mtime=this_mtime@entry=1, must_make_ptr=must_make_ptr@entry=0x7fff43f2c6ac) at src/remake.c:1026
#7  0x0000000000420770 in update_file_1 (depth=<optimized out>, file=0x1247dc0) at src/remake.c:572
#8  update_file (file=file@entry=0x1247dc0, depth=<optimized out>) at src/remake.c:336
#9  0x00000000004217df in update_goal_chain (goaldeps=<optimized out>) at src/remake.c:151
#10 0x0000000000407cc5 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at src/main.c:2586
(gdb)

Martin Dorey <mdorey>
Tue 21 Aug 2018 10:19:50 PM UTC, original submission:  

The following makefile causes a segfault in version 4.2.1
it doesnt seem reproducible in 4.1, havent tried for any other versions.

foo: -lcat

# Removing second expansion prevents segfault
.SECONDEXPANSION:
foo: $$@.o;

# Having an empty command here prevents segfault unless,
# the environment is empty. `env -i make foo`
# MFLAGS=-w or MAKEFLAGS=-w `env MFLAGS=-w make foo`
# libcat.a target calls an extra command, `@true \n @touch $@`
# odd.
%.o:
        @true

# Having an empty command prevents segfault.
-l%: lib%.a
        @true

# Not creating libcat.a here prevents segfault,
libcat.a:
        @touch $@

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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 mdorey (Posted a comment)
  •  

    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
    2019-05-19 psmith StatusNone => Fixed
        Assigned toNone => psmith
        Open/ClosedOpen => Closed
        Fixed ReleaseNone => 4.3

    Back to the top


    Powered by Savane 3.7