From: [EMAIL PROTECTED] Operating system: Redhat PHP version: 4.3.1 PHP Bug Type: cURL related Bug description: cURL Special case Segfault
I've found, by complete accident a very strange curl segfault produced by the following code: $ch = curl_init ("ftp://localhost/itworked.txt"); curl_setopt($ch, CURLOPT_USERPWD, "php:foobar"); $fr = fopen("curl_ex6.php"); curl_setopt($ch, CURLOPT_INFILE, $fr); curl_setopt($ch, CURLOPT_UPLOAD, true); curl_exec($ch); fclose($fr); curl_close($ch); Two important parts to this segfault: 1) fopen() cannot actually be correctly formatted. It must fail to specify the mode. 2) The username, password set by curl_setopt must actually be a real username/password that works. If you provide a fake password, everything is fine.. but if you actually used a real password you segfault. here's the BT: #0 0x40259a85 in _IO_fread (buf=0x821ca25, size=1, count=16384, fp=0x0) at iofread.c:42 #1 0x08069893 in curl_read (data=0x821ca25 "", size=1, nmemb=16384, ctx=0x8217aac) at /usr/local/src/php-4.3.1/ext/curl/curl.c:394 #2 0x400f0842 in fillbuffer (conn=0x82130b0, bytes=16384) at transfer.c:137 #3 0x400f1c7e in Curl_readwrite (conn=0x82130b0, done=0xbfffccff "") at transfer.c:948 #4 0x400f24d2 in Transfer (conn=0x82130b0) at transfer.c:1247 #5 0x400f2a4e in Curl_perform (data=0x82183a8) at transfer.c:1586 #6 0x400f2dfc in curl_easy_perform (curl=0x82183a8) at easy.c:247 #7 0x0806b03d in zif_curl_exec (ht=1, return_value=0x820e73c, this_ptr=0x0, return_value_used=0) at /usr/local/src/php-4.3.1/ext/curl/curl.c:994 #8 0x0814c928 in execute (op_array=0x8213024) at /usr/local/src/php-4.3.1/Zend/zend_execute.c:1596 #9 0x0813a538 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/php-4.3.1/Zend/zend.c:864 #10 0x081143f5 in php_execute_script (primary_file=0xbffffa40) at /usr/local/src/php-4.3.1/main/main.c:1573 #11 0x08154e9c in main (argc=2, argv=0xbffffae4) at /usr/local/src/php-4.3.1/sapi/cli/php_cli.c:746 #12 0x40207306 in __libc_start_main (main=0x815451c <main>, argc=2, ubp_av=0xbffffae4, init=0x806461c <_init>, fini=0x815d280 <_fini>, rtld_fini=0x4000d2dc <_dl_fini>, stack_end=0xbffffadc) -- Edit bug report at http://bugs.php.net/?id=22681&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=22681&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=22681&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=22681&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=22681&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=22681&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=22681&r=support Expected behavior: http://bugs.php.net/fix.php?id=22681&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=22681&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=22681&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=22681&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22681&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=22681&r=dst IIS Stability: http://bugs.php.net/fix.php?id=22681&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=22681&r=gnused