Bug #32099 [Asn->Opn]: After opening ADO connection and closing it repeatedly, Apache stops service

From: Date: Tue, 24 Oct 2017 07:35:02 +0000
Subject: Bug #32099 [Asn->Opn]: After opening ADO connection and closing it repeatedly, Apache stops service
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212110@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=32099&edit=1

 ID:                 32099
 Updated by:         kalle@php.net
 Reported by:        terryoh at wins21 dot com
 Summary:            After opening ADO connection and closing it
                     repeatedly, Apache stops service
-Status:             Assigned
+Status:             Open
 Type:               Bug
 Package:            COM related
 Operating System:   win32
 PHP Version:        5CVS, 4CVS (2005-02-28)
-Assigned To:        pajoye
+Assigned To:        
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2013-01-07 17:51:24] mike at edcsi dot com

Has this patch been included in the latest PHP builds? I am running on Windows 2003 server and have
experienced the same problem.

------------------------------------------------------------------------
[2011-04-23 01:20:41] thangaraj at gmail dot com

I faced a similar crash in my App, fixed the COM issue and was trying to post it as a new bug,
somehow PHP bug system smartly pointed out this defect. Tested my fix on the sample script and PHP
doesn't crash. Therefore uploading patch here.

This crash is reproducible in old and latest SVN builds too.


OS          : WindowsServer 2003 R2 EE SP2 x86
PHP Version : 5.3.6 NTS build or below in fast cgi mode.
Web Server  : Apache 2.2.16 / mod_fcgid 2.3.5
DBMS        : MSSQL 2005 Enterprise Edition 
OTHERS      : MDAC 2.8

Root Cause: 
~~~~~~~~~~~
When PHP fastcgi engine Initializes and Shuts down ADO COM objects fastly within a second, Crash
happens, i.e., Comsvcs.dll PingThread method access violates and crashes php-cgi.exe 

Patch provided: 
~~~~~~~~~~~~~~~
PHP non Thread safe builds using "fast cgi mode" is made to cache COM CoInit call and
release COM subsystem only during php-cgi.exe process shutdown. 
By not calling CoUnint during every request shutdown, Comsvcs.dll is not unloaded and PingThread
method does not access violate. Note that MS recommends to use CoUnint API during process shutdown,
and this patch does it.

[PATCH uploaded] 
~~~~~~~~~~~~~~~~
DIFF of 5.3SVN-2011-04-22
Patch_for_PhpCrashInFCGIModeDuringCoUnintialzie.diff

-Thanga

------------------------------------------------------------------------
[2005-03-19 00:08:01] sniper@php.net

We don't know a solution, sorry.


------------------------------------------------------------------------
[2005-03-02 09:43:22] terryoh at wins21 dot com

In my test, PHP 5 has same problem.

I really want to know the solution, please..

------------------------------------------------------------------------
[2005-03-02 08:23:50] sniper@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

This is PHP 5 snapshot which has better COM support.


------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=32099


--
Edit this bug report at https://bugs.php.net/bug.php?id=32099&edit=1


Thread (12 messages)

« previous php.bugs (#212110) next »