Programming updates (Perl, MogileFS, Catalyst, DBIx::Class etc)

Mar 02, 2009 18:46

So I haven't written much in here in a while, and I decided that I wanted to re-purpose this blog into something more programming oriented. Now I won't be talking so much about specific things or how to do specific things (maybe a little) but more like venting and bitching about problems that I run into in my everyday life as a programmer - you know in the fine blogging tradition.

This is what I've been up to:
*) For the past almost 2 years I've been working heavily on my own company that does some virtual web 2.0 based PBX solutions
*) ^ This has been a pretty big failure so far due to some other non-technical related things with my partners and the all mighty dollar
*) I recently started working for a to remain unnamed company in Canada.
*) Most of what I do at this new job is the same as I did at other jobs only I officially get paid to contribute to FOSS projects when they are related to my internal projects. That means that if there is an upstream bug in something (framework - whatever) that I'm using, I get to fix or help fix it on the clock. This of course makes this new job really really cool, among other reasons.
*) I started contributing to the MogileFS distributed filesystem project from Danga - so far all I've really done is add distributed locking via DDlock and fix a few minor things in the database drivers. I'll probably start contributing more and more to MogileFS as I begin to use it in more "systems".
*) I've switched all my web based development to Catalyst and the MVC way...
*) I no longer write queries into my code I've been using DBIx::Class
*) ^ I've started to contribute to DBIx::Class -> so far it's just been a few minor bug fixes and corrected BLOB support when using Oracle.

Right now I'm trying to track down and squash a bug in Perl (might just be Devel::Symdump) that causes a segv when assigning a local typeglob or typeglob reference to a package with a symbol that's typeglob comes across as a GLOB (like Compress::Zlib::GZIP_NULL_BYTE);

Here is the test:

#!/bin/env prove

use strict;
use warnings;
use Test::More 'no_plan';
use English;

diag("OS == $^O");

use_ok('Compress::Zlib');
use_ok('Devel::Symdump');

diag('$Devel::Symdump::VERSION == '.$Devel::Symdump::VERSION);
diag('$Compress::Zlib::VERSION == '.$Compress::Zlib::VERSION);
diag("Perl == $]");

my $glob_ref = eval {
no strict 'refs';
${*{"Compress::Zlib::"}}{GZIP_NULL_BYTE};
};

ok(!$@,'reference assignment');
diag('ref($glob_ref) == "'.ref($glob_ref).'"');

_check_child(sub {
local *ENTRY;
diag "Checking GLOB assignment to reference...";
*ENTRY = $glob_ref;
});

_check_child(sub {
diag "Checking Devel::Symdump->rnew->packages...";
Devel::Symdump->rnew->packages;
});

sub _check_child {
local *CHILD;

my $code = shift;
my $pid = open(CHILD, "|-");

unless ($pid) {
$code->();
exit 0;
} else {
my $w = waitpid($pid,0);
ok($w != -1 && $w == $pid,'waitpid()');
my $e = $? >> 8;
my $s = $? & 127;
my $c = $? & 128;
diag "exit value = $e";
diag "exit with signal = $s";
diag "dumped core? $c";
ok($s != 11,'child did not SEGV');
ok($e == 0 && $s == 0,'child exited properly');
}
}
Previous post
Up