#37951 [Com]: Segfaul when using certain curl_setopt option
| From: | andrew dot hill at m3 dot net | Date: | Thu, 06 Jul 2006 13:33:41 +0000 |
| Subject: | #37951 [Com]: Segfaul when using certain curl_setopt option | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-99158@lists.php.net to get a copy of this message | ||
ID: 37951
Comment by: andrew dot hill at m3 dot net
Reported By: headhunter at c-plusplus dot de
Status: No Feedback
Bug Type: cURL related
Operating System: SLES 10.0 - 64 Bit
PHP Version: 5.1.4
New Comment:
Hi,
I have the same issue on a RHEL 4.0 x86_64 machine. The listed example
script crashes as described above.
I have also copied my MySQL 5.0 libraries from /usr/lib64/mysql to
/usr/lib/mysql to allow PHP to compile.
In my case I was using PHP 5.0.4, but using the linked PHP 5.2 latest
dev release didn't resolve the issue.
Any ideas?
Thanks!
Andrew
Previous Comments:
------------------------------------------------------------------------
[2006-07-06 01:00:01] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2006-06-28 18:54:44] tony2001@php.net
Apparently it's a snapshot.
You don't have to INSTALL it, the only thing you need to do is to
compile the snapshot and run your script using it.
------------------------------------------------------------------------
[2006-06-28 18:43:00] headhunter at c-plusplus dot de
What kind of PHP is this? I'm not very keen to try an development
version of PHP on a productive server. What am I buying?
------------------------------------------------------------------------
[2006-06-28 18:24:01] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
[2006-06-28 18:14:47] headhunter at c-plusplus dot de
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:
----------------
jojo@suse10064lamp:~> php bug.php
*** glibc detected *** free(): invalid pointer: 0x00002aaaab7dcb00 ***
Aborted
Actual result:
--------------
jojo@suse10064lamp:~> 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 this bug report at http://bugs.php.net/?id=37951&edit=1