Bug #64934 [NEW]: Apache2 with php5apache2_4.dll crash when use get_browser()
From: 37xzxz at gmail dot com
Operating system: Win 7 x64 SP1, WinServ 2008 R2
PHP version: 5.4Git-2013-05-27 (snap)
Package: Apache2 related
Bug Type: Bug
Bug description:Apache2 with php5apache2_4.dll crash when use get_browser()
Description:
------------
Tested on php-5.4.15-Win32-VC9-x86 and 5.4.17-dev snapshot
(http://windows.php.net/downloads/snaps/php-5.4/rbcdac75/php-5.4-ts-windows-vc9-
x86-rbcdac75.zip)
Apache2 crashes when code contain get_browser() and script called multiply
times in parallel.
[mpm_winnt:notice] [pid 3684:tid 440] AH00428: Parent: child process 4032
exited
with status 3221225477 -- Restarting.
I perfom search in Google and find this
http://stackoverflow.com/questions/1138269/apache-error-notice-parent-child-
process-exited-with-status-3221225477-res
pylon said: "I just figured it out that the get_browser() function gives a
memory error sometimes".
So I perfom tests part of code with get_browser() only and reproduce
crashes.
Test script:
---------------
test.php contain code:
<?php
echo $_SERVER[ 'HTTP_USER_AGENT' ] . ' '. time() . "\n";
$browser = get_browser( $_SERVER[ 'HTTP_USER_AGENT' ] );
?>
test_get_browser.php on other server
<?php
set_time_limit( 0 );
$opts = array(
'http' => array(
'method' => "GET",
'header' => "User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64)
AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64
Safari/537.31\r\n",
),
);
$context = stream_context_create( $opts );
$url = 'http://testserver/test.php';
for( $i = 0; $i < 10000; $i++ ) {
$data = file_get_contents( $url, false, $context );
echo $data;
}
?>
Run few copies of test_get_browser.php to emulate many clients.
Expected result:
----------------
No crashes, all requests will be served normally.
Actual result:
--------------
Apache2 crashes when I call 2-7 copies of test_get_browser.php.
Thread 11 - System ID 4556
Entry point libhttpd!ap_regkey_value_remove+1060
Create time 28.05.2013 11:02:43
Time spent in user mode 0 Days 0:0:0.62
Time spent in kernel mode 0 Days 0:0:0.0
Full Call Stack
Function Arg 1 Arg 2 Arg 3 Arg 4 Source
ntdll!NtRaiseException+12 0c58eeec 0c58ef3c 00000000
c0000005
ntdll!KiUserExceptionDispatcher+29 0c58eeec 0c58ef3c 00000000
c0000005
Exception Information
PHP5TS!_ZVAL_PTR_DTOR+3C8In
httpd__PID__9884__Date__05_28_2013__Time_11_02_44AM__426__Second_Chance_Exceptio
n_C0000005.dmp the assembly instruction at php5ts!_zval_ptr_dtor+3c8 in
C:\dev\php-5.4.15-Win32-VC9-x86\php5ts.dll from The PHP Group has caused an
access violation exception (0xC0000005) when trying to read from memory
location
0x0e6dc8a4 on thread 11
Same code work fine on Ubuntu 12.04, I can't find any errors in logs.
--
Edit bug report at https://bugs.php.net/bug.php?id=64934&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64934&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64934&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64934&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64934&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64934&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64934&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64934&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64934&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64934&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64934&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=64934&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=64934&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64934&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64934&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64934&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64934&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64934&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64934&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64934&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64934&r=mysqlcfg
Thread (11 messages)
- 37xzxz at gmail dot com
- 37xzxz at gmail dot comBug #64934 [Opn]: Apache2 with php5apache2_4.dll crash when use get_browser()
- pajoye@php.netBug #64934 [Opn->Asn]: Apache2 with php5apache2_4.dll crash when use get_browser()
- ab@php.netBug #64934 [Asn]: Apache2 with php5apache2_4.dll crash when use get_browser()
- 37xzxz at gmail dot comBug #64934 [Asn]: Apache2 with php5apache2_4.dll crash when use get_browser()
- ab@php.netBug #64934 [Asn->Ver]: Apache2 with php5apache2_4.dll crash when use get_browser()
- ab@php.netBug #64934 [Ver]: Apache2 with php5apache2_4.dll crash when use get_browser()
- 37xzxz at gmail dot comBug #64934 [Ver]: Apache2 with php5apache2_4.dll crash when use get_browser()
- ab@php.netBug #64934 [Ver->Csd]: Apache2 with php5apache2_4.dll crash when use get_browser()
- ab@php.netBug #64934 [Csd]: Apache2 with php5apache2_4.dll crash when use get_browser()
- 37xzxz at gmail dot comBug #64934 [Com]: Apache2 with php5apache2_4.dll crash when use get_browser()