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

[PATCH] Tree-conflicts: do_entry_deletion segfault

From: Neels Hofmeyr <neels_at_elego.de>
Date: Fri, 05 Sep 2008 04:25:50 +0200

Julian Foad wrote:
> Hi, tree conflicts fans.
>
> I have written a complete log message of what is on the tree-conflicts
> branch compared with trunk. This is attached and also stored in
> README.branch in the root of the branch.
>
> The diff is available for a while at
> <http://filebin.ca/ajqeez/tc-r32853.patch>.
>
> Updates to the branch since last time include: resolve a bunch of
> non-essential differences such as changes that were better made on the
> trunk; catch up with recent changes from trunk; Neels' work on improving
> the tests.
>
> Anyone able to pick a small part of it to review, or help with, or just
> ping me about, is very welcome.
>
> Thanks.
> - Julian
>

Quoting:

* subversion/libsvn_wc/update_editor.c
  (bump_dir_info): Update a doc-string to allow for a directory to have tree
    conflicts.
  (entry_has_local_mods, check_tree_conflict): New functions.
  (do_entry_deletion): Have the parent's admin access baton passed in by the
    caller. Check for tree conflicts.
  ### Broken when parent_adm_access is NULL.

I've already posted a fix for this one almost two weeks ago. It wasn't being
heard much.

So I'm posting an update, using today's tree-conflicts branch, compacting my
explanations. You may refer to the following mail for more (confusing) detail:

http://subversion.tigris.org/servlets/ReadMsg?listName=dev&msgNo=142154
Date: Sat, 23 Aug 2008 22:43:11 +0200
From: Neels Hofmeyr <neels_at_elego.de>
Subject: Re: Tree-conflicts branch - log message / review

Two problems coincide:

1. Tree conflict detection is skipped when examining the path that was
specifically given as target. E.g. `svn update A/D/G' means that while G's
contents are checked for tree conflicts, G itself will not be checked.

2. Tree conflict detection segfaults if run in that situation given in point
1 above.

This patch fixes both, plus it tweaks two "unrelated" cmdline test to ignore
a 'C' marker caused by the fix. The fix itself consists of three parts:

i) A change made in the tree-conflicts branch is reverted to trunk:
do_entry_deletion() does not need a PARENT_ADM_ACCESS parameter. It was
being used to indicate the specific case mentioned in point 1 above, so as
to be able to skip tree-conflicts detection in that case, oddly enough. Stsp
has pointed out that this change must have been committed by accident.

ii) Enable tree-conflicts detection for the case in point 1 above.

iii) Make check_tree_conflict() handle a missing directory properly, so that
it reports a reason_missing instead of segfaulting. (The diff looks a little
confusing there because of indent changes.)

~Neels

[[[
Fix segfault when the update editor calls do_entry_deletion() on an explicit
target of an update.

Patch by: Neels Hofmeyr <neels_at_elego.de>

* subversion/libsvn_wc/update_editor.c
  (do_entry_deletion, delete_entry, close_edit): Remove parameter
    PARENT_ADM_ACCESS from do_entry_deletion(), reverting to trunk
    and allowing tree-conflicts detection for update targets.
  (check_tree_conflict): Properly handle a missing directory, reporting
    it as `svn_wc_conflict_reason_missing'.

* subversion/tests/cmdline/update_tests.py
  (update_deleted_missing_dir, another_hudson_problem): Tweak these tests
    to expect and handle the tree-conflicts that inherently arise.
]]]

-- 
Neels Hofmeyr -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23458696  mobile: +49 177 2345869  fax: +49 30 23458695
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelsreg: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194

Received on 2008-09-05 04:29:09 CEST

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