|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-05-09 13:44 UTC] php-bug at paulsohier dot nl
Description:
------------
Discovered during testfest in Utrecht and asked by Piere to report.
When calling curl with a certian url and without closing the curl stream curl will segfault.
Curl version:
paul@dwerg:~/php/php5.3-200905090830$ curl-config --version
libcurl 7.18.2
Used host where it segfault: www.hosthuis.nl
Used host where it NOT segfault: www.example.org
Reproduce code:
---------------
<?php
$host = 'www.hosthuis.nl';
$temp_file = tempnam(sys_get_temp_dir(), '');
$handle = fopen($temp_file, 'w');
$url = "{$host}/";
$ch = curl_init();
ob_start(); // start output buffering
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_STDERR, $handle);
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
curl_exec($ch);
fclose($handle);
?>
Expected result:
----------------
The contents of the site
Actual result:
--------------
The contents of the site and a segfault
from run test (Bit different script)
*** glibc detected *** /home/paul/php/php5.3-200905090830/sapi/cli/php: free(): invalid pointer: 0x4001f000 ***
======= Backtrace: =========
/lib/i686/cmov/libc.so.6[0x40624624]
/lib/i686/cmov/libc.so.6(cfree+0x96)[0x40626826]
/lib/i686/cmov/libc.so.6(_IO_free_backup_area+0x34)[0x40622b54]
/lib/i686/cmov/libc.so.6(_IO_file_overflow+0x1c2)[0x40620962]
/lib/i686/cmov/libc.so.6(_IO_file_xsputn+0x65)[0x4061f9d5]
/lib/i686/cmov/libc.so.6(fwrite+0x10a)[0x4061586a]
/usr/lib/libcurl.so.4[0x40363428]
/usr/lib/libcurl.so.4[0x40363547]
/usr/lib/libcurl.so.4[0x403640d9]
/usr/lib/libcurl.so.4[0x4036a81a]
/usr/lib/libcurl.so.4[0x4036abdf]
/usr/lib/libcurl.so.4[0x4036ef77]
/usr/lib/libcurl.so.4(curl_easy_cleanup+0x21)[0x4037aec1]
/home/paul/php/php5.3-200905090830/sapi/cli/php[0x80f288b]
/home/paul/php/php5.3-200905090830/sapi/cli/php[0x82f9a22]
/home/paul/php/php5.3-200905090830/sapi/cli/php(zend_hash_del_key_or_index+0xe2)[0x82f8a42]
/home/paul/php/php5.3-200905090830/sapi/cli/php(_zend_list_delete+0x70)[0x82f9c70]
/home/paul/php/php5.3-200905090830/sapi/cli/php(_zval_ptr_dtor+0x3d)[0x82dfd6d]
/home/paul/php/php5.3-200905090830/sapi/cli/php[0x82f65e2]
/home/paul/php/php5.3-200905090830/sapi/cli/php(zend_hash_graceful_reverse_destroy+0x1f)[0x82f686f]
/home/paul/php/php5.3-200905090830/sapi/cli/php[0x82e20e8]
/home/paul/php/php5.3-200905090830/sapi/cli/php[0x82eb843]
/home/paul/php/php5.3-200905090830/sapi/cli/php(php_request_shutdown+0x15f)[0x829b5df]
/home/paul/php/php5.3-200905090830/sapi/cli/php[0x836b079]
/lib/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0x405cc455]
/home/paul/php/php5.3-200905090830/sapi/cli/php(realloc+0x95)[0x8065241]
Patchesreset_to_default_with_multi.patch.txt (last revision 2011-06-09 07:31 UTC by shein@php.net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 20:00:01 2025 UTC |
<?php $url = 'www.hosthuis.nl'; $ch = curl_init(); $handle = fopen('/tmp/tt.tmp', 'w'); // $handle = STDERR; // This works curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_STDERR, $handle); curl_setopt($ch, CURLOPT_URL, $url); curl_exec($ch); ?>