ports/74879: gmake gives a segfault when $(eval ...) has a large argument
rizzo at icir.org
Thu Dec 9 00:30:25 UTC 2004
>Synopsis: gmake gives a segfault when $(eval ...) has a large argument
>Arrival-Date: Thu Dec 09 00:30:24 GMT 2004
>Originator: Luigi Rizzo
>Release: FreeBSD 4.10-RELEASE i386
Univ. di Pisa
System: FreeBSD xorpc.icir.org 4.10-RELEASE FreeBSD 4.10-RELEASE #0: Wed Sep 29 15:52:11 PDT 2004 root at xorpc.icir.org:/scratch/xorpc/u3/obj/usr/src/sys/ICIR-4.10 i386
gmake 3.80 on FreeBSD seems to have problems in handling $(eval ...)
with large (~200 chars) arguments, see the test case below which
is a largely reduced case from some actual makefiles I had.
The same on linux works fine.
I did a bit of investigation, and gdb on the core file reports bogus
pointers way before the actual stack frame where the program crashes,
and the strings that cause the problem are not large enough to
suggest that some arbitrary limit is hit in memory allocators etc.
Maybe some weird string library function does have small limits,
or that gmake is actually buggy by itself and the bug is only masked
create a file, say test.mk, with this content:
#------------- cut here ---------------------
FILES := \
# gmake bug
$(eval FOO : $(FILES))
#------------- end of file ---------------------
and then run
gmake -f test.mk
which should give you a nice
Segmentation fault (core dumped)
unknown. Have seen this with gmake 3.80, 3.80_1 and 3.80_2
on various versions of 4.x (4.8 4.9 4.10).
More information about the freebsd-ports-bugs