Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-3609

Assertion in svn_path_is_canonical, svn_path_join with 'file:' URL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.6.x
    • None
    • libsvn_subr
    • None

    Description

      While trying to discover why some URLs work from the command line, but fail when used in calls to libsvn_client I came across this:

      Assertion failed: (svn_path_is_canonical(base, pool)), function svn_path_join, file subversion/libsvn_subr/path.c, line 114.

      This didn't happen with http: URLs, only with file: URLs. That inconsistency looks like a bug.

      The following script replicates it:

      #! /bin/sh
      svn --version
      
      echo '\nUSING http:'
      P='http://svn.apache.org/repos/asf'
      svn info ${P}/.
      svn info ${P}/%2E
      svn info ${P}%2F
      
      cd "/tmp"
      R="/tmp/repo-$$"
      svnadmin create $R
      
      echo '\nUSING file:'
      P="file://$R"
      svn info ${P}/.
      svn info ${P}/%2E		# ABORTS
      svn info ${P}%2F		# ABORTS
      
      #end
      
      ---------------------------------
      Output:
      svn, version 1.6.6 (r40053)
         compiled Oct 22 2009, 14:13:09
      
      Copyright (C) 2000-2009 CollabNet.
      Subversion is open source software, see http://subversion.tigris.org/
      This product includes software developed by CollabNet (http://www.Collab.Net/).
      
      The following repository access (RA) modules are available:
      
      * ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
        - handles 'http' scheme
        - handles 'https' scheme
      * ra_svn : Module for accessing a repository using the svn network protocol.
        - with Cyrus SASL authentication
        - handles 'svn' scheme
      * ra_local : Module for accessing a repository on local disk.
        - handles 'file' scheme
      * ra_serf : Module for accessing a repository via WebDAV protocol using serf.
        - handles 'http' scheme
        - handles 'https' scheme
      
      
      USING http:
      Path: asf
      URL: http://svn.apache.org/repos/asf
      Repository Root: http://svn.apache.org/repos/asf
      Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
      Revision: 927351
      Node Kind: directory
      Last Changed Author: kkolinko
      Last Changed Rev: 927351
      Last Changed Date: 2010-03-25 11:34:10 +0000 (Thu, 25 Mar 2010)
      
      Path: .
      URL: http://svn.apache.org/repos/asf/%2E
      Repository Root: http://svn.apache.org/repos/asf/%2E
      Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
      Revision: 927351
      Node Kind: directory
      Last Changed Author: kkolinko
      Last Changed Rev: 927351
      Last Changed Date: 2010-03-25 11:34:10 +0000 (Thu, 25 Mar 2010)
      
      svn: 'http://svn.apache.org/repos/asf%2F' path not found
      
      USING file:
      Path: repo-484
      URL: file:///tmp/repo-484
      Repository Root: file:///tmp/repo-484
      Repository UUID: 8eca9714-5942-4196-9ab1-e102eadc450c
      Revision: 0
      Node Kind: directory
      Last Changed Rev: 0
      Last Changed Date: 2010-03-25 11:34:55 +0000 (Thu, 25 Mar 2010)
      
      Assertion failed: (svn_path_is_canonical(base, pool)), function svn_path_join, file subversion/libsvn_subr/path.c, line 114.
      ./svn_bug: line 17:   491 Abort trap              svn info ${P}/%2E
      Assertion failed: (svn_path_is_canonical(base, pool)), function svn_path_join, file subversion/libsvn_subr/path.c, line 114.
      ./svn_bug: line 18:   493 Abort trap              svn info ${P}%2F
      
      
      ---------------------------------
      Both aborts produce the same stack trace:
      Thread 0 Crashed:
      0   libSystem.B.dylib             	0x00007fff825efcb4 __kill + 12
      1   libSystem.B.dylib             	0x00007fff8267ab1c abort + 88
      2   libSystem.B.dylib             	0x00007fff8266e644 __assert_rtn + 108
      3   libsvn_subr-1.0.dylib         	0x00000001002d26c4 svn_path_join + 144
      4   libsvn_repos-1.0.dylib        	0x0000000100139b38 check_repos_path + 56
      5   libsvn_repos-1.0.dylib        	0x0000000100139f1c svn_repos_find_root_path + 84
      6   libsvn_ra_local-1.0.dylib     	0x0000000100115e0c svn_ra_local__split_URL + 508
      7   libsvn_ra_local-1.0.dylib     	0x0000000100111e64 svn_ra_local__open + 172
      8   libsvn_ra-1.0.dylib           	0x00000001000fa354 svn_ra_open3 + 2124
      9   libsvn_client-1.0.dylib       	0x00000001000793e8 svn_client__open_ra_session_internal + 712
      10  libsvn_client-1.0.dylib       	0x000000010007997c svn_client__ra_session_from_path + 420
      11  libsvn_client-1.0.dylib       	0x000000010005d060 svn_client_info2 + 336
      12  svn                           	0x0000000100009df8 svn_cl__info + 688
      13  svn                           	0x000000010000f560 main + 10968
      14  svn                           	0x0000000100002350 start + 64
      

      Original issue reported by chris0

      Attachments

        Activity

          People

            Unassigned Unassigned
            subversion-importer Subversion Importer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: