Skip to content

intermittent repo_tree corruption

Jonathan Nieder git 1 version New

Get series with b4
b4 am 20101205093357.GD4332@burratino

Versions newest first

  1. v1 Latest0 of 2 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 2 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH jn/svn-fe-maint 0/2] intermittent repo_tree corruption

[mailer usage fail. resending to git@vger; sorry for the noise]

Hi David,

Quoted 9 lines · Jonathan Nieder
Quoted 2 lines · Jonathan Nieder

+++ b/vcs-svn/svndump.c

(quoted diff) +0 -0
@@ -181,12 +181,22 @@ static void handle_node(void)

[...]

Review

Quoted 2 lines
(quoted diff) +2 -0
+		if (mode == REPO_MODE_DIR && type != REPO_MODE_DIR)
+			die("invalid dump: cannot modify a directory into a file");

This is tripping for me in a revision like so:

[...]

Quoted 3 lines

Node-path: lxanew/DCNsnetwork.cpp
Node-kind: file
Node-action: add

[...]

Quoted 1 line

DCNsnetwork.cpp was added in r688, which looks like so:

[...]

Quoted 3 lines

Node-path: DCNsnetwork.cpp
Node-kind: file
Node-action: add

This is a bad one. Currently, repo_copy builds new nodes for all directories containing the destination directory, like so:

for each path component:
find that node, creating if missing
make sure it is in the active commit (cloning if not) set mode to MODE_DIR and set up the next iteration to look there.
set mode and content based on source path

Unfortunately the "create if missing" and "make sure it is the active commit" steps call realloc without updating the corresponding pointers.

svn-fe2 (as contained in git 1.7.3) and svn-fe3 are both affected, presumably. Probably existing testing missed this because the repo_tree pool quickly grows large enough that glibc allocates with mmap(), with little need to change addresses within a huge 64-bit address space.

Jonathan Nieder (2):
treap: make treap_insert return inserted node
vcs-svn: fix intermittent repo_tree corruption

 test-treap.c        |   11 ++++++++---
 vcs-svn/repo_tree.c |    4 ++--
 vcs-svn/trp.h       |    3 ++-
 vcs-svn/trp.txt     |   10 ++++++++--
 4 files changed, 20 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.2.4