ID:               33222
 User updated by:  public at grik dot net
 Reported By:      public at grik dot net
 Status:           Open
 Bug Type:         cURL related
 Operating System: Linux RH9
 PHP Version:      5.0.4
 New Comment:

backtrace:
(gdb) bt
#0  0x403a9d84 in Curl_readwrite (conn=0x81f584c, done=0xbfffc39f "")
    at transfer.c:890
#1  0x403aaf56 in Transfer (conn=0x81f584c) at transfer.c:1480
#2  0x403ab94a in Curl_perform (data=0x81f7b7c) at transfer.c:1985
#3  0x403ac175 in curl_easy_perform (curl=0x81f7b7c) at easy.c:378
#4  0x4002c3d2 in zif_curl_exec (ht=1, return_value=0x81f55dc,
this_ptr=0x0,
    return_value_used=0)
    at /usr/src/web/php5-STABLE-200505161036/ext/curl/interface.c:1261
#5  0x0814a267 in zend_do_fcall_common_helper
(execute_data=0xbfffc610,
    opline=0x81f5068, op_array=0x81f09a4)
    at /usr/src/web/php5-STABLE-200505161036/Zend/zend_execute.c:2747
#6  0x0814a8c8 in zend_do_fcall_handler (execute_data=0xbfffc610,
    opline=0x81f5068, op_array=0x81f09a4)
    at /usr/src/web/php5-STABLE-200505161036/Zend/zend_execute.c:2881
#7  0x08147188 in execute (op_array=0x81f09a4)
    at /usr/src/web/php5-STABLE-200505161036/Zend/zend_execute.c:1417
#8  0x081239fe in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
    at /usr/src/web/php5-STABLE-200505161036/Zend/zend.c:1080
#9  0x080e5323 in php_execute_script (primary_file=0xbfffe9e0)
    at /usr/src/web/php5-STABLE-200505161036/main/main.c:1646
#10 0x08153187 in main (argc=4, argv=0xbfffea84)
    at /usr/src/web/php5-STABLE-200505161036/sapi/cgi/cgi_main.c:1582
#11 0x42015574 in __libc_start_main () from /lib/tls/libc.so.6


Previous Comments:
------------------------------------------------------------------------

[2005-06-02 16:55:14] public at grik dot net

Description:
------------
When I try to close CURL connection from the function, registered as a
handler for the output (header or body), PHP crashes.

Reproduce code:
---------------
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "http://www.yahoo.com/";);

curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'header_callback');

curl_exec($ch);

curl_close($ch);

function header_callback($ch, $string){
    echo $string;
    curl_close($ch);
    return strlen($string);
}

?>

Expected result:
----------------
HTTP/1.1 200 OK

Actual result:
--------------
HTTP/1.1 200 OK
Segmentation fault



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33222&edit=1

Reply via email to