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

Re: 1.5.x segmentation fault on Repos to Repos copy

From: Karl Fogel <kfogel_at_red-bean.com>
Date: Tue, 20 May 2008 01:14:17 -0400

I wrote:
> Before trying to reproduce with the script below, I wrote a regression
> test for this (see http://pastebin.ca/1021930). When the test
> unexpectedly passed the first time, I wrote the script below...

I forgot that pastebin.ca doesn't do forever storage anymore. Here's
the regression test patch, just so we don't lose it:

[[[
* subversion/tests/cmdline/copy_tests.py
  (unneeded_parents): New test.
  (test_list): Run it.
]]]

Index: subversion/tests/cmdline/copy_tests.py
===================================================================
--- subversion/tests/cmdline/copy_tests.py (revision 31288)
+++ subversion/tests/cmdline/copy_tests.py (working copy)
@@ -3819,6 +3819,57 @@
     svntest.main.safe_rmtree(other_wc_dir)
 
 
+def unneeded_parents(sbox):
+ "svn cp --parents FILE_URL DIR_URL"
+
+ # In this message...
+ #
+ # http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=138738
+ # From: Alexander Kitaev <Alexander.Kitaev_at_svnkit.com>
+ # To: dev_at_subversion.tigris.org
+ # Subject: 1.5.x segmentation fault on Repos to Repos copy
+ # Message-ID: <4830332A.6060301_at_svnkit.com>
+ # Date: Sun, 18 May 2008 15:46:18 +0200
+ #
+ # ...Alexander Kitaev describes the bug:
+ #
+ # svn cp --parents SRC_FILE_URL DST_DIR_URL -m "message"
+ #
+ # SRC_FILE_URL - existing file
+ # DST_DIR_URL - existing directory
+ #
+ # Omitting "--parents" option makes above copy operation work as
+ # expected.
+ #
+ # Bug is in libsvn_client/copy.c:801, where "dir" should be
+ # checked for null before using it in svn_ra_check_path call.
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ iota_url = sbox.repo_url + '/iota'
+ B_url = sbox.repo_url + '/A/B/'
+
+ # The --parents is unnecessary, but should still work (not segfault).
+ svntest.actions.run_and_verify_svn(None, None, [], 'cp', '--parents',
+ '-m', 'log msg', iota_url, B_url)
+
+ # Verify that it worked.
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/B/iota' : Item(status='A '),
+ })
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.add({
+ 'A/B/iota' : Item(contents="This is the file 'iota'.\n"),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+ expected_status.add({
+ 'A/B/iota' : Item(status=' ', wc_rev=2),
+ })
+ svntest.actions.run_and_verify_update(
+ wc_dir, expected_output, expected_disk, expected_status)
+
+
 ########################################################################
 # Run the tests
 
@@ -3895,6 +3946,7 @@
               URI_encoded_repos_to_wc,
               allow_unversioned_parent_for_copy_src,
               replaced_local_source_for_incoming_copy,
+ unneeded_parents,
              ]
 
 if __name__ == '__main__':

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-05-20 07:14:33 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.