[Dropping bug-autom...@gnu.org] Hi Eric. Thanks for the review.
At Friday 06 August 2010, Eric Blake wrote: > On 08/05/2010 04:44 PM, Stefano Lattarini wrote: > >> Thanks for the report. A segfault in make is always a bug in > >> the make implementation. If we can easily find out what makes > >> it fail, and can easily and reliably work around it, then let's > >> maybe consider it, but otherwise let's not bother. > > > > The attached patch does the fix. It's basically just a one-liner > > with a two-line comment. I think we should apply it, since > > Automake already contains tons of uglier and much more > > cumbersome workarounds. > > Won't work. > > + done | tr '\012\015' ' ' | sed 's/ *$$//'`; > > sed requires text input (aka a trailing newline), but the tr > produced non-text output by converting to spaces. Ouch. It doesn't work even with native Solaris sed! I really should have known better :-( > You'd need something like: > done | { tr '\012\015' ' '; echo; } | sed 's/ *$$//' A little ugly... I prefer to be more explicit and clear, at the cost of a couple of more forks. An updated patch is attached. More reviews are welcome! Regards, Stefano
From 92020702ac9b8cde2ecfa248b5d34795d7209e44 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Fri, 6 Aug 2010 00:40:55 +0200 Subject: [PATCH] Work around a nasty bug (segfault) of Solaris make. * lib/am/check.am (recheck, recheck-html): Trim trailing spaces from $list, to avoid triggering a nasty bug (potential segfault) on Solaris make. --- ChangeLog | 7 +++++++ lib/Automake/tests/Makefile.in | 1 + lib/am/check.am | 3 +++ tests/Makefile.in | 1 + 4 files changed, 12 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ed00c6..590519f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-08-06 Stefano Lattarini <stefano.lattar...@gmail.com> + + Work around a nasty bug (segfault) of Solaris make. + * lib/am/check.am (recheck, recheck-html): Trim trailing spaces + from $list, to avoid triggering a nasty bug (potential segfault) + on Solaris make. + 2010-07-31 Ralf Wildenhues <ralf.wildenh...@gmx.de> Add example git work flow; discuss merge --log in HACKING. diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index 4ed8c1e..34e58db 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -465,6 +465,7 @@ recheck recheck-html: case $$line in FAIL*|XPASS*) echo $$f;; esac; \ else echo $$f; fi; \ done | tr '\012\015' ' '`; \ + list=`echo "$$list" | sed 's/ *$$//'`; \ $(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) TEST_LOGS="'"$$list"'"' .pl.log: @p='$<'; $(am__check_pre) $(PL_LOG_COMPILE) "$$tst" $(am__check_post) diff --git a/lib/am/check.am b/lib/am/check.am index 755bf13..e519391 100644 --- a/lib/am/check.am +++ b/lib/am/check.am @@ -291,6 +291,9 @@ recheck recheck-html: case $$line in FAIL*|XPASS*) echo $$f;; esac; \ else echo $$f; fi; \ done | tr '\012\015' ' '`; \ +## This apparently useless munging helps to avoid a nasty bug (a +## segmentation fault!) on Solaris XPG4 make. + list=`echo "$$list" | sed 's/ *$$//'`; \ $(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) TEST_LOGS="'"$$list"'"' .PHONY: recheck recheck-html diff --git a/tests/Makefile.in b/tests/Makefile.in index 09da716..7bcb0c4 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1221,6 +1221,7 @@ recheck recheck-html: case $$line in FAIL*|XPASS*) echo $$f;; esac; \ else echo $$f; fi; \ done | tr '\012\015' ' '`; \ + list=`echo "$$list" | sed 's/ *$$//'`; \ $(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) TEST_LOGS="'"$$list"'"' .test.log: @p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post) -- 1.7.1