automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.3


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.3-827-g6154da4
Date: Sun, 16 Sep 2012 07:06:21 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=6154da4d88442ffcbd3423a71d632b5a4a547878

The branch, ng/master has been updated
       via  6154da4d88442ffcbd3423a71d632b5a4a547878 (commit)
       via  3df45147622a2b74c45d6bbf6c9db7764b3c40d7 (commit)
       via  3f4efa6005407ffdb703dc9896bc7e598cdc4201 (commit)
       via  b959e404ba3aaef7f288b15f620db3d8dc149682 (commit)
      from  6bdbca382bfdea2304ef3947c805c9004b096b39 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6154da4d88442ffcbd3423a71d632b5a4a547878
Author: Stefano Lattarini <address@hidden>
Date:   Mon Sep 10 17:36:38 2012 +0200

    built sources: avoid fork bomb in $(BUILT_SOURCES) handling
    
    Due to how the handling of $(BUILT_SOURCES) was implemented in Automake-NG,
    a recursive make call in the recipe of any $(BUILT_SOURCES) (or of any of
    its prerequisites) would have caused an infinite recursion (complete with
    fork bomb, yuck).  Work around the issue.
    
    See:
    <http://lists.gnu.org/archive/html/help-smalltalk/2012-08/msg00027.html>
    <http://lists.gnu.org/archive/html/automake-patches/2012-08/msg00052.html>
    
    * lib/am/common-targets.mk: Here, with the help of ...
    (am.hack.making-built-sources): ... this new internal variable.
    * Makefile.am (XFAIL_TESTS): Remove 't/built-sources-fork-bomb.sh'.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 3df45147622a2b74c45d6bbf6c9db7764b3c40d7
Author: Stefano Lattarini <address@hidden>
Date:   Mon Sep 10 13:47:44 2012 +0200

    coverage: expose fork bomb in $(BUILT_SOURCES) handling
    
    Due to how the handling of $(BUILT_SOURCES) is implemented in Automake-NG,
    a recursive make call in the recipe of any $(BUILT_SOURCES) (or of any of
    its prerequisites) will cause an infinite recursion (complete with fork
    bomb, yuck).  Expose the issue in a test case (still failing, of course).
    
    See:
    <http://lists.gnu.org/archive/html/help-smalltalk/2012-08/msg00027.html>
    <http://lists.gnu.org/archive/html/automake-patches/2012-08/msg00052.html>
    
    * t/built-sources-fork-bomb.sh: New test.
    * Makefile.am (XFAIL_TESTS): Add it.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 3f4efa6005407ffdb703dc9896bc7e598cdc4201
Author: Stefano Lattarini <address@hidden>
Date:   Tue Sep 11 10:29:35 2012 +0200

    config headers: avoid extra make recursion
    
    * lib/am/remake-hdr.am (%CONFIG_H%). By rewriting its recipe to
    duplicate the '%STAMP%' recipe a little.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit b959e404ba3aaef7f288b15f620db3d8dc149682
Author: Stefano Lattarini <address@hidden>
Date:   Mon Sep 10 12:57:47 2012 +0200

    cosmetics: remove stray copyright notice excerpt
    
    * lib/am/common-targets.mk: Here.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 lib/am/common-targets.mk     |   10 +++++-
 lib/am/remake-hdr.am         |    9 +++--
 t/built-sources-fork-bomb.sh |   69 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 82 insertions(+), 6 deletions(-)
 create mode 100755 t/built-sources-fork-bomb.sh

diff --git a/lib/am/common-targets.mk b/lib/am/common-targets.mk
index ec7fbc2..da8e16c 100644
--- a/lib/am/common-targets.mk
+++ b/lib/am/common-targets.mk
@@ -48,8 +48,6 @@ check-am: $(am.test-suite.check-targets)
 $(am.test-suite.check-targets): all-am $(am.test-suite.deps)
 
 check: $(if $(SUBDIRS),check-recursive,check-am)
-## You should have received a copy of the GNU General Public License
-## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## ----------------------------------------- ##
 ## installdirs -- Creating the installdirs.  ##
@@ -161,8 +159,16 @@ ifeq ($(am.make.dry-run),true)
 # completely accurate.
 all check install: | $(am.built-early)
 else
+# Also, with this implementation, a recursive make call in the recipe
+# of any $(BUILT_SOURCES) (or any of its prerequisites) could cause an
+# infinite recursion (complete with fork bomb, yuck), if we are not
+# careful.  The following hack takes care of the problem.
+$(am.built-early): am.hack.making-built-sources = yes
+export am.hack.making-built-sources
+ifndef am.hack.making-built-sources
 $(foreach x,$(am.built-early),$(eval -include .am/built-sources/$(x)))
 .am/built-sources/%: | %
        @$(am.cmd.ensure-target-dir-exists)
        @touch $@
 endif
+endif
diff --git a/lib/am/remake-hdr.am b/lib/am/remake-hdr.am
index 665b343..cf4f013 100644
--- a/lib/am/remake-hdr.am
+++ b/lib/am/remake-hdr.am
@@ -15,10 +15,11 @@
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 %CONFIG_H%: %STAMP%
-## Recover from removal of config headers.  Break up in two invocations
-## so that "make -n" is properly honored.
-       @test -f $@ || rm -f %STAMP%
-       @test -f $@ || $(MAKE) %STAMP%
+## Recover from removal of config headers.  This is duplicated with the
+## '%STAMP%' rule below, but allow us to avoid a (potentially costly)
+## make recursion.
+       $(if $(wildcard $@),,@rm -f %STAMP%)
+       $(if $(wildcard $@),,cd $(top_builddir) && $(SHELL) ./config.status 
%CONFIG_H_PATH%)
 
 %STAMP%: %CONFIG_H_DEPS% $(top_builddir)/config.status
        @rm -f %STAMP%
diff --git a/t/built-sources-fork-bomb.sh b/t/built-sources-fork-bomb.sh
new file mode 100755
index 0000000..8279704
--- /dev/null
+++ b/t/built-sources-fork-bomb.sh
@@ -0,0 +1,69 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Due to how the handling of $(BUILT_SOURCES) is implemented in Automake-NG,
+# a recursive make call in the recipe of any $(BUILT_SOURCES) (or of any of
+# its prerequisites) might cause an infinite recursion (complete with fork
+# bomb, yuck) if not handled correctly.  Verify that this doesn't happen.
+# For more background, see:
+# <http://lists.gnu.org/archive/html/help-smalltalk/2012-08/msg00027.html>
+# <http://lists.gnu.org/archive/html/automake-patches/2012-08/msg00052.html>
+
+. ./defs || exit 1
+
+echo AC_OUTPUT >> configure.ac
+
+cat > Makefile.am << 'END'
+BUILT_SOURCES = foo
+.PHONY: build-foo
+build-foo:
+       echo OK > foo
+foo:
+       $(MAKE) build-foo
+
+# If the bug is still present, we want this test to fail, not to actually
+# go fork bomb and potentially crash the user machine.  Take care of that.
+
+is_too_deep := $(shell test $(MAKELEVEL) -lt 10 && echo no)
+
+## Extra indentation here required to avoid confusing Automake.
+## FIXME: now that we assume make is GNU make, this shouldn't happen!
+ ifeq ($(is_too_deep),no)
+   # All is ok.
+ else
+   $(error ::OOPS:: Recursion too deep, $(MAKELEVEL) levels)
+ endif
+END
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+
+$MAKE -n foo >output 2>&1 || { cat output; exit 1; }
+cat output
+test ! -f foo
+# Guard against possible infinite recursion.
+$FGREP '::OOPS::' output && exit 1
+
+$MAKE foo >output 2>&1 || { cat output; exit 1; }
+cat output
+$MAKE foo
+# Guard against possible infinite recursion.
+$FGREP '::OOPS::' output && exit 1
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]