[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

programmer error or bug in Perl swig bindings for API?

From: Eric S <ejs_at_americanlowlife.com>
Date: 2005-03-08 01:17:52 CET

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
Received on Tue Mar 8 01:20:12 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.