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

Re: [PATCH] Remove use of global_pool to apr_xlate

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-11-08 14:51:24 CET

Philip Martin <philip@codematters.co.uk> writes:

> > * subversion/libsvn_subr/utf.c (get_ntou_xlate_handle,
> > get_uton_xlate_handle): No longer walk up the tree looking for
> > global_pool, but rather just use the passed-in pool.
>
> I think you have fixed it. I've just run the test to get 600
> revisions comitted, hundreds more commit attempts, and 18 minutes of
> CPU spread over 6 httpd threads. Before applying the patch the test
> would normally fail before 50 revisions.
>
> Do you know what the problem was? Perhaps it was that the
> apr_pool_userdata_get in one thread is affected by another thread
> doing apr_pool_userdata_set? I can see that would cause problems if
> the set causes the hash table to reallocate.

I'm using this patch to catch the failures (I'm using all ASCII paths
so the conversions should all be trivial)

Index: ../svn/subversion/libsvn_subr/utf.c
===================================================================
--- ../svn/subversion/libsvn_subr/utf.c (revision 3691)
+++ ../svn/subversion/libsvn_subr/utf.c (working copy)
@@ -401,6 +401,16 @@
       SVN_ERR (convert_to_stringbuf (convset, src, strlen (src),
                                      &destbuf, pool));
       *dest = destbuf->data;
+
+ if (strcmp (src, destbuf->data))
+ {
+ apr_xlate_t *convset2;
+ svn_boolean_t spin = TRUE;
+ while (spin)
+ {
+ }
+ svn_utf_cstring_from_utf8 (dest, src, pool);
+ }
     }
   else
     {

so I can attach gdb just after it fails. Here's what I see

0x4043bc74 in svn_utf_cstring_from_utf8 (dest=0xbf1ff82c,
    src=0x81735d0 "/home/pm/sw/subversion/obj/subversion/tests/repostress/locks/db.lock", pool=0x40638ed8) at ../svn/subversion/libsvn_subr/utf.c:409
409 while (spin)
(gdb) p src
$1 = 0x81735d0 "/home/pm/sw/subversion/obj/subversion/tests/repostress/locks/db.lock"
(gdb) p destbuf->data
$2 = 0x8163ca8 "Èw:@Èw:@"
(gdb) p convset
$3 = (struct apr_xlate_t *) 0x406075e0

Now I step into the repeated svn_utf_cstring_from_utf8 call which
retrieves the convset again and I get the same value as the failed
call. Stepping further the conversion is repeated but this time it
works. So while your patch cures the problem, I don't know why it
cures it.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Nov 8 14:52:08 2002

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.