php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73219 acinclude.m4 sed syntax garbled
Submitted: 2016-10-01 17:59 UTC Modified: 2016-11-20 05:53 UTC
From: rainer dot jung at kippdata dot de Assigned: krakjoe (profile)
Status: Closed Package: *Compile Issues
PHP Version: 7.0.11 OS: Solaris, Linux
Private report: No CVE-ID: None
 [2016-10-01 17:59 UTC] rainer dot jung at kippdata dot de
Description:
------------
In acinclude.m4 the following line was introduced by commit

https://github.com/php/php-src/commit/1524e00ccc8d99885dae0a4567b8b45a2ff44ba2#diff-a5522b90382504dc530177f63ced5209

clean_configure_args=$(echo $clean_configure_args | sed -e "s/'$var=$val'//")

If the value of the variable contains a "/" character, this will result in an sed error message, because "/" was chosen as the delimiter. In our case we have CC="gcc -specs=/shared/build/autobuild/specs/specs.solaris" but it can also happen e.g. in CFLAGS, LDFLAGS etc.

Error on Solaris:

sed: command garbled: s/'CC=gcc -specs=/shared/build/autobuild/specs/specs.solaris'//

Error on Linux:

sed: -e expression #1, char 26: unknown option to `s'

The errors happen during configure run for PHP, but also when the configure generated by phpize is being run for an extension.

I suggest to use "#" instead of "/" as delimiter, because it is very unlikely to be part of the variable values.

The problem currently occurs in PHP 7.0 and 7.1, likely also in trunk. The change that causes it has not been backported to 5.6, so no need to fix 5.6.


Patches

aclocal-sed-delim (last revision 2016-10-01 18:00 UTC by rainer dot jung at kippdata dot de)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-01 21:18 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2016-10-01 21:18 UTC] cmb@php.net
Thanks for reporting this issue and providing a patch. I agree,
that `#` is preferable over `/`.

However, I'm puzzled because the commit you've mentioned appears
to be in PHP-7.0 only, even though `git branch --contains` says
it's in 7.0, 7.1 and master, and there appears to be no commit
afterwards which reverts the commit or modifies the change.
 [2016-10-01 21:18 UTC] cmb@php.net
-Package: Unknown/Other Function +Package: *Compile Issues
 [2016-10-01 22:44 UTC] rainer dot jung at kippdata dot de
You are right, this is in PHP 7.0 only. Nor in 5.6, neither in 7.1 or trunk.
 [2016-10-02 08:39 UTC] cmb@php.net
-Assigned To: +Assigned To: krakjoe
 [2016-10-02 08:39 UTC] cmb@php.net
Thanks for the confirmation, Rainer.

Joe, can you please have a look at this issue?
 [2016-11-20 05:41 UTC] krakjoe@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=274951a4a2a2c5023d9bfd2e8032d64131e38225
Log: Fix #73219 (fix acinclude when / is present)
 [2016-11-20 05:41 UTC] krakjoe@php.net
-Status: Verified +Status: Closed
 [2016-11-20 05:42 UTC] krakjoe@php.net
I have no idea what is going on with the git log, or why the commit is missing from 7.1

Supplied patch used for 7.0

Not sure what to do about 7.1 and master, I'm absolutely sure I committed there too ...

Anyone with very strong git fu able to find out possibly ?
 [2016-11-20 05:53 UTC] krakjoe@php.net
I think the original patch should have targetted aclocal.m4, not acinclude.

I'm going to find out what to do about it ...
 [2016-11-20 07:53 UTC] laruence@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=274951a4a2a2c5023d9bfd2e8032d64131e38225
Log: Fix #73219 (fix acinclude when / is present)
 [2016-11-20 08:34 UTC] krakjoe@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f67784907e2a4b39b47a4e05d8dfd315cd7ee616
Log: fix #72180, #73219
 [2016-11-20 08:34 UTC] krakjoe@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f67784907e2a4b39b47a4e05d8dfd315cd7ee616
Log: fix #72180, #73219
 [2016-11-22 13:14 UTC] krakjoe@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f67784907e2a4b39b47a4e05d8dfd315cd7ee616
Log: fix #72180, #73219
 [2016-11-22 13:14 UTC] krakjoe@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=274951a4a2a2c5023d9bfd2e8032d64131e38225
Log: Fix #73219 (fix acinclude when / is present)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 14:01:28 2024 UTC