Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Dec 2004 16:23:39 -0800 (PST)
From:      Luigi Rizzo <rizzo@icir.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/74879: gmake gives a segfault when $(eval ...) has a large argument
Message-ID:  <200412090023.iB90NdJk050328@xorpc.icir.org>
Resent-Message-ID: <200412090030.iB90UP59036332@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         74879
>Category:       ports
>Synopsis:       gmake gives a segfault when $(eval ...) has a large argument
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 09 00:30:24 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Luigi Rizzo
>Release:        FreeBSD 4.10-RELEASE i386
>Organization:
Univ. di Pisa
>Environment:
System: FreeBSD xorpc.icir.org 4.10-RELEASE FreeBSD 4.10-RELEASE #0: Wed Sep 29 15:52:11 PDT 2004 root@xorpc.icir.org:/scratch/xorpc/u3/obj/usr/src/sys/ICIR-4.10 i386


>Description:
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
on linux.

>How-To-Repeat:

create a file, say test.mk, with this content:
#------------- cut here ---------------------
FILES := \
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.c \
        baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.c \
        caaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.c \
        daaaaaaaaa.c xx.c

# 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)


>Fix:

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).


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412090023.iB90NdJk050328>