You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Eric S <ej...@americanlowlife.com> on 2005/03/08 00:17:52 UTC

programmer error or bug in Perl swig bindings for API?

I'm trying to make some tools to help the programmers use svn more 
easily where I work.  Our work environment involves each programmer 
maintaining their own branch that has it's changes merged into the devel 
branch (and visa-versa).  Now, at least one of the programmers has 
problems learning new concepts, and thinks learning means writing 
everything down without understanding what any of it means (breath deep, 
let it go, no need to go into that here).  So that we can deal with 
this, one of the programs I wrote walks the programmer through merging 
changes between two branches.  It checks out one branch, reads a 
revisioned property to find out the last change in the other branch that 
has already been committed, applies all changes that come after that 
point, walks the programmer through accepting/editing/reverting each 
change, sets the property to the new value and commits.  It then does 
the same process reversing the two branches.

It seems to work fairly well, except for one issue.  I get repeatable 
segmentation faults while in the svn library when checking out, and 
sometimes (also repeatable and consistent) on switching the working 
directory from one branch to the other.  However, if I replace the API 
calls with system() calls to the svn binary, the checkouts and switches 
all work as expected.

Here's the environment:

FreeBSD 5.3-STABLE as of a month or so ago, running on an AMD Duron, 900 
MHz, with 512MB RAM.
Perl 5.8.5 (with thread support, though I don't use any threads in this 
program).
Subversion 1.1.3 compiled from the ports collection.
subversion-perl 1.1.3 (the perl bindings are a separate port/package 
under FreeBSD).
The repository uses fsfs rather than bdb.
The repository is accessed using local file:/// urls by the program in 
question (actually, by everything so far, only the HTML markup person 
will be accessing it remotely).


As for the code, this is the line that fails:

my $res=$ctx->checkout($destPath,$repository,'HEAD',1);

If I use this, it begins checking out files, but after a period of time, 
dies with a segmentation fault/coredump.

This is the line I replaced it with that works:

system("/usr/local/bin/svn co $destPath $repository >/dev/null");

In both cases, $destPath is in the format 
'file:///storage/svn/llap/branches/branchname' and $repository is 
'llap'.  Now, before I start digging for details inside the coredump, is 
there anything obviously wrong with the line that fails, or a known bug 
that my searching of the archives didn't turn up?

For that matter, has anyone else already written a program to do this, 
or shown why this might be a bad idea?


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

Re: programmer error or bug in Perl swig bindings for API?

Posted by Eric S <ej...@americanlowlife.com>.
Chia-liang Kao wrote:

>Eric S <ejs <at> americanlowlife.com> writes:
>  
>
>>As for the code, this is the line that fails:
>>
>>my $res=$ctx->checkout($destPath,$repository,'HEAD',1);
>>    
>>
>
>Do you have any error handler installed in the perl land?  If so the
>error handler must call die from within.  It's a known issue.
>  
>

Sorry, should have specified that as well, no.  The only handler 
installed is the log message handler, which I don't think would be 
invoked on checkouts and switches, which are the only things I'm having 
problems with.  I'm quite new to subversion, and don't have the 
confidence yet to implement anything that isn't necessary to achieve the 
desired effect.




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

Re: programmer error or bug in Perl swig bindings for API?

Posted by Chia-liang Kao <cl...@clkao.org>.
Eric S <ejs <at> americanlowlife.com> writes:
> 
> As for the code, this is the line that fails:
> 
> my $res=$ctx->checkout($destPath,$repository,'HEAD',1);

Do you have any error handler installed in the perl land?  If so the
error handler must call die from within.  It's a known issue.

> If I use this, it begins checking out files, but after a period of time, 
> dies with a segmentation fault/coredump.

Cheers,
CLK



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