php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44687 curl_multi_* crashes apache randomly
Submitted: 2008-04-11 00:53 UTC Modified: 2008-08-23 01:00 UTC
Votes:6
Avg. Score:4.8 ± 0.4
Reproduced:6 of 6 (100.0%)
Same Version:4 (66.7%)
Same OS:4 (66.7%)
From: r_luca at tiscali dot it Assigned:
Status: No Feedback Package: cURL related
PHP Version: 5.2.5 OS: windows vista
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-04-11 00:53 UTC] r_luca at tiscali dot it
Description:
------------
Using curl multi to send requests and retrieving the header with a callback function, apache crashes randomly (sometimes after 100 requests, other times after 600 or 6000 or 25000, sometimes it doesn't). 




Reproduce code:
---------------
http://www.pastebin.org/28896

Actual result:
--------------
Thread 70 - System ID 4680
Entry point   msvcrt!_endthreadex+6f 
Create time   10/04/2008 23.15.14 
Time spent in user mode   0 Days 0:0:0.0 
Time spent in kernel mode   0 Days 0:0:0.0 






Function     Arg 1     Arg 2     Arg 3   Source 
php_curl!get_module+17ed8     044d9748     00000000     11338e90    
php_curl!get_module+11f51     044d9718     0e2e0888     044d9748    
php_curl!get_module+b47d     11c30008     04256218     05aacbb8    
php_curl!get_module+24d82     00000000     00000000     00000000    




PHP_CURL!GET_MODULE+17ED8WARNING - DebugDiag was not able to locate debug symbols for php_curl.dll, so the information below may be incomplete.



In httpd__PID__2004__Date__04_10_2008__Time_11_15_14PM__470__Second_Chance_Exception_C0000005.dmp the assembly instruction at php_curl!get_module+17ed8 in c:\php5\ext\php_curl.dll from The PHP Group has caused an access violation exception (0xC0000005) when trying to read from memory location 0x00000008 on thread 70



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-11 08:47 UTC] scottmac@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
 [2008-04-13 06:03 UTC] r_luca at tiscali dot it
Sorry but the only backtrace that i've got from the crash is only same as the one that i've submitted. Php (set as well with debug diagnostics, following your tutorial)monitoring doesn't report anything at all.
 [2008-04-13 06:06 UTC] r_luca at tiscali dot it
Sorry, bad English. What i meant is that the only backtrace that i'm getting so far after few crashes is the one posted. DD set for php as well as shown on the tutorial beside httpd.exe doesn't catch any backtrace. I think the problem is apache.
 [2008-04-13 11:58 UTC] scottmac@php.net
Please try using this CVS snapshot:

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

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi


If the snapshot doesn't work can you give me a full reproduce script, the code you put on the pastebin doesn't show how you use it.

When you say 100 requests is that from the one request or is it multiple requests?
 [2008-04-13 15:54 UTC] r_luca at tiscali dot it
Sure, here we go:

main actions class
http://pastebin.com/m76ba3a74
retrieve user actions and initialize check

check_process
http://pastebin.com/m328051ca
handles the rows groups cration and the check thru multi request

multi request
http://www.pastebin.org/28896
for each group($data) from the check process retrieve headers using multi curl

excel handler
http://pastebin.com/m412c62a2
 [2008-04-13 15:56 UTC] r_luca at tiscali dot it
is 100 total requests(rows on the excel table). Right now each call to the curl multi is for groups of 5.
 [2008-04-15 14:19 UTC] jani@php.net
At http://snaps.php.net/ you can find the debug pack required to get proper backtraces on windows. 

 [2008-04-15 21:15 UTC] r_luca at tiscali dot it
I am already using the debug version, apache crashes (very randomly) but no backtrace.
 [2008-04-22 18:10 UTC] r_luca at tiscali dot it
I am still trying to get the  backtrace but when the process crashes 
debug diagnostics gives back a rule error. 

Is there a way to retrieve an updated version of the php_cul.dll file (with a recent curl version)?
 [2008-04-24 16:10 UTC] jani@php.net
You need to use the debug pack from the same build as the binaries:

http://snaps.php.net/win32/php5.2-win32-200804241630.zip
http://snaps.php.net/win32/php5.2-dbgpack-win32-200804241630.zip

 [2008-05-09 20:13 UTC] r_luca at tiscali dot it
I've followed the backtrace tutorial step by step, using the debug pack from the same build as the binaries but debug diag hasn't find any error but apache is still crashing.

I've notice that many people did have this problem and guess that at this stage an updated version of php_curl.dll with the latest curl lib would be a possible solution.
 [2008-08-15 23:48 UTC] gmtfn at yahoo dot com
Looks like the whole curl module is buggy on Windows. I use curl_exec, and Apache crashes for me regularly, sometimes every time.
 [2008-08-15 23:55 UTC] pajoye@php.net
Please try using php 5.3 zip snapshots from:

http://snaps.php.net
 [2008-08-23 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".
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Jan 23 05:01:24 2020 UTC