cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: segfault, glibc corruption, redhat

From: Jon Drukman <jdrukman_at_gmail.com>
Date: Thu, 04 Sep 2008 10:38:59 -0700

Daniel Stenberg wrote:
> On Wed, 3 Sep 2008, Jon Drukman wrote:
>
>> I can't reproduce it with a simple test case, only using our entire
>> codebase causes it to happen.
>>
>> I tried recompiling the entire chain of apps including openssl,
>> apache, php and libcurl. Didn't solve it.
>>
>> Any ideas where to look? I'm happy to provide any info I can dig up.
>> Let me know, thanks.
>
> First you of course use recent versions of all components?

Yes.

> To catch this problem, I'd probably advice you to rebuild OpenSSL with
> -DPURIFY during debugging as then you can run the entire thing through
> valgrind and see what warnings it'll show you.

I rebuilt libcurl without ssl because I've already written my own simple
https functions (to try to eliminate ssl as a source of the curl issue).

> Oh, I'd of course also recommend you fixing a test cast that is as
> simple as possible, and a start would be to run php from a command line
> and etc to see what you can rule out.

Yep, see above - I can only get it to trigger when used as part of our site.

> If nothing of that helps, there's just traditional debugging with a good
> old debugger that's left.

I'm not much of a gdb expert but I did manage to trigger a segfault and
get a backtrace. Does this tell you anything useful?

(gdb) run -X
Starting program: /jsd/apps/apache/bin/httpd -X
[Thread debugging using libthread_db enabled]
[New Thread 47935240952912 (LWP 12035)]
[Thu Sep 04 12:35:35 2008] [warn] module php5_module is already loaded,
skipping

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47935240952912 (LWP 12035)]
0x0000003977c61cda in fwrite () from /lib64/libc.so.6
(gdb) bt
#0 0x0000003977c61cda in fwrite () from /lib64/libc.so.6
#1 0x00002b98d031d6d4 in showit (data=0x12661680, type=<value optimized
out>,
     ptr=0x7fffe0311330 "About to connect() to gdata.youtube.com port 80
(#0)\n", size=53) at sendf.c:679
#2 0x00002b98d031d766 in Curl_debug (data=0x12661680, type=CURLINFO_TEXT,
     ptr=0x7fffe0311330 "About to connect() to gdata.youtube.com port 80
(#0)\n", size=53, conn=0x2b98cb025c50)
     at sendf.c:726
#3 0x00002b98d031e26e in Curl_infof (data=0x12661680, fmt=<value
optimized out>) at sendf.c:235
#4 0x00002b98d03257bd in Curl_connect (data=<value optimized out>,
in_connect=0x1283b688,
     asyncp=<value optimized out>, protocol_done=0x7fffe03118c5) at
url.c:2637
#5 0x00002b98d033351e in multi_runsingle (multi=0x1261d6f0,
easy=0x1283b670) at multi.c:926
#6 0x00002b98d03339f0 in curl_multi_perform (multi_handle=0x1261d6f0,
running_handles=0x7fffe031198c) at multi.c:1460
#7 0x00002b98cfbe8153 in zif_curl_multi_exec (ht=<value optimized out>,
return_value=0x12629010,
     return_value_ptr=<value optimized out>, this_ptr=<value optimized
out>, return_value_used=<value optimized out>)
     at /home/jsd/build/php-5.2.6/ext/curl/multi.c:216
#8 0x00002b98cfe0e052 in zend_do_fcall_common_helper_SPEC
(execute_data=0x7fffe0312c10)
     at /home/jsd/build/php-5.2.6/Zend/zend_vm_execute.h:200

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-09-04