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

Re: [BUG] svn info segfaults after svn cp on a restricted permission directory

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Tue, 27 Sep 2011 09:44:41 +0100

Arwin Arni <arwin_at_collab.net> writes:

> I've attached a shell script which will help you reproduce this
> easily. Also, I'm in the process of writing a test-case for this, but
> I don't know which set of tests it belongs to - authz_tests.py or
> copy_tests.py or info_tests.py. Clearly, the authz subsystem is doing
> what it is meant to do, but on the working copy side, 'copy' is doing
> something nasty, which I believe causes 'info' to Segfault.

(gdb)
#3 0x00007ffff78cc0fe in build_info_for_node (info=0x7fffffffe040,
    db=0x651c78, local_abspath=0x6794b0 "/home/pm/sw/subversion/obj/wc/X/B",
    kind=svn_node_unknown, result_pool=0x683388, scratch_pool=0x683388)
    at ../src/subversion/libsvn_wc/info.c:267
267 tmpinfo->URL = svn_path_url_add_component2(tmpinfo->repos_root_URL,
(gdb) p tmpinfo->repos_root_URL
$1 = 0x0

$ sqlite3 wc/.svn/wc.db "select op_depth, local_relpath, presence, repos_id, repos_path from nodes"
0|A/B|absent|1|A/B
0|A|normal|1|A
0||normal|1|
1|X|normal|1|A
1|X/B|incomplete||

The same problem occurs if an wc-to-wc copy is interrupted. I suppose
we could fix it something like:

Index: subversion/libsvn_wc/info.c
===================================================================
--- subversion/libsvn_wc/info.c (revision 1176261)
+++ subversion/libsvn_wc/info.c (working copy)
@@ -256,7 +256,9 @@
       wc_info->schedule = svn_wc_schedule_delete;
     }
   else if (status == svn_wc__db_status_not_present
- || status == svn_wc__db_status_server_excluded)
+ || status == svn_wc__db_status_server_excluded
+ || (status == svn_wc__db_status_incomplete
+ && !tmpinfo->repos_root_URL))
     {
       *info = NULL;
       return SVN_NO_ERROR;

or perhaps we should be setting repos_id/repos_path in the incomplete
row.

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com
Received on 2011-09-27 10:45:18 CEST

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.