Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1151238

Summary: gettext causes m4 to consume infinite memory on util-linux configure.ac
Product: [Fedora] Fedora Reporter: Eric Blake <eblake>
Component: gettextAssignee: Daiki Ueno <dueno>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: dueno, i18n-bugs, petersen, praiskup
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gettext-0.18.3.2-2.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-18 16:58:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eric Blake 2014-10-09 21:05:57 UTC
Description of problem:
In 0.18, gettext switched from using grep to using autom4te to probe the values of certain macros in configure.ac.  However, the conversion is flawed, and can lead to an attempt to run 'autopoint' or 'gettextize' invoking an m4 process with an infinite memory expansion on some configure.ac.  In particular, this was reported on the debian list when trying to build util-linux 2.20.1:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764580

Version-Release number of selected component (if applicable):
gettext-devel-0.18.3.2-1.fc20.x86_64

How reproducible:
100%

Steps to Reproduce:
1. git clone git://git.debian.org/git/collab-maint/pkg-util-linux.git util-linux
2. cd util-linux
3. git checkout v2.20.1
4. autopoint --force

Actual results:
m4 becomes a memory hog

Expected results:
the operation completes quickly

Additional info:
patch proposed:

diff --git i/gettext-tools/misc/autopoint.in
w/gettext-tools/misc/autopoint.in
index c31943f..87ee374 100644
--- i/gettext-tools/misc/autopoint.in
+++ w/gettext-tools/misc/autopoint.in
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 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
@@ -143,14 +143,14 @@ fi
 func_trace_autoconf ()
 {
   echo '\
-dnl disable macros which may abort autom4te
-m4_undefine([m4_assert])
-m4_undefine([m4_fatal])
-m4_undefine([m4_warn])
-m4_undefine([m4_errprintn])
-m4_undefine([m4_exit])
-m4_undefine([m4_include])
-m4_undefine([m4_esyscmd])
+dnl replace macros which may abort autom4te with a no-op variant
+m4_pushdef([m4_assert])
+m4_pushdef([m4_fatal])
+m4_pushdef([m4_warn])
+m4_pushdef([m4_errprintn])
+m4_pushdef([m4_exit])
+m4_pushdef([m4_include])
+m4_pushdef([m4_esyscmd])
 ' \
   | "$AUTOM4TE" --no-cache --language=Autoconf-without-aclocal-m4 \
     --trace="$1":\$% - "$2" 2>/dev/null
diff --git i/gettext-tools/misc/gettextize.in
w/gettext-tools/misc/gettextize.in
index dbe4d1e..33299b9 100644
--- i/gettext-tools/misc/gettextize.in
+++ w/gettext-tools/misc/gettextize.in
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Copyright (C) 1995-1998, 2000-2013 Free Software Foundation, Inc.
+# Copyright (C) 1995-1998, 2000-2014 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
@@ -143,14 +143,14 @@ fi
 func_trace_autoconf ()
 {
   echo '\
-dnl disable macros which may abort autom4te
-m4_undefine([m4_assert])
-m4_undefine([m4_fatal])
-m4_undefine([m4_warn])
-m4_undefine([m4_errprintn])
-m4_undefine([m4_exit])
-m4_undefine([m4_include])
-m4_undefine([m4_esyscmd])
+dnl replace macros which may abort autom4te with a no-op variant
+m4_pushdef([m4_assert])
+m4_pushdef([m4_fatal])
+m4_pushdef([m4_warn])
+m4_pushdef([m4_errprintn])
+m4_pushdef([m4_exit])
+m4_pushdef([m4_include])
+m4_pushdef([m4_esyscmd])
 ' \
   | "$AUTOM4TE" --no-cache --language=Autoconf-without-aclocal-m4 \
     --trace="$1":\$% - "$2" 2>/dev/null

Comment 1 Fedora Update System 2014-10-10 04:50:16 UTC
gettext-0.18.3.2-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/gettext-0.18.3.2-2.fc20

Comment 2 Fedora Update System 2014-10-11 06:57:04 UTC
Package gettext-0.18.3.2-2.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gettext-0.18.3.2-2.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-12628/gettext-0.18.3.2-2.fc20
then log in and leave karma (feedback).

Comment 3 Fedora Update System 2014-10-15 06:58:24 UTC
gettext-0.19.2-5.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/gettext-0.19.2-5.fc21

Comment 4 Fedora Update System 2014-10-18 16:58:46 UTC
gettext-0.18.3.2-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2014-11-01 16:26:09 UTC
gettext-0.19.2-5.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.