[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: Arwin Arni <arwin_at_collab.net>
Date: Wed, 28 Sep 2011 14:13:32 +0530

On Tuesday 27 September 2011 02:14 PM, Philip Martin wrote:
> 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.
>
Correct me if I'm wrong, but this looks like it fixes the way 'svn info'
handles the incorrect node status. I think we have to fix the code at
the point where this incosistency is first introduced. I agree that this
would fix the segfault, but are we overlooking a more serious problem
with the way 'svn cp'handles the server-excluded nodes? I haven't
grokked the relevant code yet, and so I'm not in a position to comment
on specifics.

Regards,
Arwin Arni
Received on 2011-09-28 10:44:14 CEST

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