Bug #61947 [Com]: curl Segmentation fault

2012-05-07 Thread ly...@php.net
Edit report at https://bugs.php.net/bug.php?id=61947&edit=1

 ID: 61947
 Comment by: ly...@php.net
 Reported by:ly...@php.net
 Summary:curl Segmentation fault
 Status: Feedback
 Type:   Bug
 Package:cURL related
 Operating System:   Linux
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

Short test script, for what its' worth:

http://www.6112northwolcott.com/curl_bug/test.phps

libcurl is 7.15.5 on both boxes.

I'll close this out.

SORRY!

I did search, but missed the other bug somehow.


Previous Comments:

[2012-05-07 16:05:04] ras...@php.net

The PHP version is less important than the libcurl version on this one.


[2012-05-07 16:03:19] ly...@php.net

I have reproduced this on an RHEL5.7 box with PHP 5.3.3

Still not supported, but getting closer...


[2012-05-05 15:28:01] ras...@php.net

There were known libcurl+curl_multi crashes in curl 7.15-7.19. See bug #47773


[2012-05-05 11:16:58] paj...@php.net

Please do it already, the shorter script we get, the easier it will be to work 
on 
a fix.


[2012-05-05 11:12:57] ly...@php.net

If it helps, I now have a script that crashes every time, with a similar 
backtrace.

Not a short script, mind you, but the libcurl bits aren't all that long either.

If I hear back from somebody that wants to look at it, I'll strip out the 
non-curl parts, see if it crashes, and put here.

Might just do that anyway, since I'm kind of stalled right now...




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=61947


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61947&edit=1


Bug #61947 [Com]: curl Segmentation fault

2012-05-07 Thread ly...@php.net
Edit report at https://bugs.php.net/bug.php?id=61947&edit=1

 ID: 61947
 Comment by: ly...@php.net
 Reported by:ly...@php.net
 Summary:curl Segmentation fault
 Status: Feedback
 Type:   Bug
 Package:cURL related
 Operating System:   Linux
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

I have reproduced this on an RHEL5.7 box with PHP 5.3.3

Still not supported, but getting closer...


Previous Comments:

[2012-05-05 15:28:01] ras...@php.net

There were known libcurl+curl_multi crashes in curl 7.15-7.19. See bug #47773


[2012-05-05 11:16:58] paj...@php.net

Please do it already, the shorter script we get, the easier it will be to work 
on 
a fix.


[2012-05-05 11:12:57] ly...@php.net

If it helps, I now have a script that crashes every time, with a similar 
backtrace.

Not a short script, mind you, but the libcurl bits aren't all that long either.

If I hear back from somebody that wants to look at it, I'll strip out the 
non-curl parts, see if it crashes, and put here.

Might just do that anyway, since I'm kind of stalled right now...


[2012-05-05 05:39:24] ly...@php.net

It is definitely the second one, with the POST that is crashing.

Repeatable.


[2012-05-05 05:00:00] ceo at l-i-e dot com

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.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=61947


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61947&edit=1


Bug #61947 [Com]: curl Segmentation fault

2012-05-04 Thread ceo at l-i-e dot com
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