Bug #13921 Updated: reproducible crash when curl_exec()ing with CURL_WRITEHEADER set
| From: | sniper@php.net | Date: | Mon, 05 Nov 2001 00:21:58 +0000 |
| Subject: | Bug #13921 Updated: reproducible crash when curl_exec()ing with CURL_WRITEHEADER set | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-69618@lists.php.net to get a copy of this message | ||
ID: 13921
Updated by: sniper
Reported By: mitja@doticni.net
Old Status: Open
Status: Closed
Bug Type: cURL related
Operating System: Linux 2.4.3
PHP Version: 4.0.6
New Comment:
This is fixed in CVS. Try the latest CVS snapshot from
http://snaps.php.net/
Previous Comments:
------------------------------------------------------------------------
[2001-11-04 11:26:03] mitja@doticni.net
curl_exec crashes, when there's a CURL_WRITEHEADER set. it didn't use to when using php
4.0.4pl1 and curl 7.7.2. In PHP 4.0.6 it crashes with both curl 7.8.1 and 7.9.1.
my config line:
./configure -enable-debug --with-openssl --enable-bcmath --enable-calendar --with-curl
--with-dom=/usr/local --enable-ftp --enable-gd-imgstrttf --with-gd --with-jpeg-dir=/usr/local
--with-mysql=/usr/local --enable-sockets --with-swf --with-zlib --enable-inline-optimization
--enable-track-vars --with-ttf --with-freetype
(it also crashes when used as apache 1.3.22 module)
script:
<?
$host="www.php.net";
$uri="/search.php";
$conn=curl_init("http://".$host.$uri);
$file1=fopen("/tmp/headers.txt", "w");
$file2=fopen("/tmp/content.txt", "w");
// if you comment the next line, everything is ok (but then you have no headers :(
curl_setopt($conn, CURLOPT_WRITEHEADER, $file1);
curl_setopt($conn, CURLOPT_FILE, $file2);
curl_exec($conn);
curl_close($conn);
fclose($file1);
fclose($file2);
?>
backtrace:
#0 0x8077a32 in curl_write (data=0x81f4248 "HTTP/1.0 200 OK\r\n", size=1, nmemb=17,
ctx=0x81ef4f8)
at curl.c:257
#1 0x4013e63e in Curl_client_write (data=0x40378008, type=2, ptr=0x81f4248 "HTTP/1.0 200
OK\r\n", len=17)
at sendf.c:251
#2 0x4014ac74 in Transfer (c_conn=0x81ef830) at transfer.c:661
#3 0x4014b7c1 in Curl_perform (data=0x40378008) at transfer.c:956
#4 0x4014baf0 in curl_easy_perform (curl=0x40378008) at easy.c:233
#5 0x80791c7 in php_if_curl_exec (ht=1, return_value=0x81f4034, this_ptr=0x0, return_value_used=0)
at curl.c:772
#6 0x8118888 in execute (op_array=0x81ef32c) at ./zend_execute.c:1504
#7 0x80ed7bc in zend_execute_scripts (type=8, file_count=3) at zend.c:752
#8 0x806b4fd in php_execute_script (primary_file=0xbffff9d8) at main.c:1206
#9 0x8069abd in main (argc=2, argv=0xbffffa4c) at cgi_main.c:718
#10 0x4025e577 in __libc_start_main () from /lib/libc.so.6
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13921&edit=1