Discussion:
[bug #54549] Segfault caused by makefile in make version 4.2.1
anonymous
2018-08-21 22:19:51 UTC
Permalink
URL:
<http://savannah.gnu.org/bugs/?54549>

Summary: Segfault caused by makefile in make version 4.2.1
Project: make
Submitted by: None
Submitted on: Tue 21 Aug 2018 10:19:50 PM UTC
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Component Version: 4.2.1
Operating System: None
Fixed Release: None
Triage Status: None

_______________________________________________________

Details:

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 $@







_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?54549>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
Martin Dorey
2018-08-21 22:47:13 UTC
Permalink
Follow-up Comment #1, bug #54549 (project make):

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=***@entry=0x124d550,
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=***@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=***@entry=0x1247d20,
search=***@entry=1) at src/remake.c:1359
#6 0x000000000042001c in check_dep (file=0x1247d20, depth=2, ***@entry=1,
this_mtime=***@entry=1,
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=***@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)



_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?54549>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Loading...