cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: bugs in sample C code for fopen (again, with stack trace)

From: Dickerson <curl_at_ChinoHillsShopping.com>
Date: Mon, 03 May 2004 11:22:25 -0700

I assume that I am passing sensible data because I am using the demo source
and it works if I comment out the first pass. I have posted a copy of my
modified source at
        http://www.myownbusiness.org/tmp/fopen.c
if anyone wants to check it.

There is actually 2 versions of curl on the system, 7.9.5 and 7.11.2. The
sysadmin said that there were problems with upgrading the default curl on
system without upgrading the whole OS. Could this be causing the problem?
        [mobi_at_catlow forums]$ gcc -v
        Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
        gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)

        [mobi_at_catlow forums]$ uname -a
        Linux catlow.cyberverse.com 2.4.20-28.7 #1 Thu Dec 18 11:18:28 EST 2003 i686 unknown

        [mobi_at_catlow forums]$ /w2/m/www.myownbusiness.org/curl/bin/curl -V
        curl 7.11.2 (i386-redhat-linux-gnu) libcurl/7.11.2 OpenSSL/0.9.6b ipv6 zlib/1.1.4
        Protocols: ftp gopher telnet dict ldap http file https ftps
        Features: IPv6 SSL libz NTLM Largefile

        [mobi_at_catlow forums]$ curl -V
        curl 7.9.5 (i386-redhat-linux-gnu) libcurl 7.9.5 (OpenSSL 0.9.6b) (ipv6 enabled)

Just to make sure that I have all my flags correct, here is the compile and run:
        [mobi_at_catlow forums]$make fopen
        gcc -g -c fopen.c
        gcc -o fopen -g -L/w2/m/www.myownbusiness.org/curl/lib -lcurl -lssl -lcrypto -ldl fopen.o
        chmod 755 fopen

        [mobi_at_catlow forums]$./fopen
        Step d8
        Step d9
        Done 11
        Step d8
        Segmentation fault (core dumped)

Here is the stack trace:
        #0 0x4002285a in Curl_resolv () from /usr/lib/libcurl.so.2
        #1 0x4002d242 in CreateConnection () from /usr/lib/libcurl.so.2
        #2 0x4002d6b1 in Curl_connect () from /usr/lib/libcurl.so.2
        #3 0x40037d50 in curl_multi_perform () from /usr/lib/libcurl.so.2
        #4 0x08049039 in url_fopen (url=0x8049980 "http://www.myownbusiness.org/index.html", operation=0x80499e3 "r")
            at fopen.c:235
        #5 0x08049670 in main (argc=1, argv=0xbffff6c4) at fopen.c:467
        #6 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6

When should I post this to the bug page?

Thanks,
Dan

Daniel Stenberg wrote:
> On Mon, 3 May 2004, Dickerson wrote:
>
>>In the "fread" pass it dies when it calls url_fopen and tries to execute
>>the line:
>
>> while(curl_multi_perform(multi_handle, &file->still_running) ==
>>CURLM_CALL_MULTI_PERFORM );
>
>
>>and outputs:
>> Segmentation fault (core dumped)
>
>
> Hoa! This is indeed badness. Can you just verify that you pass in sensible
> data to libcurl here, and if you do, can you produce a stack trace from the
> core dump? (see docs/BUGS)
>
Received on 2004-05-03