Dan Sugalski correctly pointed out that I was triggering different opcodes in the different subs. Here is a test that shows a correct example:
sub foo {
my $re = shift;
my $valid = shift;
for(1..$i) {
$foo =~/$re/;
print "error $1 is not $valid\n" if($1 ne $valid);
}
}
push @threads, IThread->create(\&foo,'(.)','b');
push @threads, IThread->create(\&foo,'.(.)','a');
push @threads, IThread->create(\&foo,'..(.)','r');
And BOOM SEGFAULT. :(
Need to look at this in the weekend.
Thanks Dan!
Artur