cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[ curl-Bugs-3474319 ] SMTP & IMAP4 will hang at curl_multi_remove_handle

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Sun, 15 Jul 2012 13:08:41 -0700

Bugs item #3474319, was opened at 2012-01-15 23:26
Message generated for change (Settings changed) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3474319&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: hang
>Status: Closed
Resolution: Out of Date
Priority: 5
Private: No
Submitted By: Nash Tsai (nash_c)
Assigned to: Daniel Stenberg (bagder)
Summary: SMTP & IMAP4 will hang at curl_multi_remove_handle

Initial Comment:
SMTP & IMAP4 will hang at curl_multi_remove_handle, when the connected server is not really the SMTP/IMAP4 server, in our case we accidentally discovered when trying to connect SMTPS and IMAP4S server without specify "smtps://" and "imap4s://" in the url.

Following are the hang call stack:

#0  0x00007ffff6801773 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007ffff764c55c in Curl_socket_ready () from /usr/local/lib/libcurl.so.4
#2  0x00007ffff7652892 in Curl_pp_easy_statemach () from /usr/local/lib/libcurl.so.4
#3  0x00007ffff764ffba in imap_easy_statemach () from /usr/local/lib/libcurl.so.4
#4  0x00007ffff765002b in imap_disconnect () from /usr/local/lib/libcurl.so.4
#5  0x00007ffff763629d in Curl_disconnect () from /usr/local/lib/libcurl.so.4
#6  0x00007ffff763c13b in Curl_done () from /usr/local/lib/libcurl.so.4
#7  0x00007ffff7649e0f in curl_multi_remove_handle () from /usr/local/lib/libcurl.so.4

[1/16/12 3:04:38 PM] yaoxing: #0  0x00007ffff6801773 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007ffff764c55c in Curl_socket_ready () from /usr/local/lib/libcurl.so.4
#2  0x00007ffff7652892 in Curl_pp_easy_statemach () from /usr/local/lib/libcurl.so.4
#3  0x00007ffff76511df in smtp_easy_statemach () from /usr/local/lib/libcurl.so.4
#4  0x00007ffff7651233 in smtp_disconnect () from /usr/local/lib/libcurl.so.4
#5  0x00007ffff763629d in Curl_disconnect () from /usr/local/lib/libcurl.so.4
#6  0x00007ffff763c13b in Curl_done () from /usr/local/lib/libcurl.so.4
#7  0x00007ffff7649e0f in curl_multi_remove_handle () from /usr/local/lib/libcurl.so.4

I've got a tmp work around as following diff:

diff --git a/contrib/curl-7.23.1/lib/imap.c
index ab53c9d..4b8f7c3 100644
--- a/mite_agent/contrib/curl-7.23.1/lib/imap.c
+++ b/mite_agent/contrib/curl-7.23.1/lib/imap.c
@@ -904,7 +904,7 @@ static CURLcode imap_logout(struct connectdata *conn)
   result = imapsendf(conn, str, "%s LOGOUT", str, NULL);
   if(result)
     return result;
- state(conn, IMAP_LOGOUT);
+ state(conn, IMAP_STOP);
 
   result = imap_easy_statemach(conn);
 
diff --git a/curl-7.23.1/lib/smtp.c
index ea6bafa..232e82d 100644
--- a/mite_agent/contrib/curl-7.23.1/lib/smtp.c
+++ b/mite_agent/contrib/curl-7.23.1/lib/smtp.c
@@ -1491,7 +1491,7 @@ static CURLcode smtp_quit(struct connectdata *conn)
   result = Curl_pp_sendf(&conn->proto.smtpc.pp, "QUIT");
   if(result)
     return result;
- state(conn, SMTP_QUIT);
+ state(conn, SMTP_STOP);
 
   result = smtp_easy_statemach(conn);
 

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2012-07-08 06:39

Message:
Thanks for reporting this issue and helping us improve curl and libcurl.

We're awaiting feedback in this issue. Due to this, I have set the state of
this issue to pending and it will automatically get closed later on unless
we get further info.

Please consider answering the outstanding questions or providing the
missing info so that we can proceed to resolve this issue!

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2012-05-06 15:22

Message:
Hi, sorry for the LOOONG delay. Can you please submit an example source
code showing this problem against a publicly available URL/server?

----------------------------------------------------------------------

Comment By: Nash Tsai (nash_c)
Date: 2012-01-15 23:28

Message:
cURL version 7.23.1, OS: Linux 2.6.32 & 3.0 kernel

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3474319&group_id=976
Received on 2012-07-15

These mail archives are generated by hypermail.

donate! Page updated January 05, 2012.
web site info

File upload with ASP.NET