Bug #79307 [NEW]: httpd crash when combine strings in php
| From: | idzjy at live dot cn | Date: | Tue, 25 Feb 2020 14:40:19 +0000 |
| Subject: | Bug #79307 [NEW]: httpd crash when combine strings in php | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-225723@lists.php.net to get a copy of this message | ||
From: idzjy at live dot cn
Operating system: Windows 10
PHP version: 7.3.15
Package: Apache2 related
Bug Type: Bug
Bug description:httpd crash when combine strings in php
Description:
------------
when trying to combine thousands of strings using concatenation operator
('.'), httpd crash.
like:
https://github.com/laminas/laminas-validator/blob/master/src/Hostname/Biz.php
https://github.com/laminas/laminas-validator/blob/master/src/Hostname/Cn.php
the php package was downloaded directly from
https://windows.php.net/downloads/releases/php-7.3.15-Win32-VC15-x64.zip
apache version: 2.4.37 on windows with wampserver 3.1.7 64bit.
crash on 7.2.14 / 7.3.9 / 7.3.15, not on 5.6.40 as I tested.
crash on apache, not cli.
// logs
apache log:
[Tue Feb 25 22:04:01.612217 2020] [mpm_winnt:notice] [pid 273704:tid
764] AH00428: Parent: child process 282396 exited with status 3221225725
-- Restarting.
php logs nothing.
Windows Event Viewer:
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2020-02-25T14:03:58.936699400Z" />
<EventRecordID>49477</EventRecordID>
<Channel>Application</Channel>
<Computer>***</Computer>
<Security />
</System>
- <EventData>
<Data>httpd.exe</Data>
<Data>2.4.37.0</Data>
<Data>5bf538f3</Data>
<Data>php7ts.dll</Data>
<Data>7.3.15.0</Data>
<Data>5e4bea74</Data>
<Data>c00000fd</Data>
<Data>0000000000011f92</Data>
<Data>44f1c</Data>
<Data>01d5ebe4613b26c1</Data>
<Data>D:\wamp64\bin\apache\apache2.4.37\bin\httpd.exe</Data>
<Data>D:\wamp64\bin\apache\apache2.4.37\bin\php7ts.dll</Data>
<Data>caca7d2d-d7d9-4478-a028-6429e916ab68</Data>
<Data />
<Data />
</EventData>
</Event>
Test script:
---------------
<?php
// test1.php
$a =
'123456789012345678901234567890' .
'123456789012345678901234567890' .
'123456789012345678901234567890' .
'123456789012345678901234567890';
// ... 2000 lines in total, crash
var_dump($a);
//////////////////////////////////////////////////
<?php
// test2.php
$a =
'123456789012345678901234567890' .
'123456789012345678901234567890' .
'123456789012345678901234567890' .
'123456789012345678901234567890';
// ... 1000 lines in total, ok
$b =
'123456789012345678901234567890' .
'123456789012345678901234567890' .
'123456789012345678901234567890' .
'123456789012345678901234567890';
// ... 1000 lines in total, ok
$c = $a + $b;
var_dump($c);
// everything is fine
//////////////////////////////////////////////////
// same thing happens even if reduce the length of the single string to
'123'.
--
Edit bug report at https://bugs.php.net/bug.php?id=79307&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79307&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79307&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79307&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79307&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79307&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79307&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79307&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79307&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79307&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79307&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79307&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79307&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79307&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79307&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79307&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79307&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79307&r=mysqlcfg