krime / serf

Automatically exported from code.google.com/p/serf
Apache License 2.0
1 stars 0 forks source link

double close() with second calling close(-1) #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. any use of the library will cause a double-close() on context desctruction

Original issue reported on code.google.com by postw...@gmail.com on 27 Apr 2008 at 1:47

Attachments:

GoogleCodeExporter commented 9 years ago
Applied in r1182.  Thanks!

Original comment by justin.e...@gmail.com on 1 May 2008 at 5:14

GoogleCodeExporter commented 9 years ago
This fix breaks the test_serf_closed_connection test. While it's possible that 
it's
just the test, a first look into the code seems to point to an issue in the 
pollset
handling.

Original comment by lieven.govaerts@gmail.com on 18 May 2008 at 9:49

GoogleCodeExporter commented 9 years ago

Original comment by lieven.govaerts@gmail.com on 18 May 2008 at 9:49

GoogleCodeExporter commented 9 years ago
looks like we should use the following patch to fix the dirty pollset check:

on my machine, it can help me to avoid core dump when serf_context_run.

Index: outgoing.c
===================================================================
--- outgoing.c  (revision 1421)
+++ outgoing.c  (working copy)
@@ -58,6 +58,9 @@
     serf_context_t *ctx = conn->ctx;
     apr_status_t status;
     apr_pollfd_t desc = { 0 };
+   if ( !conn->httpconn ) {
+        return APR_SUCCESS;
+   }
     apr_socket_t *skt = serf_httpconn_socket(conn->httpconn);

     if (!skt) {

Original comment by luoyi...@gmail.com on 27 Dec 2010 at 4:08