You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Nathan Hartman <ha...@gmail.com> on 2021/12/05 17:41:30 UTC
Fwd: Can't create temporary file from template ... No such file or directory
Bringing this from users@ to dev@.
Rolf Campbell discovered an assertion failure that I think might shed
some light on other assertion failures we've been hearing about from
time to time.
> ---------- Forwarded message ---------
> From: Rolf Campbell <Ro...@solace.com>
> Date: Thu, Dec 2, 2021 at 3:29 PM
> Subject: Re: Can't create temporary file from template ... No such file or directory
> To: Nathan Hartman <ha...@gmail.com>
> Cc: users@subversion.apache.org <us...@subversion.apache.org>
>
>
> Hello Nathan,
>
> Thank you for the reply.
>
> I assure you that it was not related to disk space. I tried it on 3 different computers using 2 different versions of SVN.
>
> I tried to create a reproduction script and instead I caused the svn client to crash.
>
> Here is my script:
>
> svnadmin create test
> svn checkout file://$PWD/test test.1
> cd test.1
> svn mkdir ^/trunk -m ""
> svn mkdir ^/branches -m ""
> touch a
> svn add a
> svn commit -m ""
> svn cp ^/trunk ^/branches/b -m ""
> svn mkdir ^/trunk/c -m ""
> svn mkdir ^/trunk/c/d -m ""
> svn mkdir ^/branches/b/c -m ""
> svn mkdir ^/branches/b/c/e -m ""
> cd ..
> svn co file://$PWD/test/branches/b
> cd b
> svn merge ^/trunk .
>
> And here is the output when I try it (multiple times):
> --- Merging r4 through r8 into '.':
> C c
> A c/d
> --- Recording mergeinfo for merge of r4 through r8 into '.':
> U .
> Summary of conflicts:
> Tree conflicts: 1
> Searching tree conflict details for 'c' in repository:
> Checking r5... done
> Tree conflict on 'c':
> A new directory appeared during merge of
> '^/trunk/c:4-8'.
> It was added by rcampbell in r5.
> A directory which already occupies this path was found in the working copy.
> Select: (p) Postpone, (r) Mark as resolved, (i) Ignore incoming addition,
> (m) Merge the directories,
> (R) Delete my directory and replace it with incoming directory,
> (M) Replace and merge, (h) Help, (q) Quit resolution: m
> svn: E235000: In file 'subversion/libsvn_wc/adm_ops.c' line 384: assertion failed (!copyfrom_url || (svn_uri_is_canonical(copyfrom_url, scratch_pool) && SVN_IS_VALID_REVNUM(copyfrom_rev)))
> Aborted (core dumped)
It's not dumping core on mine. I would like to debug this properly but
am running into various nonsense. For example, I haven't figured out
how to run it under gdb since svn is being called through the libtool
script; if I configure with --disable-shared the build fails. Sorry,
I don't have the details atm. I'll have to rerun it later. Out of time
for today but I will try to resolve these issues soon.
What I do know so far is the reason that check_can_add_node() fails
the assertion check: copyfrom_url is not canonical. When I run the
above repro script at /home/nate/ramdrive, the non-canonical URL is
"file:///home/nate/ramdrive/test/".
Cheers,
Nathan
Re: Fwd: Can't create temporary file from template ... No such file or directory
Posted by Daniel Sahlberg <da...@gmail.com>.
Den ons 15 dec. 2021 kl 07:47 skrev Nathan Hartman <hartman.nathan@gmail.com
>:
> Anyway I have to pause for today...
>
> Oh one more thing. I believe I succeeded to reproduce the OP's
> original issue. If one more subdirectory is added, e.g., trunk/c/d/f,
> then f will trigger the same response as the OP reported.
>
Great work so far Nathan, I'm sure you will find your way through
eventually! I'm following along with great interest but family obligations
has so far kept me from digging into the code myself.
Kind regards,
Daniel
Re: Fwd: Can't create temporary file from template ... No such file or directory
Posted by Nathan Hartman <ha...@gmail.com>.
On Thu, Dec 9, 2021 at 10:32 AM Nathan Hartman <ha...@gmail.com> wrote:
> So the above can be distilled to:
>
> # .
> # ├── trunk/
> # │ └── c/
> # │ └── d/
> # └── branches
> # └── b/ (from trunk@2)
> # └── c/
>
> It is the 'd' directory ('trunk/c/d/') that is throwing us off course.
As I mentioned before, in diff_dir_added() where that apr_pstrcat()
call happens, right_source->repos_relpath is NULL and my thinking was
that something is forgetting to set it. Long before reaching this
point, there are a few places that seem to come close to setting it
but none do, for reasons that appear reasonable.
So, if I hack diff_dir_added() to force the path to be what I think it
ought to be...
[[[
Index: subversion/libsvn_client/conflicts.c
===================================================================
--- subversion/libsvn_client/conflicts.c (revision 1895966)
+++ subversion/libsvn_client/conflicts.c (working copy)
@@ -7568,7 +7568,7 @@ diff_dir_added(const char *relpath,
SVN_ERR(svn_io_dir_make(local_abspath, APR_OS_DEFAULT, scratch_pool));
copyfrom_url = apr_pstrcat(scratch_pool, b->repos_root_url, "/",
- right_source->repos_relpath, SVN_VA_NULL);
+ "trunk/c/d"
/*right_source->repos_relpath*/, SVN_VA_NULL);
SVN_ERR(svn_wc_add4(b->ctx->wc_ctx, local_abspath, svn_depth_infinity,
copyfrom_url, right_source->revision,
NULL, NULL, /* cancel func/baton */
]]]
...then it appears the call to svn_wc_add4() succeeds -- at least it
doesn't fail.
But immediately after (in diff_dir_added(),
libsvn_client/conflicts.c), we go into a loop that will call
svn_wc_prop_set4() four times. In the first iteration, it tries to set
"svn:entry:committed-rev" despite this foreboding comment in
svn_wc_prop_set4():
/* we don't do entry properties here */
Sure enough, we get:
svn: warning: apr_err=SVN_ERR_BAD_PROP_KIND
svn: warning: W200008: Property 'svn:entry:committed-rev' is an entry property
subversion/svn/merge-cmd.c:556,
subversion/svn/resolve-cmd.c:157: (apr_err=SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE)
svn: E155027: Failure occurred resolving one or more conflicts
Now, this all leads me to believe that something is messed up long
before we get here. What's making this a bigger challenge to debug
than I'd like it to be is all the void pointers to various batons. I
just can't seem to hold in my head the types of more than a few so
quickly lose the ability to trace what comes from where, unless
there's some gdb trick I don't know about that can make it resolve the
correct type.
Anyway I have to pause for today...
Oh one more thing. I believe I succeeded to reproduce the OP's
original issue. If one more subdirectory is added, e.g., trunk/c/d/f,
then f will trigger the same response as the OP reported.
Cheers,
Nathan
Re: Fwd: Can't create temporary file from template ... No such file or directory
Posted by Nathan Hartman <ha...@gmail.com>.
On Thu, Dec 9, 2021 at 8:34 AM Nathan Hartman <ha...@gmail.com> wrote:
> I haven't found the cause yet but I do know now that the bug isn't in how we are constructing the path. I'm away from my machine atm but I'll write back soon with more...
The OP's repro script creates this structure:
# .
# ├── a
# ├── trunk/
# │ └── c/
# │ └── d/
# └── branches/
# └── b/ (from trunk@3)
# └── c/
# └── e/
The 'trunk/c/' and 'branches/b/c/' directories have separate ancestry
and (correctly) trigger the conflict.
The 'a' file is irrelevant.
The 'branches/b/c/e/' directory is irrelevant. The same assertion
fails whether it is present or not.
So the above can be distilled to:
# .
# ├── trunk/
# │ └── c/
# │ └── d/
# └── branches
# └── b/ (from trunk@2)
# └── c/
It is the 'd' directory ('trunk/c/d/') that is throwing us off course.
As I said before I haven't finished yet; I'll try to have another
debug session tonight to look more closely at update_entry() in
libsvn_repos/reporter.c; I think there will be an important clue
there.
Simplified repo script:
[[[
$SVNADMIN create repo
$SVN checkout file://$PWD/repo wc1
cd wc1
$SVN mkdir ^/trunk -m ""
$SVN mkdir ^/branches -m ""
$SVN cp ^/trunk ^/branches/b -m ""
$SVN mkdir ^/trunk/c -m ""
$SVN mkdir ^/trunk/c/d -m ""
$SVN mkdir ^/branches/b/c -m ""
cd ..
$SVN co file://$PWD/repo/branches/b wc2
cd wc2
$SVN merge ^/trunk .
]]]
Cheers,
Nathan
Re: Fwd: Can't create temporary file from template ... No such file or directory
Posted by Nathan Hartman <ha...@gmail.com>.
On Thu, Dec 9, 2021 at 6:37 AM Bert Huijben <be...@qqmail.nl> wrote:
> We have helper functions for this scenario (svn_uri__*()) that also
> perform the required escaping rules (required for url, but not for relpath)
I haven't found the cause yet but I do know now that the bug isn't in how
we are constructing the path. I'm away from my machine atm but I'll write
back soon with more...
Cheers,
Nathan
RE: Fwd: Can't create temporary file from template ... No such file or directory
Posted by Bert Huijben <be...@qqmail.nl>.
We have helper functions for this scenario (svn_uri__*()) that also perform the required escaping rules (required for url, but not for relpath)
Bert
-----Original Message-----
From: Stefan Sperling <st...@elego.de>
Sent: Monday, December 6, 2021 9:31 AM
To: Nathan Hartman <ha...@gmail.com>
Cc: Subversion Developers <de...@subversion.apache.org>
Subject: Re: Fwd: Can't create temporary file from template ... No such file or directory
On Sun, Dec 05, 2021 at 11:21:48PM -0500, Nathan Hartman wrote:
> On Sun, Dec 5, 2021 at 12:55 PM James McCoy <ja...@jamessan.com> wrote:
> >
> > On Sun, Dec 05, 2021 at 12:41:30PM -0500, Nathan Hartman wrote:
> > > It's not dumping core on mine. I would like to debug this properly
> > > but am running into various nonsense. For example, I haven't
> > > figured out how to run it under gdb since svn is being called
> > > through the libtool script;
> >
> > "libtool exec gdb ./subversion/svn ..." will run svn with the
> > environment setup properly.
>
> Perfect. That's the clue I needed. Thanks, James.
>
> At diff_dir_added() at libsvn_client/conflicts.c:7570 (in current
> trunk, r1895609) we are attempting to concat some path components
> with:
>
> copyfrom_url = apr_pstrcat(scratch_pool, b->repos_root_url, "/",
> right_source->repos_relpath,
> SVN_VA_NULL);
>
> However, right_source->repos_relpath is an empty string, so we end up
> with b->repos_root_url plus a trailing slash, causing the path to
> become non-canonical.
>
> The fix might be as simple as checking for that and not calling
> apr_pstrcat(), but I would like to dig a little more before jumping to
> conclusions.
Thanks, Nathan. I see this is in the conflict resolver so this is probably code I have written. But I won't snag this away from you. And if you need any help, just let me know. (I have not yet looked into details; I suspect that right_source might be bogus or simply invalid?)
Cheers,
Stefan
Re: Fwd: Can't create temporary file from template ... No such file or directory
Posted by Nathan Hartman <ha...@gmail.com>.
On Mon, Dec 6, 2021 at 3:31 AM Stefan Sperling <st...@elego.de> wrote:
>
> Thanks, Nathan. I see this is in the conflict resolver so this is probably
> code I have written. But I won't snag this away from you. And if you need
> any help, just let me know. (I have not yet looked into details; I suspect
> that right_source might be bogus or simply invalid?)
Thanks. I'm sure I will have questions soon! Not sure yet whether
right_source is bogus. I have a thought I'll test tomorrow. It's
getting late here so calling it a day for now, but I've been having
fun single-stepping through this merge invocation. Once I identify
what is unusual about this scenario, I'll try to reproduce it in a
regression test using the standard Greek tree if possible; if not,
then I'll fall back to just running the same steps as the repro. I'll
know more soon...
Cheers,
Nathan
Re: Fwd: Can't create temporary file from template ... No such file or directory
Posted by Stefan Sperling <st...@elego.de>.
On Sun, Dec 05, 2021 at 11:21:48PM -0500, Nathan Hartman wrote:
> On Sun, Dec 5, 2021 at 12:55 PM James McCoy <ja...@jamessan.com> wrote:
> >
> > On Sun, Dec 05, 2021 at 12:41:30PM -0500, Nathan Hartman wrote:
> > > It's not dumping core on mine. I would like to debug this properly but
> > > am running into various nonsense. For example, I haven't figured out
> > > how to run it under gdb since svn is being called through the libtool
> > > script;
> >
> > "libtool exec gdb ./subversion/svn ..." will run svn with the
> > environment setup properly.
>
> Perfect. That's the clue I needed. Thanks, James.
>
> At diff_dir_added() at libsvn_client/conflicts.c:7570 (in current
> trunk, r1895609) we are attempting to concat some path components
> with:
>
> copyfrom_url = apr_pstrcat(scratch_pool, b->repos_root_url, "/",
> right_source->repos_relpath, SVN_VA_NULL);
>
> However, right_source->repos_relpath is an empty string, so we end up
> with b->repos_root_url plus a trailing slash, causing the path to
> become non-canonical.
>
> The fix might be as simple as checking for that and not calling
> apr_pstrcat(), but I would like to dig a little more before jumping to
> conclusions.
Thanks, Nathan. I see this is in the conflict resolver so this is probably
code I have written. But I won't snag this away from you. And if you need
any help, just let me know. (I have not yet looked into details; I suspect
that right_source might be bogus or simply invalid?)
Cheers,
Stefan
Re: Fwd: Can't create temporary file from template ... No such file or directory
Posted by Nathan Hartman <ha...@gmail.com>.
On Sun, Dec 5, 2021 at 12:55 PM James McCoy <ja...@jamessan.com> wrote:
>
> On Sun, Dec 05, 2021 at 12:41:30PM -0500, Nathan Hartman wrote:
> > It's not dumping core on mine. I would like to debug this properly but
> > am running into various nonsense. For example, I haven't figured out
> > how to run it under gdb since svn is being called through the libtool
> > script;
>
> "libtool exec gdb ./subversion/svn ..." will run svn with the
> environment setup properly.
Perfect. That's the clue I needed. Thanks, James.
At diff_dir_added() at libsvn_client/conflicts.c:7570 (in current
trunk, r1895609) we are attempting to concat some path components
with:
copyfrom_url = apr_pstrcat(scratch_pool, b->repos_root_url, "/",
right_source->repos_relpath, SVN_VA_NULL);
However, right_source->repos_relpath is an empty string, so we end up
with b->repos_root_url plus a trailing slash, causing the path to
become non-canonical.
The fix might be as simple as checking for that and not calling
apr_pstrcat(), but I would like to dig a little more before jumping to
conclusions.
I was hoping this would give some insight to the non-canonical path
assertions we hear about every so often; I'm sure this one has bitten
before...
Cheers,
Nathan
P.S., I invoked gdb with:
$ libtool exec gdb -tui -args /path/to/subversion/svn/svn merge ^/trunk
Note: At first I thought Emacs wouldn't run it through libtool with
M-x gdb because it complained that I didn't give '-i=mi' even though I
did and displayed everything garbled; but it turns out I forgot -args:
M-x gdb -> libtool exec gdb -i=mi -args /path/to/subversion/svn/svn
merge ^/trunk
Re: Fwd: Can't create temporary file from template ... No such file or directory
Posted by James McCoy <ja...@jamessan.com>.
On Sun, Dec 05, 2021 at 12:41:30PM -0500, Nathan Hartman wrote:
> It's not dumping core on mine. I would like to debug this properly but
> am running into various nonsense. For example, I haven't figured out
> how to run it under gdb since svn is being called through the libtool
> script;
"libtool exec gdb ./subversion/svn ..." will run svn with the
environment setup properly.
Cheers,
--
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7 2D23 DFE6 91AE 331B A3DB