#41642 [Opn->Fbk]: calling curl_init after using fsockopen cause segmentation fault
| From: | johannes@php.net | Date: | Sat, 09 Jun 2007 09:01:04 +0000 |
| Subject: | #41642 [Opn->Fbk]: calling curl_init after using fsockopen cause segmentation fault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113602@lists.php.net to get a copy of this message | ||
ID: 41642
Updated by: johannes@php.net
Reported By: kirys at neoteroi dot org
-Status: Open
+Status: Feedback
Bug Type: Reproducible crash
Operating System: Centos 4
PHP Version: 4.4.7
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2007-06-09 08:57:52] kirys at neoteroi dot org
Description:
------------
Using curl_init() after using the fsockopen calls produce a
segmentation fault into apache
The script i've attached always reproduces the problem on my service
provider server (just set the var to some working location)
Cya
Reproduce code:
---------------
$file = fsockopen ($site, $port, $errno, $errstr,6);
if (!$file) {
echo "<sockmessage>$site, $port $errstr ($errno)</sockmessage>\n";
@fclose ($file);
} else {
socket_set_timeout($file,1);
fputs ($file, "\n");
@fclose ($file);
}
$crl = curl_init();
$timeout = 2;
curl_setopt ($crl, CURLOPT_URL,$url);
curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
$ret = curl_exec($crl);
curl_close($crl);
echo "$ret";
Expected result:
----------------
The contents of the url curl opened :)
Actual result:
--------------
Apache goes segfault
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41642&edit=1