You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jennifer Bevan <je...@bounce.alouysius.net> on 2002/04/04 22:26:20 UTC

svn @1621 segmentation fault in apr_pool_create_ex

Hi again,
So, I am figuring out how to use the client library so that I can
use it from my research project at school (I'm a grad student at
UCSC).  I found a seg fault in apr_pool_create_ex when attempting 
to create a top-level memory pool using svn_pool_create with a 
NULL argument.

The gdb trace followed by the program is below.  Thanks in advance
for any who see a mistake that I made (i.e., using svn_pool_create 
instead of something else, etc.).

-Jen Bevan


------gdb tree------------------
(gdb) run http://localhost/svn/testres
Starting program: /home/jen/research/svnapi_test/./jen http://localhost/svn/testres
[New Thread 1024 (LWP 31061)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 31061)]
0x401fb677 in apr_pool_create_ex (newpool=0xbffff9c0, parent=0x0, 
    abort_fn=0x40190fe8 <abort_on_pool_failure>, allocator=0x0) at apr_pools.c:708
708	        allocator = parent->allocator;
(gdb) where
#0  0x401fb677 in apr_pool_create_ex (newpool=0xbffff9c0, parent=0x0, 
	abort_fn=0x40190fe8 <abort_on_pool_failure>, allocator=0x0) at apr_pools.c:708
#1  0x401915dc in svn_pool_create (pool=0x0)
	at subversion/libsvn_subr/svn_error.c:428
#2  0x08048656 in main () at eval.c:41
#3  0x40065507 in __libc_start_main (main=0x8048620 <main>, argc=2, 
	ubp_av=0xbffffa54, init=0x804847c <_init>, fini=0x80486b0 <_fini>, 
	rtld_fini=0x4000dc14 <_dl_fini>, stack_end=0xbffffa4c)
	at ../sysdeps/generic/libc-start.c:129
(gdb)

-------main.c------------------------
#include <stdio.h>
#include <stdlib.h>
#include <svn_pools.h>
#include <svn_client.h>

int main(int argc, char **argv) {
apr_pool_t *localPool;

    if(argc != 2) {
		printf("Usage: %s repos_url\n", argv[0]);
		exit(1);
	}

	localPool = svn_pool_create((apr_pool_t *)NULL);
	return(0);
}


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

Re: svn @1621 segmentation fault in apr_pool_create_ex

Posted by Ben Collins-Sussman <su...@collab.net>.
jen@alouysius.net writes:

> Awesome!  Thanks much.
> Now, I get some strange behaviour when I add a call to 
> svn_client_checkout, but there were some commits in the 
> libsvn_client directory so I figured I'd upgrade from r1621
> to the latest before posting.  Basically, I get a .svn
> directory at the specified "path" argument, but not a
> new working copy in its own directory.  Very odd.  

The best thing you can do is to look at example code.

In particular, study the svn client binary itself -- its code is in
subversion/clients/cmdline/.   main.c has all the fancy argument
processing, but ultimately this function just ends up calling one of
the FOO-cmd.c files, which always calls svn_client_FOO().   Imitation
is the best way to get stuff working!

But I'm glad you're trying to do this.  Subversion is boastful about
having a clean, librarized public API -- but of course, nobody has
actually *tested* that yet, beyond our own commandline-application. :-) 

Your feedback on the API is a great chance for us to fix
user-friendliness issues. Feel free to throw more questions at the
developer's list.

-Ben

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

Re: svn @1621 segmentation fault in apr_pool_create_ex

Posted by Ben Collins-Sussman <su...@collab.net>.
> #include <stdio.h>
> #include <stdlib.h>
> #include <svn_pools.h>
> #include <svn_client.h>
> 
> int main(int argc, char **argv) {
> apr_pool_t *localPool;
> 
>     if(argc != 2) {
> 		printf("Usage: %s repos_url\n", argv[0]);
> 		exit(1);
> 	}

Put an apr_initialize() in here, before you start using pools.

> 
> 	localPool = svn_pool_create((apr_pool_t *)NULL);
> 	return(0);
> }
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

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