You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@serf.apache.org by rh...@apache.org on 2016/09/02 08:43:31 UTC

svn commit: r1758902 - /serf/branches/1.3.x/test/server/test_server.c

Author: rhuijben
Date: Fri Sep  2 08:43:31 2016
New Revision: 1758902

URL: http://svn.apache.org/viewvc?rev=1758902&view=rev
Log:
On the 1.3.x branch: Apply the test server fix from r1711233, of
dropping APR_SO_REUSEADDR on binding an address.

See http://stackoverflow.com/a/14388707/2094 for a great summary of how
this flag behaves on different operating systems. And in our case we
just want a unique port, with a mostly stable number.

With this flag applied, tests running in parallel might just connect
with the wrong webserver.

* server/test_server.c
  (start_test_server): Don't set APR_SO_REUSEADDR.

Modified:
    serf/branches/1.3.x/test/server/test_server.c

Modified: serf/branches/1.3.x/test/server/test_server.c
URL: http://svn.apache.org/viewvc/serf/branches/1.3.x/test/server/test_server.c?rev=1758902&r1=1758901&r2=1758902&view=diff
==============================================================================
--- serf/branches/1.3.x/test/server/test_server.c (original)
+++ serf/branches/1.3.x/test/server/test_server.c Fri Sep  2 08:43:31 2016
@@ -650,7 +650,6 @@ apr_status_t start_test_server(serv_ctx_
 
     apr_socket_opt_set(serv_sock, APR_SO_NONBLOCK, 1);
     apr_socket_timeout_set(serv_sock, 0);
-    apr_socket_opt_set(serv_sock, APR_SO_REUSEADDR, 1);
 
     status = apr_socket_bind(serv_sock, servctx->serv_addr);
     if (status != APR_SUCCESS)



Re: svn commit: r1758902 - /serf/branches/1.3.x/test/server/test_server.c

Posted by Andreas Stieger <An...@gmx.de>.
Hi,

> URL: http://svn.apache.org/viewvc?rev=1758902&view=rev
> Log:
> On the 1.3.x branch: Apply the test server fix from r1711233, of
> dropping APR_SO_REUSEADDR on binding an address.

> -    apr_socket_opt_set(serv_sock, APR_SO_REUSEADDR, 1);

This change segfaults for me:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff70d58e1 in impl_pollset_add (pollset=0x7ffff7fa30a0, descriptor=0x7fffffffda00)
    at poll/unix/epoll.c:174
174             ret = epoll_ctl(pollset->p->epoll_fd, EPOLL_CTL_ADD,

with libapr1 1.5.1, openssl 1.0.2j on openSUSE Leap 42.2

r1711233 mentions a segfault fix on on the trunk code:
  (_mhRunServerLoop): Avoid segfault when called after setupTCPServer fails

Is there something equivalent on the previous code in 1.3.x?

Andreas