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

svn mv segfault

From: Lars Kellogg-Stedman <lars_at_larsshack.org>
Date: 2002-01-29 21:40:00 CET

Here's a new one. And this one's reliable :).

I tried performing the following operation:

   $ svn mv src/config.h.in .

But src/config.h.in wasn't in the repository. This should have
generated an error, right around line 141 in libsvn_wc/copy.c. But
instead it's segfaulting.

This is in copy_file_administratively(), in the following section:

   SVN_ERR (svn_wc_entry (&src_entry, src_path, pool));
   if ((src_entry->schedule == svn_wc_schedule_add)
       || (! src_entry->url))
     return svn_error_createf
       (SVN_ERR_UNSUPPORTED_FEATURE, 0, NULL, pool,
        "Not allowed to copy or move '%s' -- it's not in the repository
yet.\n"
        "Try committing first.",
        src_path->data);

The first thing svn_wc_entry() does is set src_entry to NULL, so upon
our return from svn_wc_entry(), when we try to look at
src_entry->schedule, we're attempting to dereference a NULL pointer. Ouch!

It looks like the real failure may be in svn_wc_entry(), here:

       /* ### it would be nice to avoid reading all of these. or maybe read
          ### them into a subpool and copy the one that we need up to the
          ### specified pool. */
       SVN_ERR (svn_wc_entries_read (&entries, dir, pool));

       *entry = apr_hash_get (entries, basename->data, basename->len);

Since the file isn't under revision control, that hash lookup is
probably going to fail, so src_entry never gets set to anything but NULL.

Cheers,

-- Lars

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:01 2006

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.