subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian K." <christian.k.2...@gmail.com>
Subject Re: JavaHL ISVNClient.vacuum yields assertion failed (1.9.2)
Date Fri, 23 Oct 2015 17:30:14 GMT
[answer directly to users@subversion.apache.org, seems like with Google
Groups and subversion_users@googlegroups.com things get lost]

Hello Philip,

the path being used is of the form C:\Temp\wc, it has been generated using
File.getAbsolutePath().

The error was observed on a Windows 7 x64 system with Java 8 x64 using
SlikSvn 1.9.2 x64 binaries. The error can be reproduced with a minimal
main() similar to the one you provided.

Based on your answer (especially the doc. comment on svn_dirent_is_absolute,
which talks about x:/ with *slash*) lead me to some more experiments.
Obviously the error is caused by the backslash in the path, when using the
method with slashes the assert is not hit.
This is surprising since all other JavaHL methods operating on working
copies don't mind the backslashes.

Best regards,

Christian

-----Urspr√ľngliche Nachricht-----
Von: Philip Martin [mailto:philip.martin@wandisco.com] 
Gesendet: Freitag, 23. Oktober 2015 14:36
An: christian.k.2510@gmail.com
Cc: subversion-users <subversion_users@googlegroups.com>
Betreff: Re: JavaHL ISVNClient.vacuum yields assertion failed (1.9.2)

christian.k.2510@gmail.com writes:

> trying to use the new ISVNClient.vacuum method from the JavaHL binding 
> throws an exception pointing to the following assertion failure:
> svn: In file '..\..\..\subversion\libsvn_client\cleanup.c' line 252: 
> assertion failed (svn_dirent_is_absolute(dir_abspath))
>
> The exception is thrown even though the path used is an absolute path. 
> Looking at the SVNClient.cpp file it seems like the path is not 
> properly converted to a C-String using .c_str() as it is done in other 
> methods within SVNClient.cpp.

No, path is already C string.  The missing c_str() stuff is some additional
code to catch passing a NULL path, it should be added but it is not the
cause of your problem.

The JNI wrapper works when I pass an absolute path:

import org.apache.subversion.javahl.*;
public class xx {
  public static void main(String argv[]) {
    ISVNClient client = new SVNClient();
    try {
      client.vacuum("/tmp/wc", true, true, true, true, true);
    } catch(ClientException e) {
      e.printStackTrace();
    }
  }
};

What is odd is that the C code requires an absolute path.  It was a change
made in r1548088 and before that it converted to absolute.  I'm not sure why
that change was made.

The check that is failing is this one:

/** Return TRUE if @a dirent is considered absolute on the platform at
 * hand. E.g. '/foo' on Posix platforms or 'X:/foo', '//server/share/foo'
 * on Windows.
 *
 * @since New in 1.6.
 */
svn_boolean_t
svn_dirent_is_absolute(const char *dirent);

What platform are you using and what path are you passing?

--
Philip Martin
WANdisco



Mime
View raw message