Possible access violation in svn_client_copy
From: Michael Pfob <m.pfob_at_3s-software.com>
Date: Fri, 4 Jul 2008 12:07:54 +0200
Hello Subversion Developers,
I possibly found a bug in the implementation of the svn_client_copy
The problem occurs when I call svn_client_copy/svn_client_copy4 into an
I was not able to reproduce this access violation using the svn
------------------------------------------------------------------------
libsvn_client-1.dll!path_driver_cb_func(void * *
libsvn_delta-1.dll!svn_delta_path_driver(const
libsvn_client-1.dll!repos_to_repos_copy(svn_commit_info_t *
libsvn_client-1.dll!setup_copy(svn_commit_info_t * *
libsvn_client-1.dll!svn_client_copy4(svn_commit_info_t * *
svncrash.exe!main() Line 72 + 0x20 bytes C++
svncrash.exe!__tmainCRTStartup() Line 586 + 0x19 bytes
svncrash.exe!mainCRTStartup() Line 403 C
> kernel32.dll!7c816fd7()
[Frames below may be incorrect and/or missing, no symbols
libeay32.dll!00530022()
------------------------------------------------------------------------
To reproduce the problem, you need to compile the following source code
------------------------------------------------------------------------
// svncrash.cpp : Defines the entry point for the console application.
//
#include <svn_client.h>
#include <svn_pools.h>
#include <svn_utf.h>
#include <svn_path.h>
// TODO: adapt the path to the extracted repository
#define REPOSITORYPATHPREFIX "file:///d:/temp/rep/"
svn_error_t* SimplePrompt(svn_auth_cred_simple_t **cred, void *baton,
{
svn_auth_cred_simple_t *ret = (svn_auth_cred_simple_t
ret->username = "test";
ret->password = "test";
*cred = ret;
return SVN_NO_ERROR;
}
svn_error_t* UserPrompt(svn_auth_cred_username_t **cred,void
{
svn_auth_cred_username_t *ret = (svn_auth_cred_username_t
ret->username = "test";
*cred = ret;
return SVN_NO_ERROR;
}
const char* PstrDupPathEncode(const char* psz, apr_pool_t* pool)
{
const char* c;
svn_utf_cstring_to_utf8(&c, psz, pool);
return svn_path_uri_encode(c, pool);
}
int main()
{
apr_initialize();
apr_pool_t* pPool = svn_pool_create_ex(NULL, NULL);
svn_client_ctx_t *ctx = NULL;
svn_client_create_context(&ctx, pPool);
svn_auth_baton_t *auth_baton;
svn_auth_provider_object_t *provider;
apr_array_header_t *providers = apr_array_make(pPool, 1, sizeof
svn_client_get_simple_prompt_provider (&provider, SimplePrompt,
APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) =
svn_client_get_username_prompt_provider (&provider, UserPrompt,
APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) =
svn_auth_open (&auth_baton, providers, pPool);
ctx->auth_baton = auth_baton;
ctx->notify_func2 = NULL;
ctx->notify_baton2 = NULL;
svn_client_copy_source_t source;
source.path = PstrDupPathEncode(REPOSITORYPATHPREFIX "src",
svn_opt_revision_t rev;
rev.kind = svn_opt_revision_head;
source.revision = &rev;
source.peg_revision = &rev;
apr_array_header_t *sources = apr_array_make(pPool, 1,
APR_ARRAY_PUSH(sources, svn_client_copy_source_t*) = &source;
svn_commit_info_t *commit_info = NULL;
/// the same error occurs when svn_client_copy is called
/// This line will provoce a crash if the parent directory exists
svn_error_t* pError = svn_client_copy4(&commit_info, sources,
svn_pool_destroy(pPool);
apr_terminate();
return 0;
}
------------------------------------------------
The error can be reproduced by following those steps:
REM Assumption: We are in D:\temp
@ECHO create repository
svnadmin create rep
@ECHO create two directories
svn mkdir -m "" file:///D:/temp/rep/dest
svn mkdir -m "" file:///D:/temp/rep/src
@ECHO crash the tool
svncrash
I hope this information was enough. Otherwise please ask me for more
Best regards
Michael Pfob
----------------------------------------------------
3S-Smart Software Solutions GmbH
Email: m.pfob_at_3s-software.com <mailto:m.pfob_at_3s-software.com>
Visit the CoDeSys internet forum under http://forum-en.3s-software.com/
3S-Smart Software Solutions GmbH
|
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.