php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41642 calling curl_init after using fsockopen cause segmentation fault
Submitted: 2007-06-09 08:57 UTC Modified: 2007-06-17 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: kirys at neoteroi dot org Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 4.4.7 OS: Centos 4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kirys at neoteroi dot org
New email:
PHP Version: OS:

 

 [2007-06-09 08:57 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-09 09:01 UTC] johannes@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.
 [2007-06-17 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-2025 The PHP Group
All rights reserved.
Last updated: Sun Jan 05 00:01:29 2025 UTC