php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39221 php5ts.dll faulting every few minutes on apache2.2
Submitted: 2006-10-21 11:13 UTC Modified: 2006-10-31 01:00 UTC
Votes:32
Avg. Score:4.7 ± 0.6
Reproduced:29 of 30 (96.7%)
Same Version:14 (48.3%)
Same OS:21 (72.4%)
From: kris at k-software dot org Assigned:
Status: No Feedback Package: Apache2 related
PHP Version: 5CVS-2006-10-20 (snap) OS: windows server 2003 x64
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-10-21 11:13 UTC] kris at k-software dot org
Description:
------------
Since my win2k3(x64) server rebooted after applying windows update patches on 16/10/06 my apache process has been having problems with the php5ts.dll. 

Apache's log says "[notice] Parent: child process exited with status 2147483651 -- Restarting", and I get an application error (See below)

This occurs frequently (at least once every 10 minutes on a live production machine), and I am unable to trace any specific PHP script which is causing this problem.

I have rolled back all patches applied since the server reboot, and the problem still persists. I have been running Apache/2.2.3 (Win32) PHP/5.2.0RC5 fine up to this point, but upgraded to the latest snap (RC6) on 20/10/06 and the problem still happens. 

Reproduce code:
---------------
Unable to find specific code which causes this fault. 

Expected result:
----------------
n/a

Actual result:
--------------
Here is a list of all the information I could find, including a stack trace.

Event Log - application error (category 100):
Faulting application httpd.exe, version 2.2.3.0, faulting module php5ts.dll, version 5.2.0.0, fault address 0x00009e40.

Debugger:
First-chance exception at 0x00959f29 (php5ts.dll) in httpd.exe: 0xC0000005: Access violation reading location 0xff0a33c4.
Unhandled exception at 0x00959f29 (php5ts.dll) in httpd.exe: 0xC0000005: Access violation reading location 0xff0a33c4.

Stack Trace:
>	php5ts.dll!_zend_mm_free_int(_zend_mm_heap * heap=0x15f7f298, void * p=0x01193578)  Line 1337	C
 	php5ts.dll!_efree(void * ptr=0x01193578)  Line 1653 + 0x18 bytes	C
 	php5ts.dll!_zval_dtor_func(_zval_struct * zvalue=0x01193438)  Line 36 + 0xc bytes	C
 	php5ts.dll!_zval_ptr_dtor(_zval_struct * * zval_ptr=0x1671d46c)  Line 414 + 0xc bytes	C
 	php5ts.dll!zend_hash_destroy(_hashtable * ht=0x1671ceb0)  Line 521 + 0x6 bytes	C
 	php5ts.dll!_zval_dtor_func(_zval_struct * zvalue=0x16408250)  Line 44	C
 	php5ts.dll!_zval_ptr_dtor(_zval_struct * * zval_ptr=0x1671db34)  Line 414 + 0xc bytes	C
 	php5ts.dll!zend_hash_destroy(_hashtable * ht=0x163df5a8)  Line 521 + 0x6 bytes	C
 	php5ts.dll!_zval_dtor_func(_zval_struct * zvalue=0x163df410)  Line 44	C
 	php5ts.dll!_zval_ptr_dtor(_zval_struct * * zval_ptr=0x163df57c)  Line 414 + 0xc bytes	C
 	php5ts.dll!zend_hash_apply_deleter(_hashtable * ht=0x09489f00, bucket * p=0x163df570)  Line 606 + 0x6 bytes	C
 	php5ts.dll!zend_hash_graceful_reverse_destroy(_hashtable * ht=0x09489f00)  Line 642	C
 	php5ts.dll!shutdown_executor(void * * * tsrm_ls=0x15c7b958)  Line 239 + 0x17 bytes	C
 	php5ts.dll!zend_deactivate(void * * * tsrm_ls=0x15c7b958)  Line 842	C
 	php5ts.dll!php_request_shutdown(void * dummy=0x00000000)  Line 1303	C
 	php5apache2_2.dll!php_apache_request_dtor(request_rec * r=0x0898b120, void * * * tsrm_ls=0x15c7b958)  Line 450 + 0x8 bytes	C
 	php5apache2_2.dll!php_handler(request_rec * r=0x0898b120)  Line 609 + 0x7 bytes	C
 	libhttpd.dll!6ff020c1() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for libhttpd.dll]	
 	libhttpd.dll!6ff0244f() 	
 	libhttpd.dll!6ff0e2be() 	
 	libhttpd.dll!6ff0a7bc() 	
 	libhttpd.dll!6ff04cb1() 	
 	libhttpd.dll!6ff04f63() 	
 	libhttpd.dll!6ff1cadc() 	
 	msvcrt.dll!77bcb530() 	
 	kernel32.dll!7d4dfff1() 	


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-21 11:14 UTC] kris at k-software dot org
changed erroneous email address.
 [2006-10-21 11:39 UTC] kris at k-software dot org
Bug 39040 seems to experience the same problem, but the reproducable code in its snippet does not cause my PHP to crash.
 [2006-10-21 12:03 UTC] kris at k-software dot org
Dr Watson log file : 


Application exception occurred:
        App: C:\Program Files (x86)\Apache Group\Apache2\bin\httpd.exe (pid=2632)
        When: 10/21/2006 @ 13:02:13.937
        Exception number: c0000005 (access violation)

*----> System Information <----*
        Computer Name: SECAMSERVER1
        User Name: SYSTEM
        Terminal Session Id: 0
        Number of Processors: 4
        Processor Type: EM64T Family 15 Model 4 Stepping 3
        Windows Version: 5.2
        Current Build: 3790
        Service Pack: 1
        Current Type: Multiprocessor Free


*----> Module List <----*
00000000003e0000 - 00000000003f7000: C:\WINDOWS\system32\odbcint.dll
0000000000400000 - 0000000000405000: C:\Program Files (x86)\Apache Group\Apache2\bin\httpd.exe
00000000007f0000 - 0000000000842000: C:\WINDOWS\syswow64\SHLWAPI.dll
0000000000950000 - 0000000000e14000: C:\php5\php5ts.dll
0000000000e20000 - 0000000000eac000: C:\WINDOWS\syswow64\OLEAUT32.dll
00000000012b0000 - 00000000013bd000: c:\php5\ext\php_gd2.dll
00000000013c0000 - 00000000013df000: c:\php5\ext\php_ldap.dll
00000000013e0000 - 0000000001412000: C:\WINDOWS\system32\SSLEAY32.dll
0000000001420000 - 000000000152b000: C:\WINDOWS\system32\LIBEAY32.dll
0000000001530000 - 00000000016ce000: c:\php5\ext\php_mbstring.dll
00000000016d0000 - 00000000016dc000: c:\php5\ext\php_mysql.dll
00000000016e0000 - 000000000184a000: C:\WINDOWS\system32\LIBMYSQL.dll
0000000001860000 - 000000000188a000: c:\php5\ext\php_pgsql.dll
0000000010000000 - 0000000010009000: C:\php5\php5apache2_2.dll
000000004bf70000 - 000000004bfad000: C:\WINDOWS\system32\ODBC32.dll
000000005f270000 - 000000005f2c9000: C:\WINDOWS\system32\hnetcfg.dll
0000000069500000 - 0000000069517000: C:\WINDOWS\system32\faultrep.dll
000000006ee50000 - 000000006ee59000: C:\Program Files (x86)\Apache Group\Apache2\bin\libapriconv-1.dll
000000006ee60000 - 000000006ee89000: C:\Program Files (x86)\Apache Group\Apache2\bin\libaprutil-1.dll
000000006eec0000 - 000000006eedf000: C:\Program Files (x86)\Apache Group\Apache2\bin\libapr-1.dll
000000006faf0000 - 000000006faf6000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_authz_user.so
000000006fb00000 - 000000006fb06000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_authz_host.so
000000006fb10000 - 000000006fb16000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_authz_groupfile.so
000000006fb20000 - 000000006fb26000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_authz_default.so
000000006fb40000 - 000000006fb46000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_authn_file.so
000000006fb50000 - 000000006fb56000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_authn_default.so
000000006fc00000 - 000000006fc06000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_setenvif.so
000000006fc10000 - 000000006fc19000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_negotiation.so
000000006fc20000 - 000000006fc27000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_mime.so
000000006fc30000 - 000000006fc37000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_log_config.so
000000006fc40000 - 000000006fc48000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_isapi.so
000000006fc50000 - 000000006fc5a000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_include.so
000000006fc60000 - 000000006fc67000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_imagemap.so
000000006fc70000 - 000000006fc76000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_env.so
000000006fc80000 - 000000006fc86000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_dir.so
000000006fc90000 - 000000006fc97000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_cgi.so
000000006fca0000 - 000000006fca8000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_autoindex.so
000000006fcc0000 - 000000006fcc6000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_asis.so
000000006fcd0000 - 000000006fcd6000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_alias.so
000000006fce0000 - 000000006fce6000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_actions.so
000000006fe70000 - 000000006fe7e000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_rewrite.so
000000006fef0000 - 000000006fef6000: C:\Program Files (x86)\Apache Group\Apache2\modules\mod_auth_basic.so
000000006ff00000 - 000000006ff47000: C:\Program Files (x86)\Apache Group\Apache2\bin\libhttpd.dll
0000000071ae0000 - 0000000071ae8000: C:\WINDOWS\System32\wshtcpip.dll
0000000071bb0000 - 0000000071bb9000: C:\WINDOWS\system32\WSOCK32.dll
0000000071bf0000 - 0000000071bf8000: C:\WINDOWS\system32\WS2HELP.dll
0000000071c00000 - 0000000071c17000: C:\WINDOWS\system32\WS2_32.dll
0000000071c40000 - 0000000071c98000: C:\WINDOWS\syswow64\NETAPI32.dll
00000000762b0000 - 00000000762fa000: C:\WINDOWS\syswow64\comdlg32.dll
0000000076920000 - 00000000769e4000: C:\WINDOWS\system32\USERENV.dll
0000000076ed0000 - 0000000076eff000: C:\WINDOWS\system32\DNSAPI.dll
0000000076f10000 - 0000000076f3e000: C:\WINDOWS\syswow64\WLDAP32.dll
0000000076f70000 - 0000000076f77000: C:\WINDOWS\System32\winrnr.dll
0000000076f80000 - 0000000076f88000: C:\WINDOWS\system32\rasadhlp.dll
00000000770e0000 - 00000000771ea000: C:\WINDOWS\system32\SETUPAPI.dll
00000000771f0000 - 0000000077201000: C:\WINDOWS\system32\WINSTA.dll
0000000077530000 - 00000000775c7000: C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_5.82.3790.1830_x-ww_1B6F474A\COMCTL32.dll
0000000077670000 - 00000000777a4000: C:\WINDOWS\syswow64\ole32.dll
0000000077b90000 - 0000000077b98000: C:\WINDOWS\syswow64\VERSION.dll
0000000077ba0000 - 0000000077bfa000: C:\WINDOWS\syswow64\msvcrt.dll
0000000077f50000 - 0000000077fec000: C:\WINDOWS\syswow64\ADVAPI32.dll
000000007c8d0000 - 000000007d0d4000: C:\WINDOWS\syswow64\shell32.dll
000000007d4c0000 - 000000007d5f0000: C:\WINDOWS\syswow64\kernel32.dll
000000007d600000 - 000000007d6f0000: C:\WINDOWS\system32\ntdll.dll
000000007d800000 - 000000007d890000: C:\WINDOWS\syswow64\GDI32.dll
000000007d930000 - 000000007da00000: C:\WINDOWS\syswow64\USER32.dll
000000007da20000 - 000000007db00000: C:\WINDOWS\syswow64\RPCRT4.dll
000000007db30000 - 000000007dbb0000: C:\WINDOWS\system32\MSWSOCK.dll
000000007dbd0000 - 000000007dcd3000: C:\WINDOWS\WinSxS\WOW64_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.1830_x-ww_0213CDC8\comctl32.dll


*----> State Dump for Thread Id 0x1308 <----*

eax=011e8148 ebx=0900d008 ecx=00000001 edx=00000004 esi=01198140 edi=00050008
eip=00959e40 esp=07f3f820 ebp=77bbce33 iopl=0         nv up ei ng nz ac pe cy
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010293

*** WARNING: Unable to verify checksum for C:\php5\php5ts.dll
function: php5ts!_zend_mm_free_int
        00959e21 06               push    es
        00959e22 f6c101           test    cl,0x1
        00959e25 0f85bc010000     jne     php5ts!_zend_mm_free_int+0x217 (00959fe7)
        00959e2b 24fc             and     al,0xfc
        00959e2d 03c6             add     eax,esi
        00959e2f f60001           test    byte ptr [eax],0x1
        00959e32 0f85ec000000     jne     php5ts!_zend_mm_free_int+0x154 (00959f24)
        00959e38 8b4808           mov     ecx,[eax+0x8]
        00959e3b 8b500c           mov     edx,[eax+0xc]
        00959e3e 3bca             cmp     ecx,edx
FAULT ->00959e40 89510c           mov     [ecx+0xc],edx     ds:002b:0000000d=????????
        00959e43 894a08           mov     [edx+0x8],ecx
        00959e46 751d             jnz     php5ts!_zend_mm_free_int+0x95 (00959e65)
        00959e48 8b08             mov     ecx,[eax]
        00959e4a 81f908010000     cmp     ecx,0x108
        00959e50 7313             jnb     php5ts!_zend_mm_free_int+0x95 (00959e65)
        00959e52 c1e903           shr     ecx,0x3
        00959e55 49               dec     ecx
        00959e56 ba01000000       mov     edx,0x1
        00959e5b d3e2             shl     edx,cl
        00959e5d 8b0b             mov     ecx,[ebx]

*----> Stack Back Trace <----*
ChildEBP RetAddr  Args to Child              
07f3f828 0095a541 0900d008 01198148 00000000 php5ts!_zend_mm_free_int+0x70 (FPO: [2,0,3]) (CONV: cdecl)
07f3f83c 00a020f7 01198148 0af7144c 009e35e3 php5ts!_efree+0x21 (FPO: [1,0,0]) (CONV: cdecl)
07f3f848 009e35e3 01198098 0af70fb8 009e74e7 php5ts!_zval_dtor_func+0x27 (FPO: [1,0,1]) (CONV: cdecl)
07f3f854 009e74e7 0af7144c 0af71880 0ac1d1f0 php5ts!_zval_ptr_dtor+0x23 (FPO: [1,0,1]) (CONV: cdecl)
07f3f86c 00a02129 0af70c08 0af7188c 009e35e3 php5ts!zend_hash_destroy+0x27 (FPO: [EBP 0x77bbce33] [1,0,4]) (CONV: cdecl)
07f3f878 009e35e3 0ac1d1f0 0af71388 009e74e7 php5ts!_zval_dtor_func+0x59 (FPO: [1,0,1]) (CONV: cdecl)
07f3f884 009e74e7 0af7188c 01ac7868 0abf43b0 php5ts!_zval_ptr_dtor+0x23 (FPO: [1,0,1]) (CONV: cdecl)
07f3f89c 00a02129 0abf4548 0abf451c 009e35e3 php5ts!zend_hash_destroy+0x27 (FPO: [EBP 0x07f3fa50] [1,0,4]) (CONV: cdecl)
07f3f8a8 009e35e3 0abf43b0 0abf4510 009e76c7 php5ts!_zval_dtor_func+0x59 (FPO: [1,0,1]) (CONV: cdecl)
07f3f8b4 009e76c7 0abf451c 01b8a1c8 01ac7868 php5ts!_zval_ptr_dtor+0x23 (FPO: [1,0,1]) (CONV: cdecl)
07f3f8cc 009e7733 01ac7868 0abf4510 01b8a1c8 php5ts!zend_hash_apply_deleter+0x97 (FPO: [EBP 0x01b8a1c8] [2,0,4]) (CONV: cdecl)
07f3f8dc 009e2f78 01ac7868 00dedc00 009e3410 php5ts!zend_hash_graceful_reverse_destroy+0x13 (FPO: [1,0,1]) (CONV: cdecl)
07f3f904 7d61f63d 09f28588 07f3f9f0 7d61f5c9 php5ts!shutdown_executor+0x68 (CONV: cdecl)
 [2006-10-21 20:38 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2006-10-22 12:49 UTC] kris at k-software dot org
I'm currently unable to track down a single script/function which causes this error, and am therefore unable to provide a code sample. 

I realise that the bug report is pretty useless without reproducable code, so I'm still investigating and trying to track down the exact cause of the crashes.
 [2006-10-22 13:59 UTC] kris at k-software dot org
It appears that setting the CPU affinity of the apache http process to a single physical processor stops the crashing...

Setting the server to NOT use the second hyperthreaded core of the xeons (i.e. CPUs 0+2 or 1+3) seems to solve this random crashing.

Will test with a prefork MPM.
 [2006-10-22 14:14 UTC] kris at k-software dot org
Error in CPU IDs in previous comment, from microsoft support article ID 252867:

Processor enumeration on computers that use hyperthreading first assign processor numbers to the primary logical processor for each processor and then assign numbers to the secondary. For example, for dual physical processor computers with hyperthreading, the first processor has logical processor 0 and 2, and the second processor has logical processor 1 and 3.
 [2006-10-31 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-11-07 07:44 UTC] paradiso at gmail dot com
This is really a bug.
on my p4 2.4c + 865G + 1G ram, win2k3 server, apache 2.2.3.0 & php 5.2, this happens all the time.
 [2007-01-04 04:05 UTC] judexidoneus_g6 at hotmail dot com
So, there is no solution for this bug?
 [2007-02-16 11:01 UTC] niels at keurentjes dot net
I have the exact same issue: a stock Win2k3 setup with Apache 2.2.4 and PHP 5.2.1 on a Dual Xeon HT setup, and regular crashes, several times per day, sometimes 15 in 30 minutes when the site is being hit severely.

I have performed several recent software upgrades, the problems also occurred in the exact same fasion in Apache 2.0.59 + PHP 5.1.4, Apache 2.0.59 + PHP 5.2.0 and Apache 2.2.4 + PHP 5.2.1.

I am currently testing whether hard-forcing uniprocessor operation using ImageCfg (http://www.robpol86.com/Pages/imagecfg.php) works. I have set the httpd.exe process to the following:

---
httpd.exe contains the following configuration information:
    Process Affinity Mask: 00000001
httpd.exe contains a Subsystem Version of 4.0
    Image can only run in uni-processor mode on multi-processor systems
---

Notably the crashes seemed to become less frequent when I disabled all caching on the site. At first I suspected this pointed towards problems with too many files open simultaneously, but I am now after reading these problems pretty sure that it merely slowed down the site enough not to trigger the synchronization issues or race conditions.
 [2007-03-25 03:02 UTC] php at blazemonger dot com
I can reproduce this PHP crash easily in our MediaWiki 1.9.3 installation. Visit the main page and click the "Random page" link (in the left navigation menu) repeatedly, as fast as you can, about 50 times.  The error is thrown into the event log:

Faulting application httpd.exe, version 2.2.4.0, faulting module php5ts.dll, version 5.2.1.1, fault address 0x0000ae66.

and Apache becomes completely unresponsive (will not respond to any page requests) and must be restarted.

Windows 2003 Server SP1 64-bit (2 GB RAM)
Dual core AMD Opteron (2.81 GHz, Processor 8220 SE)
Apache 2.2.4 with SSL
PHP 5.2.1 (apache2handler)
MediaWiki 1.9.3
MySQL 5.0.27-community-nt

This is a VMware virtual machine if that matters.
 [2007-03-27 13:46 UTC] php at blazemonger dot com
Following up my previous comment: this is easily reproduced if I set up 3-4 scripts to simultaneously pound MediaWiki with requests to the Special:Random page, e.g.,

# repeat 1000 times
wget -O - http://servername/wiki/Special:Random

I have reproduced this on both the 32-bit and 64-bit versions of Windows 2003 Server SP1, with the software versions given earlier.
 [2007-03-27 16:23 UTC] php at blazemonger dot com
The problem appears to be gone in today's latest snapshot of PHP 5.2. I hammered MediaWiki for 15-20 minutes and didn't see a single error.
 [2007-04-20 16:48 UTC] niels at keurentjes dot net
I'm still having the problems, albeit less frequently after some performance tuning, but still too often. In my case, it's mainly some Ajax pages, inherently causing a lot of pageviews, that trigger the problem.

I'm not in a position to run snapshots on the involved production machines, but I'm highly curious whether the problem was really attacked and or fixed now.
 [2008-01-04 21:59 UTC] jaco at jump dot co dot za
I am also having this problem on our production machine

Apache 2.2.6
PHP 5.2.5
MySQL 5.0.45

Windows Server 2003 R2 Standard SP2
2 x Quad Core Zeon

Error in Eventlog

Faulting application httpd.exe, version 2.2.6.0, faulting module php5ts.dll, version 5.2.5.5, fault address 0x0000acb9.

Our production server is quite busy, and we have hundreds of PHP pages and I am unable to trace this to a specific php file.

I would love to try the solution of giving httpd.exe access to a single processor. Could someone please let me know how I can set that up

Thanks and hope we can find a solution soon
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 22:01:31 2024 UTC