php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #19119 curl_exec called twice
Submitted: 2002-08-27 04:11 UTC Modified: 2003-02-05 11:02 UTC
From: papier at sdv dot fr Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.3.0-dev / 4.2.3-dev OS: Linux 2.4.7-10 (RedHat 7.2)
Private report: No CVE-ID: None
 [2002-08-27 04:11 UTC] papier at sdv dot fr
It seems that bug #14142 is back.
This simple exemple generate a Segmentation fault.
The bug occurs only when RETURNTRANSFER is set and when using 2 curl_exec on the same curl handle.
Changing the 2nd URL to http://www.php.net/ generate an infinite loop !

<?
$ch = curl_init();
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_URL,"http://www.apple.com/");
$res1 = curl_exec($ch);

curl_setopt($ch,CURLOPT_URL,"http://www.apple.com/quicktime/");
$res2 = curl_exec($ch);

curl_close($ch);
?>

PHP 4.2.2 / libcurl 7.9.8 and './configure --with-curl'.

Here is the back trace
Program received signal SIGSEGV, Segmentation fault.
0x080d580c in _efree (ptr=0x81a2164) at zend_alloc.c:222
222             CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
(gdb) where
#0  0x080d580c in _efree (ptr=0x81a2164) at zend_alloc.c:222
#1  0x080e3c5e in _zval_dtor (zvalue=0x818d324) at zend_variables.c:44
#2  0x080dbf68 in _zval_ptr_dtor (zval_ptr=0x818d570) at zend_execute_API.c:274
#3  0x080e9a61 in zend_hash_destroy (ht=0x8155188) at zend_hash.c:541
#4  0x080dbcaa in shutdown_executor () at zend_execute_API.c:173
#5  0x080e4c7e in zend_deactivate () at zend.c:596
#6  0x080611da in php_request_shutdown (dummy=0x0) at main.c:787
#7  0x0806009b in main (argc=2, argv=0xbffff9e4) at cgi_main.c:827
#8  0x401db657 in __libc_start_main (main=0x805f7a4 <main>, argc=2, 
    ubp_av=0xbffff9e4, init=0x805e424 <_init>, fini=0x8107d40 <_fini>, 
    rtld_fini=0x4000dcd4 <_dl_fini>, stack_end=0xbffff9dc)
    at ../sysdeps/generic/libc-start.c:129

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-27 14:22 UTC] sniper@php.net
Got the same results..

 [2002-09-09 11:19 UTC] sterling@php.net
current cURL extension limitation...  You can't reuse the
same handle...
 [2002-09-25 09:39 UTC] derick@php.net
Not a bug in PHP -> bogus
 [2002-09-25 09:55 UTC] derick@php.net
sorry, misread
 [2002-10-27 18:54 UTC] sterling@php.net
not a bug a limitation - marked as a feature request...
 [2003-02-05 11:02 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 22:01:26 2024 UTC