[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Diffs for running svnserve as a Win32 service

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2006-02-24 21:49:17 CET

On 2/24/06, Arlie Davis <adavis@stonestreetone.com> wrote:

> Second, the call to closesocket. The current technique for stopping
> svnserve is not pretty, but I don't see a better way to do it.
> Calling apr_socket_close could actually cause a serious program
> (segmentation fault), because main() (and the functions that it
> calls) would exit the loop and would very likely touch fields within
> the apr_socket_t instance. If the service dispatcher thread freed
> that memory, by calling apr_socket_close, then main() would be
> touching freed memory. But by closing the socket handle, we insure
> that this cannot happen -- the worst thing that happens is that
> the socket *handle* (not structure) gets closed twice, which is ok.

If main is touching fields with the socket after an error is returned
from accept, then that's a bug in main. If an error isn't returned
from accept when the socket is closed via apr_socket_close, that seems
kind of odd to me, and should be investigated. Regardless, if you're
putting a "clean shutdown" feature into svnserve it should work on all
platforms, not just Win32.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 24 21:50:22 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.