cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl-7.17.1 crashes on getprotobyname() problem in RHEL5.1

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 2 May 2008 11:24:13 -0700

On Fri, May 02, 2008 at 11:26:04AM -0400, Jean-François Bertrand wrote:
> -- Problem description --
> libcurl is causing segfault on calls to getprotobyname("ftp") when doing
> simultaneous access (from many threads) to unavailable HTTP resources
> using libcurl-7.17.1. This occurs with RedHat Enterprise Linux 5.1
> running on quad-core Intel(R) Xeon(R) CPU 5150 @ 2.66GHz system.
>
>
> -- Build options --
> Curl was built with the following option:
> export CC=gcc
> export CFLAGS="-g -O2"
> ./configure --without-zlib --without-ssl --prefix=$CURL_ROOT
> --disable-shared --disable-gopher --disable-ldap --disable-dict
> --disable-telnet --disable-debug --enable-thread
> make
> make install
>
>
> -- Stack trace --
> Here is a typical stack trace we would get when this problem occurred:
>
> (gdb) bt
> #0 0x00002aaaabab3edd in fgets () from /lib64/libc.so.6
> #1 0x000000000088ebbf in pr_next (this=0x2aafbc1c9ec3) at lcl_pr.c:209
> #2 0x000000000088edd0 in pr_byname (this=0x1c493630, name=0xa08b90
> "tcp") at lcl_pr.c:158
> #3 0x0000000000886654 in pr_byname (this=0x2aafbc1c9ec3, name=0xa08b90
> "tcp") at gen_pr.c:140
> #4 0x0000000000872e3e in getprotobyname (name=0xa08b90 "tcp") at
> getprotoent.c:111
> #5 0x000000000083e34a in tcpnodelay (conn=0x2aafbc1c9ec3, sockfd=9213)
> at connect.c:630

It looks like your app is linking against the ISC bind resolver instead of
glibc's NSS resolver. A quick look of the ISC source leads me to believe
that it isn't thread safe, which would explain the crashes you're seeing
in your multithreaded app.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-05-02