cURL / Mailing Lists / curl-library / Single Mail

curl-library

Odd Pause During HTTPS POST

From: Seth Ladd <seth_at_brivo.net>
Date: Tue, 04 Mar 2003 16:29:13 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I hope to describe this problem clearly enough, for I admit it's very odd.

I am running on Linux 2.4.20, libcurl 7.10.3 (tarball), and a custom app
written in c/c++.

I am using CA certs w/ SSL, which is working nicely. I know this
because I turned on curl debugging.

When I POST two files in a row (thus using pipelining), the first one
succeeds, and the second one causes the fread call in transfer.c (~ line
144) to pause and never return. Sometimes, it segfaults.

When I wait enough for the connection to close, the second POST of the
file succeeds.

Using gdb, I print this out when I see the pause:

XXX - before fread 16384

Program received signal SIGINT, Interrupt.
[Switching to Thread 1077530048 (LWP 27717)]
0xffffe002 in ?? ()
(gdb) where
#0 0xffffe002 in ?? ()
#1 0x40166350 in fillbuffer (conn=0x8080ba8, bytes=16384) at transfer.c:140
#2 0x40167072 in Curl_readwrite (conn=0x8080ba8, done=0xbfff018f "")
~ at transfer.c:952
#3 0x401680b1 in Transfer (conn=0x8080ba8) at transfer.c:1251
#4 0x40168692 in Curl_perform (data=0x806b878) at transfer.c:1590
#5 0x40168a14 in curl_easy_perform (curl=0x806b878) at easy.c:247
#6 0x401503b0 in Central::Put(CentralMsgType*, char const*)
(this=0xbfff0ac8,
~ msg=0xbfff0bd4) at __central.cpp:325
#7 0x40150e3a in BrivoComms::Put(CentralMsgType*) (this=0xbfff0ac8,
~ msg=0xfffffffc) at comms.cpp:124
#8 0x0804b928 in UpStream::TaskHTTP() (this=0xbfff0890) at upstream.cpp:204
#9 0x0804bf2e in main (argc=1, argv=0xbfffdf54) at upstream.cpp:328
#10 0x420154a0 in __libc_start_main () from /lib/tls/libc.so.6
(gdb) quit

The above debug (XXX) is from inside the curl library. I placed that
inside transfer.c around line 144. It looks like this:

~ printf("XXX - before fread %d\n" , buffersize);

~ nread = conn->fread(conn->upload_fromhere, 1,
~ buffersize, conn->fread_in);
~ printf("XXX - after fread %d\n", nread);

Notice how the second XXX never shows up.

Here is some gdb output from when the process sefaults. Notice how it
reuses the connection, and then fails on the fopen.

* Re-using existing connection! (#0)
* Connected to (192.168.192.201) port 443
| POST /service/indications HTTP/1.1
Authorization: Basic ODg3ODQ6ODg3ODQ=
Host: mpdev00.brivo.net
Pragma: no-cache
Content-Type: application/rdf+xml
Accept: application/rdf+xml
Content-Length: 996

XXX - before fread 16384

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1077530048 (LWP 29307)]
0x42062611 in fread () from /lib/tls/libc.so.6
(gdb) where
#0 0x42062611 in fread () from /lib/tls/libc.so.6
#1 0x40166356 in fillbuffer (conn=0x8080bb8, bytes=16384) at transfer.c:139
#2 0x40167056 in Curl_readwrite (conn=0x8080bb8, done=0xbfff008f "")
~ at transfer.c:951
#3 0x40168095 in Transfer (conn=0x8080bb8) at transfer.c:1250
#4 0x40168676 in Curl_perform (data=0x806b878) at transfer.c:1589
#5 0x401689f8 in curl_easy_perform (curl=0x806b878) at easy.c:247
#6 0x401503b0 in Central::Put(CentralMsgType*, char const*)
(this=0xbfff09c8,
~ msg=0xbfff0ad4) at __central.cpp:325
#7 0x40150e3a in BrivoComms::Put(CentralMsgType*) (this=0xbfff09c8,
msg=0x0)
~ at comms.cpp:124
#8 0x0804b928 in UpStream::TaskHTTP() (this=0xbfff0790) at upstream.cpp:204
#9 0x0804bf2e in main (argc=1, argv=0xbfffde54) at upstream.cpp:328
#10 0x420154a0 in __libc_start_main () from /lib/tls/libc.so.6

Does any of this ring a bell? Does anyone have any tips or hints? I'm
sure it's related to something silly I'm doing. I've tested the FILE
handle to make sure it's not null before I give it to curl in
curl_easy_setopt(curl, CURLOPT_READDATA, input).

If you request any other information, I would be happy to provide it.

Thanks very much,
Seth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAj5lGqkACgkQNx3GJTf/82W3SACgke4XgrOMHF3YzWxlUKXPdgkG
wg0An3PhAJf93J0LS895T+8N/AlSh7Zi
=Ybzy
-----END PGP SIGNATURE-----

-------------------------------------------------------
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-04