cURL / Mailing Lists / curl-users / Single Mail

curl-users

Curl segmentation fault when curl_easy_cleanup

From: Shrek Qian <qianshiyang_at_gmail.com>
Date: Tue, 1 Dec 2009 18:02:05 +0800

Hi, everyone.

This is Shrek. Now I have this issue, anyone can help me?

One thread is waiting at curl_easy_perform(), then another thread trying to
clean up this curl handle, then coredump. The curl_easy_perform() returned
with error string "failed sending data to the peer".

The back trace is as below
#0 0x118dd7f2 in ?? ()
#1 0x11b287d1 in abort () from /root/sfcdb_gdb/208777_esx40u2/lib/libc.so.6
#2 0x11b5f33b in ?? () from /root/sfcdb_gdb/208777_esx40u2/lib/libc.so.6
#3 0x11b6718d in ?? () from /root/sfcdb_gdb/208777_esx40u2/lib/libc.so.6
#4 0x11b6ad80 in free () from /root/sfcdb_gdb/208777_esx40u2/lib/libc.so.6
#5 0x154f8014 in Curl_safefree () from
/root/sfcdb_gdb/208777_esx40u2/lib/libcurl.so.4
#6 0x154f86ec in ?? () from /root/sfcdb_gdb/208777_esx40u2/lib/libcurl.so.4
#7 0x154f87ee in Curl_rm_connc () from
/root/sfcdb_gdb/208777_esx40u2/lib/libcurl.so.4
#8 0x154fa549 in Curl_close () from
/root/sfcdb_gdb/208777_esx40u2/lib/libcurl.so.4
#9 0x15507631 in curl_easy_cleanup () from
/root/sfcdb_gdb/208777_esx40u2/lib/libcurl.so.4
..........................................................

I knew basic rule is that you must never share a libcurl handle (be it easy
or multi or whatever) between multiple threads. But I think if we required
to terminated all connections in one thread to invoke cleanup is reasonable,
and the existed code is hard to modify. Do you have any suggestion about the
core and potential fix?

Thanks & best wishes.

Shrek Qian

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-12-01