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

Re: Assert in svn-1.7-alpha2 svn_client_merge3

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Mon, 11 Jul 2011 12:23:06 +0100

On Sat, 2011-07-09, Barry Scott wrote:
> svn built with ./configure --prefix=/usr/local --enable-debug on
> Fedora 15 x86_64.

Hi Barry. This stack trace and info is useful, ...

> Let me know if you want to run this yourself. I can provide a tarball
> with the pysvn sources that trigger this and easy instructions to
> reproduce.

... but Yes Please! That would be fantastic. If it's smaller than 100
KB just attach it here on the list; if bigger, please email to me
off-list (and I suspect Paul Burba would be interested too).

In the meantime, this is what I can see so far ...

> I'm testing 1.7-alpha2 against pysvn and I'm seeing an assert
> when calling svn_client_merge3. This has all works against 1.6.
>
> Is this a bug in svn or pysvn calling svn?
>
>
>
>
> Here is what was printed:
>
> Info: pysvn command: merge --revision 16:17
> file:///home/barry/wc/svn/pysvn/Extension/Tests/testroot-01/root/repos/trunk/test /home/barry/wc/svn/pysvn/Extension/Tests/testroot-01/wc3/test-branch
> subversion/libsvn_subr/mergeinfo.c:801: (apr_err=235000)
> svn: E235000: In file 'subversion/libsvn_subr/mergeinfo.c' line 801:
> assertion failed (IS_VALID_FORWARD_RANGE(first))
> ./test-01-qqq.sh: line 16: 9958 Aborted (core dumped)
> ${PYSVN} "$@"
>
>
> And gdb output of the stack, the call site and the variables passed
> into svn_client_merge3.

(I've hand-edited the stack trace quoted here for readability, stripping
out some memory addresses and other less interesting things.)

> #3 svn_error__malfunction ... "IS_VALID_FORWARD_RANGE(first)"

#define IS_VALID_FORWARD_RANGE(range) \
  (SVN_IS_VALID_REVNUM((range)->start) && ((range)->start < (range)->end))

> #4 range_contains (first=0x19c32b8, ...)
> at subversion/libsvn_subr/mergeinfo.c:801

This is failing to validate an element of the 'rangelist1' input ...

> #5 rangelist_intersect_or_remove (..., rangelist1=0x19c3290, ...)
> at subversion/libsvn_subr/mergeinfo.c:959
> #6 svn_rangelist_intersect (..., rangelist1=0x19c3290, ...)
> at subversion/libsvn_subr/mergeinfo.c:1107
> #7 adjust_deleted_subtree_ranges (child=0x19bf4e0, parent=0x194c1d8,
> mergeinfo_path="/trunk/test/file-merge-1.txt", revision1=16,
> revision2=17,
> primary_url="file:///.../trunk/test/file-merge-1.txt", ...)
> at subversion/libsvn_client/merge.c:2908

... which is a single-element rangelist created here by:

    /* Create a rangelist describing the range PRIMARY_URL_at_older_rev
       exists and find the intersection of that and
       CHILD->REMAINING_RANGES. */
    svn_rangelist__initialize(older_rev,
                              revision_primary_url_deleted - 1,
                              TRUE, scratch_pool);

This makes range->start = older_rev which would be 16 (AFAICT from
reading the code), and range->end = (rev...deleted - 1).
'rev...deleted' comes from:

    /* PRIMARY_URL_at_older_rev exists, so it was deleted at some
       revision prior to peg_rev, find that revision. */
    SVN_ERR(svn_ra_get_deleted_rev(ra_session,
                                   rel_source_path [=.../file-merge-1.txt],
                                   older_rev [=16], younger_rev [=17],
                                   &revision_primary_url_deleted,
                                   scratch_pool));

and this whole code path is entered because file-merge-1.txt doesn't
exist in r17, so it looks like that "-1" is the problem. Presumably
'rev...deleted' is being set to 17 and so an invalid range of (start=16,
end=16) is being created. The 'end' of a rangelist is supposed be be
exclusive not inclusive.

I'll have a go now at reproducing this problem without your test data,
but it would be good to confirm it with your test data.

- Julian

> #8 fix_deleted_subtree_ranges (url1="file:///.../trunk/test",
> revision1=16, url2="file:///.../trunk/test", revision2=17, ...)
> at subversion/libsvn_client/merge.c:3140
> #9 do_directory_merge (result_catalog=0x0,
> url1="file:///.../trunk/test", revision1=16,
> url2="file:///.../trunk/test", revision2=17,
> target_abspath="/home/.../wc3/test-branch", depth=svn_depth_files,
> squelch_mergeinfo_notifications=0, abort_on_conflicts=0, ...) at
> subversion/libsvn_client/merge.c:8246
> #10 do_merge (modified_subtrees=0x0, result_catalog=0x0,
> merge_sources=0x191b890, target_abspath="/home/.../wc3/test-branch",
> sources_ancestral=1, sources_related=1, same_repos=1,
> ignore_ancestry=0, force=0, dry_run=1, record_only=0,
> record_only_paths=0x0, reintegrate_merge=0,
> squelch_mergeinfo_notifications=0, depth=svn_depth_files,
> merge_options=0x0, ...) at subversion/libsvn_client/merge.c:8766
> #11 merge_locked (source1="file:///.../trunk/test",
> revision1=0x7fff0a766190, source2="file:///.../trunk/test",
> revision2=0x7fff0a766170, target_abspath="/home/.../wc3/test-branch",
> depth=svn_depth_files, ignore_ancestry=0, force=0, record_only=0,
> dry_run=1, allow_mixed_rev=1, merge_options=0x0, ...) at
> subversion/libsvn_client/merge.c:9374
> #12 merge_cb (baton=0x7fff0a765ef0, ...)
> at subversion/libsvn_client/merge.c:9411
> #13 svn_client_merge4 (source1="file:///.../trunk/test",
> revision1=0x7fff0a766190, source2="file:///.../trunk/test",
> revision2=0x7fff0a766170, target_wcpath="/home/.../wc3/test-branch",
> depth=svn_depth_files, ignore_ancestry=0, force=0, record_only=0,
> dry_run=1, allow_mixed_rev=1, merge_options=0x0, ...) at
> subversion/libsvn_client/merge.c:9483
> #14 svn_client_merge3 (source1="file:///.../trunk/test",
> revision1=0x7fff0a766190, source2="file:///.../trunk/test",
> revision2=0x7fff0a766170, target_wcpath="/home/.../wc3/test-branch",
> depth=svn_depth_files, ignore_ancestry=0, force=0, record_only=0,
> dry_run=1, merge_options=0x0, ...)
> at subversion/libsvn_client/deprecated.c:1425
> #15 0x00007f6517b72f41 in pysvn_client::cmd_merge (this=0x19081d0,
> a_args=..., a_kws=...) at pysvn_client_cmd_merge.cpp:124

> 108 #if defined( PYSVN_HAS_CLIENT_MERGE3 )
> 109 svn_error_t *error = svn_client_merge3
> 110 (
> 111 norm_path1.c_str(),
> 112 &revision1,
> 113 norm_path2.c_str(),
> 114 &revision2,
> 115 norm_local_path.c_str(),
> 116 depth,
> 117 !notice_ancestry,
> 118 force,
> 119 record_only,
> 120 dry_run,
> 121 merge_options,
> 122 m_context,
> 123 pool
> 124 );
> (gdb) p norm_path1
> $1 =
> "file:///home/barry/wc/svn/pysvn/Extension/Tests/testroot-01/root/repos/trunk/test"
> (gdb) p revision1
> $2 = {kind = svn_opt_revision_number, value = {number = 16, date =
> 16}}
> (gdb) p norm_path2
> $3 =
> "file:///home/barry/wc/svn/pysvn/Extension/Tests/testroot-01/root/repos/trunk/test"
> (gdb) p revision2
> $4 = {kind = svn_opt_revision_number, value = {number = 17, date =
> 17}}
> (gdb) p depth
> $5 = svn_depth_files
> (gdb) p notice_ancestry
> $6 = true
> (gdb) p dry_run
> $7 = true
> (gdb) p merge_options
> $8 = (apr_array_header_t *) 0x0
> (gdb) p m_context
> $9 = {<SvnContext> = {_vptr.SvnContext = 0x7f6517dfcdf0, m_pool =
> 0x1908468, m_context = 0x19084e0, m_config_dir =
> 0x1907910
> "/home/barry/wc/svn/pysvn/Extension/Tests/testroot-01/configdir"},
> m_pyfn_GetLogin = {_vptr.Object =
> 0x7f6517dfc050, p = <instancemethod at remote 0x7f651e91d280>},
> m_pyfn_Notify = {_vptr.Object = 0x7f6517dfc050, p =
> <instancemethod at remote 0x7f6517e26780>}, m_pyfn_Progress =
> {_vptr.Object = 0x7f6517dfc050, p = None},
> m_pyfn_ConflictResolver = {_vptr.Object = 0x7f6517dfc050, p =
> <instancemethod at remote 0x7f6517e26820>},
> m_pyfn_Cancel = {_vptr.Object = 0x7f6517dfc050, p = <instancemethod
> at remote 0x7f6517fda050>}, m_pyfn_GetLogMessage = {
> _vptr.Object = 0x7f6517dfc050, p = <instancemethod at remote
> 0x7f6517e26730>}, m_pyfn_SslServerPrompt = {_vptr.Object =
> 0x7f6517dfc050, p = <instancemethod at remote 0x7f6517fda0f0>},
> m_pyfn_SslServerTrustPrompt = {_vptr.Object =
> 0x7f6517dfc050, p = <instancemethod at remote 0x7f6517fda140>},
> m_pyfn_SslClientCertPrompt = {_vptr.Object =
> 0x7f6517dfc050, p = <instancemethod at remote 0x7f6517fda0a0>},
> m_pyfn_SslClientCertPwPrompt = {_vptr.Object =
> 0x7f6517dfc050, p = <instancemethod at remote 0x7f6517e267d0>},
> m_default_username = "", m_default_password = "",
> m_permission = 0x7fff0a7660d0, m_error_message = "", m_log_message =
> ""}
Received on 2011-07-11 13:23:52 CEST

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