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

Re: merge tracking: robustness?

From: Daniel Rall <dlr_at_collab.net>
Date: 2007-10-23 20:02:04 CEST

On Tue, 23 Oct 2007, Jack Repenning wrote:
> > svn ci -m"rename gamma to gamma-1"
> Deleting greek/A/D/gamma
> Adding greek/A/D/gamma-1
> subversion/libsvn_client/commit.c:916: (apr_err=160046)
> svn: Commit failed (details follow):
> subversion/libsvn_fs_util/mergeinfo-sqlite-index.c:202: (apr_err=160046)
> svn: Unable to close due to unfinalised statements

Since as you pointed out, users can inject arbitrary mergeinfo,
Subversion needs to be able to cope with this situation, at least by
ignoring nonsensical mergeinfo.

> ... but upon investigation I find that the repo showing the problem
> was made with a rather old 1.5 revision (r26502), though I'm using a
> more modern client (r27305). When I build a repo from scratch with
> the modern 1.5 (r27305), I can't reproduce it.

Do you have an idea of the reproduction recipe for the problem?

The error message "Unable to close due to unfinalised statements" is
coming from sqlite3_close(), which is called from Subversion's
close_db() wrapper, which is in turn called from four places in
mergeinfo-sqlite-index.c. From the information you provided, I'm
guessing that this particular case is from the "cleanup" jump point in
svn_fs_mergeinfo__update_index(), where an attempt to close the DB
connection is causing SQLite to complain, likely because a transaction
was begun without it being committed (or aborted?). From

  /* If there are any outstanding VMs, return SQLITE_BUSY. */
  if( db->pVdbe ){
    sqlite3Error(db, SQLITE_BUSY,
        "Unable to close due to unfinalised statements");
    return SQLITE_BUSY;

The early jump to "cleanup" in svn_fs_mergeinfo__update_index() is
likely caused by index_txn_mergeinfo(), which in turn calls
index_path_mergeinfo(), which is probably choking up a hairball
(returning an svn_error_t *).

Jack, would you:

1) Run this under gdb, to determine exactly where in
mergeinfo-sqlite-index.c this problem is being triggered.

2) Get the svn:mergeinfo for gamma-1, and tell us if it makes sense
for your repository.

  • application/pgp-signature attachment: stored
Received on Tue Oct 23 20:02:17 2007

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.