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

RE: Access violation embedding subversion

From: Bert Huijben <rhuijben_at_sharpsvn.net>
Date: Thu, 12 Feb 2009 00:17:00 +0100

Hi,

 

It looks like you miss some required initialization. I think
http://svn.collab.net/repos/svn/trunk/tools/examples/minimal_client.c should
contain a pretty minimalistic example on what you should do to create a
client.

 

Are you sure you wish to use the C api and dynamically loading the dlls and
locating the functions for this?

(There are .lib files available on the tigris download site)

 

I did a lot of work to make this example very trivial in C# and all other
.Net languages by building the SharpSvn library.

 

(Available on http://sharpsvn.net/. Used by AnkhSVN, the Collabnet desktop
for Visual Studio and at least dozens of others of tools around the net).

 

using (SvnClient client = new SvnClient())

{

    Guid id;

    if (client.TryGetRepositoryId(new Uri("http://mrbig/svn/repos/pcs"), out
id))

    {

        // id contains your repository id

    }

}

 

Just using the client without special actions does all default
initialization, like reading your authorization cache, etc.

 

                Bert

 

From: John Gourlay [mailto:gourlay_at_BAUERCONTROLS.com]
Sent: Wednesday, February 11, 2009 9:16 PM
To: users_at_subversion.tigris.org
Subject: Access violation embedding subversion

 

I'm hoping to embed some of the features of subversion in another product in
Windows by loading the dlls installed with the subversion command-line
client. I've made a few simple things work, but I'm getting an access
violation in a call to svn_client_uuid_from_url. Can anyone see what I'm
doing wrong?

 

Attached is a little C program that I'm using as a proof of principle. It
does the following:

 

Loads the libraries libsvn_client-1.dll and libapr-1.dll. These came with
version 1.5.4 of the command-line client.

 

Gets the addresses of various functions in the libraries.

 

Gets the subversion client version number (1.5.4).

 

Creates an apr allocator and then an apr pool.

 

Creates a subversion context.

 

Everything works to this point. Then, it calls svn_client_uuid_from_url,
which crashes the program with an access violation reading location
0x00000008. It looks like svn_client_uuid_from_url calls
svn_client__open_ra_session_internal, which calls svn_ra_open3. The crash
occurs somewhere in svn_ra_open3.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1141496

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-02-12 03:52:27 CET

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