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

Path canonicalization assertion failure triggered by add_dir_recursively()

From: Daniel Rall <dlr_at_collab.net>
Date: 2005-10-28 02:03:19 CEST

I detected this problem while running 'make check-javahl'. The
BasicTests.testBasicAddIgnores() test creates the following working
copy, and triggers this assertion failure.

$ ls -la /home/dlr/src/subversion/working_copies/basic_test1/dir
total 8
drwxrwxr-x 2 dlr dlr 4096 Oct 27 16:51 ./
drwxrwxr-x 5 dlr dlr 4096 Oct 27 16:20 ../
-rw-rw-r-- 1 dlr dlr 0 Oct 27 16:20 foo.c
-rw-rw-r-- 1 dlr dlr 0 Oct 27 16:20 foo.o

$ svn add /home/dlr/src/subversion/working_copies/basic_test1/dir
A /home/dlr/src/subversion/working_copies/basic_test1/dir
svn: subversion/libsvn_subr/path.c:377: svn_path_basename: Assertion `is_canonical (path, len)' failed.
Aborted

The stack trace is as follows:

#0 0x00365402 in __kernel_vsyscall ()
#1 0x0085b1f8 in raise () from /lib/libc.so.6
#2 0x0085c948 in abort () from /lib/libc.so.6
#3 0x0085438e in __assert_fail () from /lib/libc.so.6
#4 0x0031c3b4 in svn_path_basename (path=0x954e870 ".", pool=0x954e820)
    at subversion/libsvn_subr/path.c:377
#5 0x0040f8d1 in svn_wc_is_adm_dir (name=0x954e870 ".", pool=0x954e820)
    at subversion/libsvn_wc/adm_files.c:60
#6 0x00ef1793 in add_dir_recursive (
    dirname=0x9533c58 "/home/dlr/src/subversion/working_copies/basic_test1/dir", adm_access=0x9540c28, force=0, no_ignore=0, ctx=0x9532e68, pool=0x95409d0)
    at subversion/libsvn_client/add.c:331
#7 0x00ef1a82 in add (
    path=0x9533c58 "/home/dlr/src/subversion/working_copies/basic_test1/dir",
    recursive=1, force=0, no_ignore=0, adm_access=0x9540c28, ctx=0x9532e68,
    pool=0x95409d0) at subversion/libsvn_client/add.c:413
#8 0x00ef1b9b in svn_client_add3 (
    path=0x9533c58 "/home/dlr/src/subversion/working_copies/basic_test1/dir",
    recursive=1, force=0, no_ignore=0, ctx=0x9532e68, pool=0x95409d0)
    at subversion/libsvn_client/add.c:448
#9 0x0804be42 in svn_cl__add (os=0x9532ab0, baton=0xbfb37818, pool=0x9532998)
    at subversion/clients/cmdline/add-cmd.c:65
#10 0x08052826 in main (argc=3, argv=0xbfb379c4)
    at subversion/clients/cmdline/main.c:1503

The error occurs because "." is passed to svn_wc_is_adm_dir(), which
eventually triggers the is_canonical() assertion failure in
svn_path_basename(). add_dir_recursive(), the caller of
svn_wc_is_adm_dir(), contains code which filters out empty, parent,
and "." paths, but that code isn't executed in time.

The attached patch corrects this misbehavior (I'll commit it for the
time being), but while looking through svn_io.h, I noticed that there
are some functions which declare similar filtering behavior
(e.g. svn_io_get_dirents2). Would someone familiar with this code
please comment on whether one of these alternate functions would be
more appropriate? Thanks!

-- 
Daniel Rall


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

  • text/plain attachment: patch
Received on Fri Oct 28 02:02:20 2005

This is an archived mail posted to the Subversion Dev mailing list.