cURL / Mailing Lists / curl-library / Single Mail

curl-library

couldn't resolve host s3.amazonaws.com

From: Matthias Brantner <mbrantner_at_gmail.com>
Date: Fri, 9 Jan 2009 10:58:45 -0800

Hello,

I'm developing a C++ library (libaws) on top of libcurl for
interfacing with the Amazon Web Services. With this library, I created
a fuse-based file system for S3. It seems to work quite well. However,
after doing a few hundred requests, libcurl suddenly starts to return
the error code 6 (CURLE_COULDNT_RESOLVE_HOST).

I'm running Ubuntu 8.10 having libcurl4 installed. In order to make
sure that I didn't do any obvious mistakes, I ran the file system with
valgrind. The first warnings and error valgrind reports are the
following:

==6168== Warning: invalid file descriptor 1019 in syscall socket()
==6168== Warning: invalid file descriptor 1019 in syscall socket()
==6168== Warning: invalid file descriptor 1019 in syscall open()
==6168== Warning: invalid file descriptor 1019 in syscall open()
==6168== Warning: invalid file descriptor 1019 in syscall socket()
==6168== Warning: invalid file descriptor 1019 in syscall socket()
==6168== Warning: invalid file descriptor 1019 in syscall open()
==6168== Warning: invalid file descriptor 1019 in syscall open()
==6168==
==6168== Thread 5:
==6168== Invalid read of size 4
==6168== at 0x40157F3: (within /lib/ld-2.8.90.so)
==6168== by 0x4626DE1: (within /lib/libc-2.8.90.so)
==6168== by 0x400D715: (within /lib/ld-2.8.90.so)
==6168== by 0x4626EE0: (within /lib/libc-2.8.90.so)
==6168== by 0x4627005: __libc_dlopen_mode (in /lib/libc-2.8.90.so)
==6168== by 0x46006A6: __nss_lookup_function (in /lib/libc-2.8.90.so)
==6168== by 0x4600F30: __nss_next2 (in /lib/libc-2.8.90.so)
==6168== by 0x460720C: gethostbyname2_r (in /lib/libc-2.8.90.so)
==6168== by 0x45D7A46: (within /lib/libc-2.8.90.so)
==6168== by 0x45D9F80: getaddrinfo (in /lib/libc-2.8.90.so)
==6168== by 0x41242F6: (within /usr/lib/libcurl.so.4.1.0)
==6168== by 0x40F9BC5: (within /usr/lib/libcurl.so.4.1.0)
==6168== Address 0x898e570 is 48 bytes inside a block of size 49
alloc'd
==6168== at 0x4025D2E: malloc (vg_replace_malloc.c:207)
==6168== by 0x400D823: (within /lib/ld-2.8.90.so)
==6168== by 0x4008235: (within /lib/ld-2.8.90.so)
==6168== by 0x40118E6: (within /lib/ld-2.8.90.so)
==6168== by 0x400D715: (within /lib/ld-2.8.90.so)
==6168== by 0x40112ED: (within /lib/ld-2.8.90.so)
==6168== by 0x4626DE1: (within /lib/libc-2.8.90.so)
==6168== by 0x400D715: (within /lib/ld-2.8.90.so)
==6168== by 0x4626EE0: (within /lib/libc-2.8.90.so)
==6168== by 0x4627005: __libc_dlopen_mode (in /lib/libc-2.8.90.so)
==6168== by 0x46006A6: __nss_lookup_function (in /lib/libc-2.8.90.so)
==6168== by 0x4600F30: __nss_next2 (in /lib/libc-2.8.90.so)

libcurl reports the same error (i.e. CURLE_COULDNT_RESOLVE_HOST) for
every subsequent request (each of which is using a new curl handle).
For each of those requests, valgrind reports the warnings shown above
but doesn't report the "invalid read of size 4" again.

Does anybody have an idea what I could be doing wrong? I already tried
to set the CURLOPT_DNS_CACHE_TIMEOUT to 0.

Thanks in advance for any help.

Matthias
Received on 2009-01-09