Posts Tagged ‘debugging’

I finally got around to trying out the Perl ArcV2 library that
I mentioned earlier. It didn’t go well.

There were some issues early on that were due to me not having the sasl libraries installed on my Ubuntu. After rectifying that it made it past the pre-requisites.

However, the Arc tests did not work.

Running make test
PERL_DL_NONLAZY=1 /u/jared/packages/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/arc1.t .. 1/17 shutdown() on closed socket GEN0 at /u/packages/lib/perl5/5.10.1/i686-linux-thread-multi/IO/Socket.pm line 295.
t/arc1.t .. 2/17
#   Failed test at t/arc1.t line 61.
#   Failed test at t/arc1.t line 63.

Test Summary Report
t/arc1.t (Wstat: 3328 Tests: 17 Failed: 13)
  Failed tests:  3-15
  Non-zero exit status: 13

I glanced at the tests to see what had managed to succeed. It doesn’t look good. Pretty much only ok(1) commands with no predicate passed.

Having said that, the test script looks interesting. It forks a process to fire up the server before running the tests. I’m reminded again how much I miss stuff like fork() when doing Windows development.

use Test::More tests => 17;
use strict;

# To work as a client/server we have to fork

my $pid = fork();

my $user = "mannfred";
my $pass = "klaus";

if ($pid == 0) { # Child
    use Arc::Server;
    use Arc::Connection::Server;
    my $server = new Arc::Server(...);
    exit 0;
} elsif ($pid) { # Parent
    use Arc::Connection::Client;
    ok(1); #1
    sleep(3); # Wait for the server to get ready
    my $client = new Arc::Connection::Client(...) or ok(0);
    ok(1); #2
    my $s;
    if ($client->StartSession()) { ok(1); } else { ok(0); }
    # ...

I then split out the client and server so I could run them individually.

$ perl -Mblib=../blib test-client.pl
[err]: (client) Evaluation of command _RAUTHTYPE failed
(Can't locate auto/Authen/SASL/Cyrus/need_step.al in @INC (@INC contains: ../blib/arch ../blib/lib
/u/packages/lib/perl5/5.10.1/i686-linux-thread-multi /u/packages/lib/perl5/5.10.1
/u/packages/lib/perl5/site_perl/5.10.1/i686-linux-thread-multi /u/packages/lib/perl5/site_perl/5.10.1 .)
at ../blib/lib/Arc/Connection/Client.pm line 157).

The server output looked like this.

$ perl -Mblib=../blib test-server.pl
[info]: (server) Arc v2.1 Session recognized.
[err]: (server) Connection closed by foreign host.

Okay, so it looks like the code has bit-rotted away (the last release was in 2005). This is the line in Arc::Connection::Client that is failing. need_step() is no longer mentioned in the SASL documentation.

if ($sasl->need_step || $sasl->code == 0) {

The question is, how much I would have to change to get this to work. Or to put another way, is what I have already with my AnyEvent based code closer to what I need than the currently broken Arc.

And if it doesn’t even work on Linux, what chance do I have on Windows.


Read Full Post »