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

Re: tree conflicts: patch: segfault in merge_dir_opened()

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Tue, 19 Aug 2008 17:08:07 +0100

On Tue, 2008-08-19 at 05:36 +0200, Neels Janosch Hofmeyr wrote:
> I've investigated the segmentation fault during merge (on the tree-conflicts
> branch) and have, to my surprise, discovered that skipping tree-conflict
> detection when adm_access==NULL is exactly the right thing to do.
>
> I am thus posting this proper patch.

OK, that looks like a correct patch. (Just one tweak: you added an
initialisation of "entry" to "NULL", but it gets initialised by the next
line so that's best not done.)

Committed in r32555.

Thank you very much!

- Julian

> I am also appending three shell scripts that differ slightly (1: `svn rm;svn
> ci', 2: `svn rm' without commit, 3: brute force `rm -rf'). Only 1 and 3
> reproduce the segmentation fault.
>
> Let me quote the explanatory comment contained in this patch:
>
> /* If adm_access == NULL, the tree conflict detection can be skipped,
> * because:
> *
> * adm_access refers to the parent(!) directory of the directory that
> * is to be opened. If adm_access == NULL, it means that the parent
> * of const char *path does not exist in the current working copy.
> *
> * We are at arbitrary depth in a directory subtree that does not exist
> * in the working copy, but nevertheless in a subtree off an existing
> * working copy directory (at least off the working copy "root").
> *
> * This function has already been called on the first non-existent
> * path element of this subtree, which has an existing parent (adm_access
> * != NULL), and a tree conflict has been triggered there.
> *
> * Even if we wanted to report another tree-conflict, there'd be no
> * working copy to mark the conflict in. Since the nearest existing parent
> * directory is already marked tree-conflicted, we can rest at that.
> */
>
> [[[
> Fixed a segmentation fault in tree-conflicts detection.
>
> * subversion/libsvn_client/merge.c (merge_dir_opened): Disabled the
> superfluous tree-conflicts detection for the case adm_access == NULL,
> in effect avoiding a segmentation fault. Added a detailed comment.
> ]]]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-08-19 18:08:34 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.