php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33559 curl_close gives a seg fault when used on a multi cURL resource
Submitted: 2005-07-04 02:36 UTC Modified: 2005-07-04 02:52 UTC
From: dev at null dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.0.4 OS: Redhat 9
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: dev at null dot com
New email:
PHP Version: OS:

 

 [2005-07-04 02:36 UTC] dev at null dot com
Description:
------------
A common oversight if migrating from a normal cURL interface to multi-curl is leaving in a curl_close() command. This causes a PHP seg fault if performed after curl_multi_remove_handle. The problem was not reproducible all the time - one key to it being reproduced was having
a. Multiple cURL handles
b. Closing the first $mh using curl_multi_close; then followed by a new curl_multi_init.

This may be fixed in the CVS (re #33222 - a similar but not identical problem with the function) - I am not sure.

Reproduce code:
---------------
$mh = curl_multi_init();

... curl_multi_exec etc.

curl_multi_remove_handle($mh,$ch);

// seg fault here:
curl_close($ch);


Expected result:
----------------
Should give a graceful error, not a seg fault.

Actual result:
--------------
seg fault

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-04 02:52 UTC] dev at null dot com
Actually - I have some more information on this bug. I will reopen a new ticket with some sample code to reliably generate it.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 00:01:36 2025 UTC