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

segfault when merging

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Wed, 24 Oct 2012 20:14:17 +0200


There were quite a few crash reports sent for TSVN which indicate a
problem when merging. Until now I never really had a good crash dump and
also no user to contact.

But now that's changed:
User report is here:

Crash dump available here:
(you should know the login data already, if not please contact my

Here's what I found so far:
libsvn_client\merge.c, calculate_left_hand_side()

/* Convert the absolute path with mergeinfo on it to a path relative
  to the session root. */
                                         ctx->wc_ctx, absolute_path,
                                         target_repos_root, FALSE,
                                         NULL, scratch_pool,
path_rel_to_session = svn_relpath_skip_ancestor(target_repos_rel_path,
                                           target_rev, target_rev,
                                           ctx, scratch_pool));

here, the 'path_rel_to_session' is set to NULL by the
svn_relpath_skip_ancestor() call, which then leads to a NULL-pointer
access later on in svn_client__repos_location_segments and further down
in svn_ra_get_location_segments():
   SVN_ERR_ASSERT(*path != '/');

where 'path' is the NULL pointer of path_rel_to_session.

svn_relpath_skip_ancestor() returns NULL if the paths are not related or
if the second argument string does not end with a '/'.
Gathering from the crash dump I can see that the second argument points
to a file so it does not end with a '/' char.

The two strings passed to svn_relpath_skip_ancestor() are according to
the crash dump:

(somename and somefile used to protect the innocent).

I hope this helps to figure out why the crash happens - I'm not familiar
with the merge code so someone else needs to look at this.


   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
Received on 2012-10-24 20:14:55 CEST

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