cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl crash when dns resolution fails

From: Priyanka Shah <priyanka_at_insiemenetworks.com>
Date: Sun, 29 Jun 2014 18:14:55 -0700

Hi,
I have a program that uses libcurl to send a bunch of messages over smtp.
In one particular case, I noticed libcurl crash with signal 11 with the
following stack trace:

Program terminated with signal 11, Segmentation fault.
#0 0x2061e2f0 in ?? ()
(gdb) bt
#0 0x2061e2f0 in ?? ()
#1 0x41b74c64 in _res () from /lib/libc.so.6
#2 0x410143b0 in ?? () from /lib/ld-linux.so.2
#3 0xf35922fe in ?? () from /lib/libresolv.so.2
#4 0xf358fa17 in __libc_res_nquery () from /lib/libresolv.so.2
#5 0xf359005e in ?? () from /lib/libresolv.so.2
#6 0xf3590540 in __libc_res_nsearch () from /lib/libresolv.so.2
#7 0xbb036118 in _nss_dns_gethostbyname3_r () from /lib/libnss_dns.so.2
#8 0xbb0363cf in _nss_dns_gethostbyname2_r () from /lib/libnss_dns.so.2
#9 0x41ad3994 in gethostbyname2_r () from /lib/libc.so.6
#10 0x41a971c9 in ?? () from /lib/libc.so.6
#11 0x41a983fd in getaddrinfo () from /lib/libc.so.6
#12 0xf35e01f0 in Curl_getaddrinfo_ex () from /usr/lib/libcurl.so.5
#13 0xf35d6227 in Curl_ipv4_resolve_r () from /usr/lib/libcurl.so.5
#14 0xf35d6264 in Curl_getaddrinfo () from /usr/lib/libcurl.so.5
#15 0xf35a79c0 in Curl_resolv () from /usr/lib/libcurl.so.5
#16 0xf35a7c88 in Curl_resolv_timeout () from /usr/lib/libcurl.so.5
#17 0xf35bbff8 in create_conn () from /usr/lib/libcurl.so.5
#18 0xf35bec5c in Curl_connect () from /usr/lib/libcurl.so.5
#19 0xf35cad11 in Curl_do_perform () from /usr/lib/libcurl.so.5
#20 0xf35cba43 in curl_easy_perform () from /usr/lib/libcurl.so.5

I am using libcurl-7.28.1. I know that hostname resolution was failing on
this particular setup due to dns connectivity.

# curl --version
curl 7.28.1 (i586-wrs-linux-gnu) libcurl/7.28.1 OpenSSL/1.0.1e zlib/1.2.6
libssh2/1.4.2
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3
pop3s rtsp scp sftp smtp smtps telnet tftp
Features: NTLM NTLM_WB SSL libz TLS-SRP

How do I debug what happened here?

Thanks,
Priyanka.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-06-30