From:             headhunter at c-plusplus dot de
Operating system: SLES 10.0 - 64 Bit
PHP version:      5.1.4
PHP Bug Type:     cURL related
Bug description:  Segfaul when using certain curl_setopt option

Description:
------------
Hello,

I have found a bug which crashes PHP when using CURLOPT_FOLLOWLOCATION.
This happens on certain adresses only, the one specified in the example
later gives a crash.
Example line:
curl_setopt ($curl_handle, CURLOPT_FOLLOWLOCATION, 1); // <<< CRASH HERE


I don't know my configure line exactly. Anyway, I compiled PHP by hand
with--curl and --with-mysql and --with-cli. Rest is as untouched.

Unique to my systems where the problems I had getting mysql5 working. It
seems there is a bug in the configure Script of PHP which makes it ignore
the 64bit Libraries of mysql. I had to copy /usr/lib64/mysql to
/usr/lib/mysql to make compiling work.

The problem is indenpendant from the php.ini, I tried different one. The
default configuration also produces the crash. 

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

$curl_handle = curl_init();
$timeout = 10;

curl_setopt ($curl_handle,CURLOPT_URL, 'www.vipnet.at');
curl_setopt ($curl_handle, CURLOPT_FOLLOWLOCATION, 1); // <<< CRASH HERE

$buffer = curl_exec ($curl_handle);
print_r ($buffer);
?>

Expected result:
----------------
[EMAIL PROTECTED]:~> php bug.php
*** glibc detected *** free(): invalid pointer: 0x00002aaaab7dcb00 ***
Aborted


Actual result:
--------------
[EMAIL PROTECTED]:~> strace php bug.php
[ snip ]
open("/dev/tty", O_RDWR|O_NONBLOCK|O_NOCTTY) = 4
writev(4, [{"*** glibc detected *** ", 23}, {"free(): invalid pointer",
23}, {": 0x", 4}, {"00002aaaab7dcb00", 16}, {" ***\n", 5}], 5*** glibc
detected *** free(): invalid pointer: 0x00002aaaab7dcb00 ***
) = 71
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
tgkill(12461, 12461, SIGABRT)           = 0
--- SIGABRT (Aborted) @ 0 (0) ---
+++ killed by SIGABRT +++


-- 
Edit bug report at http://bugs.php.net/?id=37951&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37951&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=37951&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37951&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37951&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37951&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37951&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37951&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37951&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37951&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37951&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37951&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37951&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37951&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37951&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37951&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37951&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37951&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37951&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37951&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37951&r=mysqlcfg

Reply via email to