You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by John Gourlay <go...@BAUERCONTROLS.com> on 2009/02/11 20:16:04 UTC
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=1140608
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
RE: Access violation embedding subversion
Posted by John Gourlay <go...@BAUERCONTROLS.com>.
Bert,
Thanks for the link to minimal_client.c. I'll look at it carefully.
I thought the only alternative to using the dlls was to compile all of
subversion, apr, etc., into my company's product, something that is
impractical. It's also impractical for me to use a language other than
C/C++. I haven't found any precompiled libraries on
subversion.tigris.org. Can you help me find them?
John
________________________________
From: Bert Huijben [mailto:bert@vmoo.com]
Sent: Wednesday, February 11, 2009 6:17 PM
To: John Gourlay; users@subversion.tigris.org
Subject: RE: Access violation embedding subversion
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@BAUERCONTROLS.com]
Sent: Wednesday, February 11, 2009 9:16 PM
To: users@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=1146957
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
RE: Access violation embedding subversion
Posted by Bert Huijben <rh...@sharpsvn.net>.
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@BAUERCONTROLS.com]
Sent: Wednesday, February 11, 2009 9:16 PM
To: users@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@subversion.tigris.org].