Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Aug 2011 21:12:23 GMT
From:      Stefano Lattarini <stefano.lattarini@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/159730: make(1) in parallel mode fails report failure of @-prefixed recipe using "set +e"
Message-ID:  <201108122112.p7CLCN51003786@red.freebsd.org>
Resent-Message-ID: <201108122120.p7CLKANR056829@freefall.freebsd.org>

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

>Number:         159730
>Category:       bin
>Synopsis:       make(1) in parallel mode fails report failure of @-prefixed recipe using "set +e"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 12 21:20:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Stefano Lattarini
>Release:        8.2-RELEASE
>Organization:
>Environment:
FreeBSD bigio.localdomain 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
When used in parallel mode ("make -jN ..."), FreeBSD make sometimes
report successful exit status from recipes that should fail, in case
such recipes are prefixed with `@' and unset the `errexit' shell flag.

Example:

 $ echo 'all: ; @set +e; false' | make -j2 -f-; echo status: $?
 status: 0

I found this problem while testing Automake; see automake bug#9245:

 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9245>;

This issue causes automake-generated Makefiles using the newer parallel-tests harness to always report success if run with "make -jN check"; a really nasty case of spurious success IMHO, which caused me to label this bug as "serious".
>How-To-Repeat:
Here is how to reproduce the issue:

 $ echo 'all: ; @set +e; false' | make -j2 -f-; echo status: $?
 status: 0

Notice that all of `-j', `@' and `set +e' seems to be required to trigger the bug:

 $ echo 'all: ; set +e; false' | make -j2 -f-
 set +e; false
 *** Error code 1
 1 error

 $ echo 'all: ; @false' | make -j2 -f-
 *** Error code 1
 1 error

 $ echo 'all: ; @set +e; false' | make -f-
 *** Error code 1
 Stop in /tmp.


>Fix:


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



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