cURL / Mailing Lists / curl-library / Single Mail


Re: libcurl strange behaviour

From: Daniel Stenberg <>
Date: Fri, 16 Nov 2001 08:17:33 +0100 (MET)

On Thu, 15 Nov 2001, Julien MOUTTE wrote:

> Here is the backtrace from gdb :

Yeah, but did you someone ruin the symbols or compile with -O2 or something?
Look at how almost every frame is said to be on eval.c:41...

BTW, did you ever say which operating system this is? What
HAVE_GETHOSTBYNAME_R_? define do you have set? It is Linux and it is

> Program received signal SIGSEGV, Segmentation fault.
> 0x400c5531 in chunk_alloc (ar_ptr=0x4017d060, nb=32) at malloc.c:2878
> 2878 malloc.c: No such file or directory.
> #0 0x400c5531 in chunk_alloc (ar_ptr=0x4017d060, nb=32) at malloc.c:2878
> #1 0x400c5338 in __libc_malloc (bytes=25) at malloc.c:2811
> #2 0x4000ac99 in _dl_new_object () at eval.c:41
> #3 0x4000630e in _dl_map_object_from_fd () at eval.c:41
> #4 0x40007a39 in _dl_map_object () at eval.c:41
> #5 0x401607ec in dl_open_worker (a=0xbfffef50) at dl-open.c:217
> #6 0x4000d833 in _dl_catch_error () at eval.c:41
> #7 0x40160cde in _dl_open (file=0xbffff0d0 "", mode=1,
> caller=0x0) at dl-open.c:407
> #8 0x40161b41 in do_dlopen (ptr=0xbffff0a0) at dl-libc.c:78
> #9 0x4000d833 in _dl_catch_error () at eval.c:41
> #10 0x401619ec in __libc_dlopen (__name=0xbffff0d0 "")
> at dl-libc.c:42
> #11 0x40142def in __nss_lookup_function (ni=0x80574b0,
> fct_name=0x4017721c "gethostbyname_r") at nsswitch.c:340
> #12 0x40143821 in __nss_next (ni=0xbffff190,
> fct_name=0x4017721c "gethostbyname_r", fctp=0xbffff194, status=0,
> all_values=0) at nsswitch.c:194
> #13 0x401460ed in __gethostbyname_r (name=0x805d874 "",
> resbuf=0x805dc40, buffer=0x805dc54 "дь+c", buflen=8980, result=0xbffff1d4,
> h_errnop=0xbffff1d8) at ../nss/getXXbyYY_r.c:215
> #14 0x4002bfac in Curl_getaddrinfo () at eval.c:41


I'm afraid that the input data to the gethostbyname_r() function looks ok
from here.

The lack of input arguments in the dump here indicates that it lacks debug

> Any idea :))

I wish. But as I wrote in my previous reply, try HTTP only, try rebuilding
libcurl with -g and without -O2 and see if you can get another dump.

I think this looks like a memory/buffer overrun somewhere, as it is a malloc
operation that fails. It usually indicates that somone has ruined a memory
block/list earlier.

It may be your program, curl or whatever. To be frank, I think your program
is the most likely. :-)

    Daniel Stenberg -- curl groks URLs --
Received on 2001-11-16