Re: Crash in token.c after incomplete cherry pick merges in 1.15

2021-08-10 Thread Stefan Sperling
On Mon, Aug 09, 2021 at 06:19:38PM -0400, Joshua Kordani wrote:
> Attached is a script to reproduce the error.
> 
> I also have a packed rr debugger session that I can provide (I highly
> recommend the rr reversible debugger).  Its ~30meg

Thank you Joshua! The patch below makes your test script succeed for me.

Ideally I should commit a regression test together with this patch.
I will need to find time to convert your script into a regression test.

In the meantime can you confirm that the patch helps?

Regards,
Stefan

Index: subversion/libsvn_client/conflicts.c
===
--- subversion/libsvn_client/conflicts.c(revision 1892118)
+++ subversion/libsvn_client/conflicts.c(working copy)
@@ -3028,12 +3028,12 @@ conflict_tree_get_details_local_missing(svn_client
   deleted_basename,
   conflict->pool);
   details->moves = moves;
+  details->wc_move_targets = apr_hash_make(conflict->pool);
   if (details->moves != NULL)
 {
   apr_pool_t *iterpool;
   int i;
 
-  details->wc_move_targets = apr_hash_make(conflict->pool);
   iterpool = svn_pool_create(scratch_pool);
   for (i = 0; i < details->moves->nelts; i++)
 {
Index: subversion/libsvn_wc/wc_db.c
===
--- subversion/libsvn_wc/wc_db.c(revision 1892057)
+++ subversion/libsvn_wc/wc_db.c(working copy)
@@ -16732,7 +16732,7 @@ svn_wc__db_find_working_nodes_with_basename(apr_ar
   SVN_ERR(svn_sqlite__get_statement(, wcroot->sdb,
 STMT_SELECT_PRESENT_HIGHEST_WORKING_NODES_BY_BASENAME_AND_KIND));
   SVN_ERR(svn_sqlite__bindf(stmt, "ist", wcroot->wc_id, basename,
-kind_map, kind));
+kind_map_none, kind));
   SVN_ERR(svn_sqlite__step(_row, stmt));
 
   *local_abspaths = apr_array_make(result_pool, 1, sizeof(const char *));
@@ -16776,7 +16776,7 @@ svn_wc__db_find_copies_of_repos_path(apr_array_hea
   SVN_ERR(svn_sqlite__get_statement(, wcroot->sdb,
 STMT_SELECT_COPIES_OF_REPOS_RELPATH));
   SVN_ERR(svn_sqlite__bindf(stmt, "ist", wcroot->wc_id, repos_relpath,
-kind_map, kind));
+kind_map_none, kind));
   SVN_ERR(svn_sqlite__step(_row, stmt));
 
   *local_abspaths = apr_array_make(result_pool, 1, sizeof(const char *));


Re: Segfault in libsvn_client/conflicts.c

2021-08-10 Thread Stefan Sperling
On Mon, Aug 09, 2021 at 07:56:27PM -0400, Joshua Kordani wrote:
> On my work repo, this causes the crash.  In a small repo where I have
> repeated these steps, it does not.

Most likely in your test repository the history is arranged such
that the deletions can be properly correllated by logging history
of the various paths involved. Your test script probably creates
history which "makes sense", and your work repository probably
contains something unexpected which isn't aligned with "best practices"
and might be difficult to spot.

You will need to dig deeper into why the resolver is being mislead
in your work repository. If all else fails, you could try printing URLs
and revisions which are being logged by the resolver during its search.
That might help with understanding why the resolver fails to correlate
the deletions with one another.