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

Re: SVN Perl Bus Error

From: Brooke Smith <novorivus_at_optusnet.com.au>
Date: 2005-02-20 01:30:56 CET

Hi all,

I've had a bit more of a play with this and its almost working.

Two changes were necessary:

1. Change (in my $SVN::Error::handler subroutine - see below):

my $lsvn_error_t = shift;

to

my $lsvn_error_t = $_[0];

Why does this works?

2. I had to croak or confess in the error handler:

SNV::Error::croak_on_error(@_); or
SNV::Error::confess_on_error(@_);

So now I have the error handler:

sub error_handler_ls_croak() {
   my $lsvn_error_t = $_[0];

   $lsvn_error_t -> message();
   SVN::Error::croak_on_error($lsvn_error_t);
}

and the code now works without generating a Bus Error. I'm relieved to
have this much sorted out.

I'm guessing the croak or confess methods are necessary due to the
clear() method that they call (however if I call this with croaking I
still get a Bus Error).

However, I don't want to always croak or confess upon an error. There
is the method 'SVN::Error::ignore_error() which I call in exactly the
same fashion:

SNV::Error::ignore_error($lsvn_error_t);

But using this instead of croak or confess still gives a Bus Error
(after a delay). I've written in debug print STDERR statements, and
the error happens after control returns to the handler (after calling
SVN::Error::ignore_error).

I would really really really appreciate if someone could try out the
attached script to see if they have the same problem. You'll need to
fix the script in the following ways:
1. Rename the attached script from simple.pl.in to simple.pl,
2. Change your shebang if your perl isn't in /usr/bin/perl, and
3. Define $gRepoPath to be a directory that doesn't exist in a
repository that does

.

Thanks,

Brooke

On 10/02/2005, at 9:29 PM, Brooke Smith wrote:

> Gidday all,
>
> About a month ago I wrote of a problem running Perl SVN code (svn,
> version 1.1.1 (r11581) compiled Jan 15 2005, 12:50:36). I was
> getting a Segmentation Fault. This was under Mac OS X 10.3.4. I left
> it as something to work out and that it might be a Mac OS X problem.
> Recently our sysadmin installed SVN 1.1.3 on Solaris 8 box and the
> same thing happened with exactly the same test code. The code (below
> and attached) does an 'ls' of a path that doesn't exist. If the path
> exists it doesn't seg fault ('svn://eeow/new/tags' doesn't exist but
> 'svn://eeow/new' does):
>
> use SVN::Client;
>
> my $ctx = new SVN::Client();
>
> $SVN::Error::handler=sub(){
> my $lsvn_error_t = shift;
>
> print STDERR "SVN::Error::handler - object: $lsvn_error_t\n";
> print STDERR " message: " . $lsvn_error_t -> message() . "\n";
> };
>
> print STDERR "Call ls(svn://eeow/new/tags, 'HEAD', 1)\n";
>
> eval{$ctx -> ls('svn://eeow/new/tags', 'HEAD', 1);};
> if ($@) {
> print STDERR "Error: $@\n";
> exit 1;
> }
>
> Now when I run the same code at home I'm getting a bus error. Here is
> the stdoutput.
>
> bsmith@eeow newVersion $ ktrace -t cnisuw ./simple.pl
> Call ls(svn://eeow/new/tags, 'HEAD', 1)
> SVN::Error::handler - object: _p_svn_error_t=SCALAR(0x188dd90)
> message: URL 'svn://eeow/new/tags' non-existent in that revision
> Bus error
>
> Seeing it is happening on two platforms it seems like a problem not
> specifically related to Mac OS X. I'm attaching the ktrace output
> file and would appreciate if it could be inspected to see if anything
> stands out.
>
> We would really like to move to SVN from CVS but in this strategic
> move we'd rewrite our tools using Perl and we can't do this if we
> can't get it to work.
>
> Thankyou<ktrace_small.txt><simple.pl>
>
> --
> Brooke Smith <novorivus at optusnet.com.au>
>
> Go directly to jail. Do not pass Go, do not collect
> $200.------------------------------------------------------------------
> ---
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org

---
In a world without walls or fences,
what's the need for Gates and Windows?

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

Received on Sun Feb 20 01:33:23 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.