You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Paul Rhea <Pa...@ami.com> on 2007/02/20 17:38:23 UTC

Problem with Using Client and RA APIs from a MSVC 6.0 app built in Debug

We have developed a subversion client in VC6 using library and header files from the subversion developer distribution(svn_win32-1.4.0_dev) & dlls from the subversion binary distribution(svn_win32-1.4.0) on Windows XP Professional. We tried to access a repository hosted in Apache 2.0.59 HTTP server. 

When we use svn_ra_lock, svn_ra_unlock and svn_client_import2 (see implementation details below) to lock, unlock and import a file onto a repository with an http url We get Int 3 ( user breakpoint) exception (in the client).

Why does it crash when the application using the APIs (with the HTTP protocol) is in debug mode, but not release mode? 


Please Note

The problem does not occur for svn protocol url (project both in release and debug mode)
The problem does not occur for http protocol url when Vc++ project is in Release Mode.


Apache 2.0.59 HTTP server config Details:

Added mod_dav_svn.so and mod_authz_svn.so from subversion (svn_win32-1.4.0) binary distribution and added following lines in httpd.conf file
	LoadModule dav_svn_module modules/mod_dav_svn.so
	LoadModule authz_svn_module   modules/mod_authz_svn.so
	
Added the following lines in httpd.conf file
	<Location /svn>
		DAV svn
		SVNParentPath <repos path>
		AuthzSVNAccessFile <access file path>
		Satisfy Any
		Require valid-user  	
		AuthType Basic
		AuthName "Subversion repository"
		AuthUserFile <password file>
	</Location>


Subversion client implementation for the import, lock and unlock command

1.Import command
	After initilizing apr pool - parent pool and subpool, svn_client_context and authentication, We invoked the svn_client_import2 in the following way 
	1. Created the commit info svn_create_commit_info 
	2. Added log message to log_msg_baton2 of svn_client_context
	3. Invoked the svn_client_import2 with the following parameters 
		commitinfo - allotted during step 1 
		path -  to import the directory 
		url -  repository url 
		nonrecursive - true 
		no-ignore - true 
		ctx - client context 
		pool - apr pool - subpool


2.Lock command
	After initilizing apr pool - parent pool and subpool, svn_client_context and authentication, We invoked the svn_client_lock in the following way 
	1. Created the pool using svn_pool_create and cleared it by svn_pool_clear
	2. Invoke svn_path_canonicalize method with 
		url - lock file url
		pool created in step 1. 
	3. Invoke  svn_path_uri_encode method with
		url - output parameter from step 2 
		pool created in step 1.  
	4. Create apr_array_header_t having url from step 3 
	5. Invoke organize_lock_targets method with - 
		common_parent - output parameter
		adm_acces - svn_wc_adm_access_t varaiable
		paht_revs - apr_hash_t varaible
		urls_to_paths - apr_hash_t varaible
		targets - apr_array header_t varaible - from step 4
		do_lock - TRUE 
		steal_lock - FALSE
		client context during initilization 
		pool created in step 1.  
	6. create session by invoking svn_client_open_ra_session method with -
		session - svn_ra_session_t output varaible
		common_parent - from step 5
		client context during initilization 
		pool created in step 1.  
	
	7. Invoke svn_ra_lock method with -
		pSession - from step 6
		path_revs - from step 5
		comment - varaible created by apr_pstrdup method invoked with comment got from user 
		steal_lock - false
		lock_func - callback function
		client context during initilization 
		pool created in step 1.

3.Unlock command
	After initilizing apr pool - parent pool and subpool, svn_client_context and authentication, We invoked the svn_client_unlock in the following way 
	1. Created the pool using svn_pool_create and cleared it by svn_pool_clear, follow steps 2 to 3 from lock creation, and fettch the lock tokens to be unlocked using fetch_tokens method.
	2. Invoke svn_ra_unlock with the following arguments
		svn_ra_session_t *session - session created using svn_client_open_ra_session 
		apr_hash_t *path_tokens - apr_hash_t varaibale created using organize_lock_targets method
		svn_boolean_t break_lock - True
		svn_ra_lock_callback_t lock_func -  callback func
		void *lock_baton 
	        apr_pool_t *pool - pool created in step 1. 


Additional Information:

	If we further debug into the call stack of the lock operation, the heap corruption error is traced from ne_lock (calls inturn nelockfree) method in libneon implemntation. In the call stack of the import operation, the heap corruption is traced from commit_resource (calls inturn freeurl) method in commit.c of libsvn_ra_dav.

	The same problem exist even if we use the libraries and dlls from the svn1.4.2 distribution.

Your help is greatly appreciated.

Re: Problem with Using Client and RA APIs from a MSVC 6.0 app built in Debug

Posted by "D.J. Heap" <dj...@gmail.com>.
On 2/20/07, Paul Rhea <Pa...@ami.com> wrote:
[snip]
>
> Why does it crash when the application using the APIs (with the HTTP
> protocol) is in debug mode, but not release mode?


Can you try buliding against 1.4.3?  I believe this bug is fixed in
that release.

DJ

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org