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
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.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 13:01:30 2024 UTC