|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52411 segfault: curl_multi_* + 2 or more FTP urls
Submitted: 2010-07-23 08:16 UTC Modified: 2010-07-27 04:57 UTC
From: profy dot net at gmail dot com Assigned:
Status: Duplicate Package: cURL related
PHP Version: 5.3.3 OS: win xp, ubuntu 9.10, others
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: profy dot net at gmail dot com
New email:
PHP Version: OS:


 [2010-07-23 08:16 UTC] profy dot net at gmail dot com
segfault when requesting 2 or more FTP urls with curl_multi_*

Appears both under WIN XP SP3, ubuntu 8.10, 9.10

segfault when calling test script from command line, for example: 
d:/www4/php5/php -q -c d:/www4/php.ini -f curl_ftp_bug_test.php
and also as apache2 module:

php.ini used is default from distribution (php.ini-production) wit only curl extension enabled:

Reproduced every time when call test script.

This bug first reported here:
But was set to "Bogus" by mistake.

Test script:
function multi_request($urls, $url_options = array()) {
	$mh = curl_multi_init();
	foreach ($urls as $id => $url) {
		$curly[$id] = curl_init();
		curl_setopt($curly[$id], CURLOPT_URL, $url);
		curl_setopt($curly[$id], CURLOPT_RETURNTRANSFER, true);
		// I've add this opt to speed up request, bug appearing with or without this line
		curl_setopt($curly[$id], CURLOPT_NOBODY, true);
		curl_multi_add_handle($mh, $curly[$id]);

	$running = null;
	do {
		$status = curl_multi_exec($mh, $running);
	} while($status == CURLM_CALL_MULTI_PERFORM || $running);

	foreach ($curly as $id => $c) {
		$result[$id] = curl_multi_getcontent($c);
		curl_multi_remove_handle($mh, $c);

	return $result;

$urls = array(
	"4358521"	=> "",
	"7458288"	=> "",

echo "<pre>";
echo "</pre>";

Expected result:
No segfault :)

Actual result:
segmentation fault


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-27 01:06 UTC]
-Status: Open +Status: Feedback
 [2010-07-27 01:06 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.

 [2010-07-27 04:57 UTC]
-Status: Feedback +Status: Duplicate
 [2010-07-27 04:57 UTC]
closing this bug as duplicate of bug #52284
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Mar 04 03:01:30 2024 UTC