On Sun, May 5, 2013 at 6:36 PM, Ivan Zhakov <[email protected]> wrote:
> On Sat, May 4, 2013 at 4:01 PM, Ivan Zhakov <[email protected]> wrote:
>> On Sat, May 4, 2013 at 4:34 AM, Ben Reser <[email protected]> wrote:
>>> Here it is: the first Release Candidate for Subversion 1.8.0. You can
>>> fetch the proposed tarballs from here:
>>> https://dist.apache.org/repos/dist/dev/subversion
>>>
>> I've got crash in svnserve when running 32-bit test suite over svn://
>> protocol on Windows 7 (x64).
> [..]
>>
>> I'm running test suite again to check if this issue has stable reproduction.
>>
> The crash happened again.
>
> It seems problem in apr_thread_* implementation and svnserve pool
> management. Problem that we allocate apr_thread_t and apr_threadattr_t
> in connection_pool which is destroyed when created thread completes.
> This lead access to freed memory in apr_thread_create() when
> connection thread completes very fast. See apr_thread_create()
> implementation on Windows (apr\threadproc\win32\thread.c:82)
Attached patch fixes problem in my configuration.
--
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com
Index: subversion/svnserve/svnserve.c
===================================================================
--- subversion/svnserve/svnserve.c (revision 1470946)
+++ subversion/svnserve/svnserve.c (working copy)
@@ -987,6 +987,7 @@
while (1)
{
+ apr_pool_t *subpool;
#ifdef WIN32
if (winservice_is_stopping())
return ERROR_SUCCESS;
@@ -1092,7 +1093,8 @@
particularly sophisticated strategy for a threaded server, it's
little different from forking one process per connection. */
#if APR_HAS_THREADS
- status = apr_threadattr_create(&tattr, connection_pool);
+ subpool = svn_pool_create(pool);
+ status = apr_threadattr_create(&tattr, subpool);
if (status)
{
err = svn_error_wrap_apr(status, _("Can't create threadattr"));
@@ -1121,6 +1123,7 @@
svn_error_clear(err);
exit(1);
}
+ svn_pool_destroy(subpool);
#endif
break;