cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl_compareheader SIGSEGV

From: jose <jjmmes_at_yahoo.es>
Date: Fri, 7 Mar 2003 15:15:04 +0100 (CET)

Hi David,

Thanks for your assistance.

I can get the local infos ok now ! (I had a version of
curl installed via rpm that I removed and reinstalled
curl beta with configure --enable-debug again)

Enclosed is stack trace locals for the last 3 frames.
Before recompiling my app.

After recompiling, it looks like the problem is gone.

Thanks again.

 Program received signal SIGSEGV, Segmentation fault.
0x402ab321 in strncasecmp () from /lib/libc.so.6
(gdb) bt
#0 0x402ab321 in strncasecmp () from /lib/libc.so.6
#1 0x4003b7f9 in curl_strnequal (first=0x4e2d6649
<Address 0x4e2d6649 out of bounds>, second=0x4003e3be
"User-Agent:",
    max=11) at strequal.c:52
#2 0x4002aa70 in checkheaders (data=0x4e2d6649,
thisheader=0x4003e3be "User-Agent:") at http.c:366
#3 0x4002b168 in Curl_http (conn=0x808e6d8) at
http.c:654
#4 0x400323aa in Curl_do (connp=0x80c0774) at
url.c:2975
#5 0x4003d428 in curl_multi_perform
(multi_handle=0x8074390, running_handles=0xbffff2bc)
at multi.c:363
#6 0x0804d2d7 in CurlHttp::ActivatePump()
(this=0x806aee0) at http.cc:394
#7 0x0805aff6 in main (argc=2, argv=0x264) at
http.hh:207
#8 0x4024e4dd in __libc_start_main () from
/lib/libc.so.6

(gdb) frame 3
#3 0x4002b168 in Curl_http (conn=0x808e6d8) at
http.c:654
654 http.c: No such file or directory.
        in http.c
Current language: auto; currently c
(gdb) info locals
data = (struct SessionHandle *) 0x80af9f0
buf = 0x80b006c "HTTP/1.1 304 Not Modified\r\nDate:
Fri, 07 Mar 2003 14:07:14 GMT\r\nServer: Apache/2.0.40
(Red Hat Linux)\r\nConnection: close\r\nETag:
\"cae1-1177-21f1e4c0\"\r\n\r\n"
result = 134801112
http = (struct HTTP *) 0x80ae688
co = (struct Cookie *) 0x0
ppath = 0x808ecd0 "/Activ/index.html"
host = 0x808e738 "ic"
te = 0x4003df22 ""

 --- Daniel Stenberg <daniel_at_haxx.se> escribió: > On
Fri, 7 Mar 2003, jose wrote:
>
> > 2. offending piece of C++ that causes the problem
> and local vars (can not
> > provide more source as I am modifying someone
> else's)
>
> Well, if you can write a small program that
> reprodoces this problem it would
> make things a lot easier. I suggest you put more
> focus on that part, as if
> you can make others repeat your problem we can debug
> it in parallell.
>
>
> > #1 0x4003a593 in curl_strnequal () from
> > /usr/lib/libcurl.so.2
> > #2 0x40029c30 in Curl_compareheader () from
> > /usr/lib/libcurl.so.2
>
> --enable-debug should compile and build curl with
> debug symbols, and then the
> above should be more detailed... I can't say why it
> doesn't work for you...
>
> > 394 while( ( mstate =
> curl_multi_perform(
> > hmulti, &num ) ) != CURLM_CALL_MULTI_PERFORM &&
> num != 0);
>
> This condition looks incorrect. You should call
> curl_multi_perform() again if
> it returns CURLM_CALL_MULTI_PERFORM, while this
> looks like the complete
> opposite... Of course, it is taken out of a context
> I don't see.
>
> > What do I need to enable in curl to be able to
> view the locals ?
>
> Make sure that all libcurl is built with the -g
> option to the compiler.
>
> --
> Daniel Stenberg -- curl, cURL, Curl, CURL. Groks
> URLs.
>
>
>
-------------------------------------------------------
> This SF.net email is sponsored by: Etnus, makers of
> TotalView, The debugger
> for complex code. Debugging C/C++ programs can leave
> you feeling lost and
> disoriented. TotalView can help you find your way.
> Available on major UNIX
> and Linux platforms. Try it free. www.etnus.com
>

___________________________________________________
Yahoo! Móviles
Personaliza tu móvil con tu logo y melodía favorito
en http://moviles.yahoo.es

-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
for complex code. Debugging C/C++ programs can leave you feeling lost and
disoriented. TotalView can help you find your way. Available on major UNIX
and Linux platforms. Try it free. www.etnus.com
Received on 2003-03-07