From owner-freebsd-bugs@FreeBSD.ORG Thu May 22 10:10:00 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3DCAE4F for ; Thu, 22 May 2014 10:10:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80D612080 for ; Thu, 22 May 2014 10:10:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MAA0LP017939 for ; Thu, 22 May 2014 10:10:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4MAA012017938; Thu, 22 May 2014 10:10:00 GMT (envelope-from gnats) Resent-Date: Thu, 22 May 2014 10:10:00 GMT Resent-Message-Id: <201405221010.s4MAA012017938@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Petr Lampa Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DECEBC6F for ; Thu, 22 May 2014 10:01:54 +0000 (UTC) Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B285D2018 for ; Thu, 22 May 2014 10:01:54 +0000 (UTC) Received: from cgiserv.freebsd.org ([127.0.1.6]) by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MA1sG2051677 for ; Thu, 22 May 2014 10:01:54 GMT (envelope-from nobody@cgiserv.freebsd.org) Received: (from nobody@localhost) by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s4MA1sE5051676; Thu, 22 May 2014 10:01:54 GMT (envelope-from nobody) Message-Id: <201405221001.s4MA1sE5051676@cgiserv.freebsd.org> Date: Thu, 22 May 2014 10:01:54 GMT From: Petr Lampa To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: bin/190100: make core dump at syntax error X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 10:10:00 -0000 >Number: 190100 >Category: bin >Synopsis: make core dump at syntax error >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu May 22 10:10:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Petr Lampa >Release: 9.2-STABLE >Organization: BUT FIT >Environment: FreeBSD xxx 9.3-PRERELEASE FreeBSD 9.3-PRERELEASE #1 r266496: Wed May 21 17:47:04 CEST 2014 xxxx:/usr/obj/usr/src/sys/xxx amd64 >Description: make core dumps with this invalid Makefile (notice two && operators): OSVERSION=901500 . if ${OSVERSION} >= 901500 && && (${ARCH} == i386 || ${ARCH} == amd64) . endif (gdb) where #0 0x0000000000448d8c in kill () #1 0x0000000000447bd8 in abort () #2 0x0000000000403197 in Cond_If ( line=0x80085de05 "${OSVERSION} >= 901500 && && (${ARCH} == i386 || ${ARCH} == amd64)", code=, lineno=2) at /usr/src/usr.bin/make/cond.c:1079 #3 0x000000000040d64c in Parse_File (name=, stream=) at /usr/src/usr.bin/make/parse.c:2366 #4 0x000000000040a274 in ReadMakefile (p=) at /usr/src/usr.bin/make/main.c:323 #5 0x000000000040a328 in TryReadMakefile (p=0x80081a1b0 "Makefile") at /usr/src/usr.bin/make/main.c:342 #6 0x000000000040a879 in main (argc=3, argv=0x7fffffffea90) at /usr/src/usr.bin/make/main.c:1185 It seems that current token from CondE(TRUE) is And and this is not handled correctly in switch() at line 1061. Perhaps any unexpected token can be here? >How-To-Repeat: >Fix: remove default: block and change case Err: to default: switch (CondE(TRUE)) { case True: if (CondToken(TRUE) != EndOfFile) goto err; value = TRUE; break; case False: if (CondToken(TRUE) != EndOfFile) goto err; value = FALSE; break; default: err: Parse_Error(PARSE_FATAL, "Malformed conditional (%s)", line); return; } With this change it correctly reports: "Makefile", line 2: Malformed conditional ... >Release-Note: >Audit-Trail: >Unformatted: