Edit report at https://bugs.php.net/bug.php?id=61947&edit=1
ID: 61947
Comment by: ceo at l-i-e dot com
Reported by:ly...@php.net
Summary:curl Segmentation fault
Status: Open
Type: Bug
Package:cURL related
Operating System: Linux
PHP Version:Irrelevant
Block user comment: N
Private report: N
New Comment:
I've got 9 more of these backtraces if you want them.
And about 8 of these with no backtrace or anything at all:
[Fri May 04 10:59:37 2012] [notice] child pid 24011 exit signal Segmentation
fault (11)
[Fri May 04 11:10:00 2012] [notice] child pid 24050 exit signal Segmentation
fault (11)
[Fri May 04 11:10:03 2012] [notice] child pid 24044 exit signal Segmentation
fault (11)
[Fri May 04 18:23:31 2012] [notice] child pid 27659 exit signal Segmentation
fault (11)
[Fri May 04 19:15:25 2012] [notice] child pid 27830 exit signal Segmentation
fault (11)
[Fri May 04 19:15:34 2012] [notice] child pid 27832 exit signal Segmentation
fault (11)
[Fri May 04 19:17:53 2012] [notice] child pid 26396 exit signal Segmentation
fault (11)
[Fri May 04 20:17:11 2012] [notice] child pid 28059 exit signal Segmentation
fault (11)
Those look more like apache crashes, I presume... PHP may have been the root
cause, however, if something is scrambling RAM.
Previous Comments:
[2012-05-05 04:52:36] ly...@php.net
Description:
libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
It's PHP 5.1.3, so you may not care, but that's what was handed to me on the
GoDaddy server by my client, and I hesitate to upgrade until we take the issue
up with GoDaddy first.
In the meantime, since I have a stacktrace with at least some debugging symbols
in it, and it specifically mentions Curl_cookie_cleanup, I thought it might be
something useful, even if it's an older PHP version.
curl with CURLOPT_COOKIEJAR and CURLOPT_COOKIE file.
I'm using curl_multi functions, so I guess it could be a factor.
I'm hitting the same URL with different cookie files and log files, create with
tempnam.
I would assume that using two curl handles with the same cookie file and/or log
file would be a Bad Idea.
I have tail all the /tmp/curllog* files. Some are just empty. Others have
nothing interesting at the end.
I suppose the empty one could be the ones that correspond to the segfaults, but
don't quite see how that info would be useful... Unless it narrows down a
portion of the code.
Test script:
---
Could be this one:
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE) or ($errors[]
= 'RETURNTRANSFER');
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE) or ($errors[]
= 'FOLLOWLOCATION');
curl_setopt($curl, CURLOPT_HEADER, FALSE) or ($errors[] =
'HEADER');
curl_setopt($curl, CURLOPT_HTTPGET, TRUE) or ($errors[] =
'HTTPGET');
curl_setopt($curl, CURLOPT_TIMEOUT, 60) or ($errors[] =
'TIMEOUT');
curl_setopt($curl, CURLOPT_COOKIEFILE, $depart_cookies) or
($errors[] = 'COOKIEFILE');
curl_setopt($curl, CURLOPT_COOKIEJAR, dirname(__FILE__) .
"/$direction.txt") or ($errors[] = 'COOKIEJAR');
curl_setopt($curl, CURLOPT_VERBOSE, TRUE) or ($errors[] =
'VERBOSE');
$log = fopen($curllog, 'a+') or ($errors[] = "FOPEN $curllog");
curl_setopt($curl, CURLOPT_STDERR, $log) or ($errors[] =
'STDERR');
Or it could be that one above with the following changes to the $curl handle:
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
I will try to error_log something in between to narrow it down.
Expected result:
PHP to not crash.
Actual result:
--
*** glibc detected *** /usr/sbin/httpd: free(): corrupted unsorted chunks:
0xb87a8508 ***
=== Backtrace: =
/lib/libc.so.6[0xb7bbd5a5]
/lib/libc.so.6(cfree+0x59)[0xb7bbd9e9]
/usr/lib/libcurl.so.3[0xb72e37ae]
/usr/lib/libcurl.so.3(Curl_cookie_cleanup+0x3a)[0xb72e391a]
/usr/lib/libcurl.so.3(Curl_close+0x127)[0xb72f44e7]
/usr/lib/libcurl.so.3(curl_easy_cleanup+0x21)[0xb72ff421]
/usr/lib/httpd/modules/libphp5.so[0xb7478e77]
/usr/lib/httpd/modules/libphp5.so(list_entry_destructor+0xa3)[0xb75dd2c3]
/usr/lib/httpd/modules/libphp5.so(zend_hash_del_key_or_index+0x221)[0xb75dc751]
/usr/lib/httpd/modules/libphp5.so(_zend_list_delete+0x8a)[0xb75dd55a]
/usr/lib/httpd/modules/libphp5.so(_zval_dtor_func+0x9a)[0xb75cfefa]
/usr/lib/httpd/modules/libphp5.so(_zval_ptr_dtor+0x78)[0xb75c4598]
/usr/lib/httpd/modules/libphp5.so(zend_hash_destroy+0x47)[0xb75da697]
/usr/lib/httpd/modules/libphp5.so(_zval_dtor_func+0x50)[0xb75cfeb0]
/usr/lib/httpd/modules/libphp5.so(_zval_ptr_dtor+0x78)[0xb75c4598]
/usr/lib/httpd/modules/libphp5.so(zend_hash_destroy+0x47)[0xb75da697]
/u