|  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
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-06-09 08:57 UTC] kirys at neoteroi dot org
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)


Reproduce code:
$file = fsockopen ($site, $port, $errno, $errstr,6);

if (!$file) {

    echo "<sockmessage>$site, $port $errstr ($errno)</sockmessage>\n";

    @fclose ($file);

} else {


    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);


echo "$ret";

Expected result:
The contents of the url curl opened :)

Actual result:
Apache goes segfault


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-09 09:01 UTC]
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 for *NIX and 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-2022 The PHP Group
All rights reserved.
Last updated: Mon Dec 05 01:05:53 2022 UTC