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

Re: svn client API: svn_client_commit crashes

From: Daniel Rall <dlr_at_collab.net>
Date: 2007-01-04 20:51:16 CET

On Thu, 04 Jan 2007, MONTEUX Eric wrote:
...
> I use the svncpp API, subversion 1.4.0, under Windows XP with Visual
> studio 7.1.

What happens when you use Subversion's C API directly? (We don't
maintain the svncpp API, and I don't personally know anything about
it.)

> I have a problem while trying to commit a file into my repository
> using the API, it crashes apparently while calling the
> checkout_resource function (apparently in the last instruction
> "free(locn)" on line 591 of the commit.c file.

locn is the value of the "Location" HTTP header sent back from
mod_dav_svn to libsvn_ra_dav. Line 580 of commit.c verifies that locn
is non-NULL, so this really shouldn't be happening:

  /* we got the header, right? */
  if (locn == NULL)
    return svn_error_create(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
                            _("The CHECKOUT response did not contain a "
                              "'Location:' header"));

> I don't encounter this problem using the tortoiseSVN client...

How about with the command-line client? I'd guess this problem is
related to your usage of svncpp, or to its internals.

> Here is my source code (svnIo is a wrapper class around the svncpp
> API, for which the m_client member is a svn::Client instance). I
> initialize the m_client member with a valid username / password
> prior to calling svnIo::commit. I also allocate a contextListener
> that I made in order to set a listener to the context associated
> with my svn::client.
>
> Help would be welcomed, since I don't find a way to fix this...

A stack trace would be useful, as would getting svncpp out of the
picture.

> bool svnIo::commit(const string& path, bool recurse, const string& message)
>
> {
>
> try
>
> {
>
> std::vector<svn::Path> targs;
>
> targs.push_back(path);
>
> svn::Targets targets(targs);
>
> svn::Pool pool;
>
> p_impl->m_client.commit(targets.array(pool), message.c_str(), recurse, false);
>
> return true;
>
> }
>
> catch(svn::ClientException& e)
>
> {
>
> return false;
>
> }
>
> }
>

  • application/pgp-signature attachment: stored
Received on Thu Jan 4 20:51:15 2007

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.