views:

144

answers:

2

I'm kinda new to Module::Build, so maybe I did something wrong. Am I the only one who gets warnings when I change my dispatch from "test" to "testcover"? Is there a bug in Devel::Cover? Is there a bug in Module::Build? I probably just did something wrong.

I'm using ActiveState Perl v5.10.0 with Module::Build version 0.31012 and Devel::Cover 0.64 and Eclipse 3.4.1 with EPIC 0.6.34 for my IDE.

UPDATE: I upgraded to Module::Build 0.34 and the warnings are still output.

UPDATE: Looks like a bug in B::Deparse. Hope it gets fixed someday.

Here's my unit test build file:

use strict;
use warnings;
use Module::Build;

my $build = Module::Build->resume (
  properties => {
    config_dir => '_build',
  },
);

$build->dispatch('test');

When I run this unit test build file, I get the following output:

t\MyLib1.......ok 
t\MyLib2.......ok 
t\MyLib3.......ok 
All tests successful. 
Files=3, Tests=24,  0 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00 CPU)

But when I change the dispatch line to 'testcover' I get the following output which always includes a bunch of "use of uninitialized value in bitwise and" warning messages:

Deleting database D:/Documents and Settings/<username>/My Documents/<SNIP>/cover_db
t\MyLib1.......ok
Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252.
Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252.
t\MyLib2.......ok
Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252.
Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252.
t\MyLib3.......ok
Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252.
Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252.
All tests successful.
Files=3, Tests=24,  0 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00 CPU)
Reading database from D:/Documents and Settings/<username>/My Documents/<SNIP>/cover_db

---------------------------- ------ ------ ------ ------ ------ ------ ------
File                           stmt   bran   cond    sub    pod   time  total
---------------------------- ------ ------ ------ ------ ------ ------ ------
.../lib/ActivePerl/Config.pm    0.0    0.0    0.0    0.0    0.0    n/a    0.0
...l/lib/ActiveState/Path.pm    0.0    0.0    0.0    0.0  100.0    n/a    4.8
<SNIP>
blib/lib/<SNIP>/MyLib2.pm     100.0   90.0    n/a  100.0  100.0    0.0   98.5
blib/lib/<SNIP>/MyLib3.pm     100.0   90.9  100.0  100.0  100.0    0.6   98.0
Total                          14.4    6.7    3.8   18.3   20.0  100.0   11.6
---------------------------- ------ ------ ------ ------ ------ ------ ------

Writing HTML output to D:/Documents and Settings/<username>/My Documents/<SNIP>/cover_db/coverage.html ...
done.
+2  A: 

Line 4252 is:

$kid = $op->first;
if ( $kid->flags & OPf_SPECIAL # Line 4252
 and ( $] < 5.009 ? $kid->pmflags & PMf_SKIPWHITE()
      : $kid->reflags & RXf_SKIPWHITE() ) ) {
$exprs[0] = "' '";
}

so this seems to be related to $kid->flags not being defined for some reason.

What do you get if you do

perl -MO=Deparse,-d -e my_test_script

Note: I just checked the repository version of B::Deparse and it is at version 0.89 whereas the version installed with my AS Perl 5.10 is version 0.83.

As temporary measure, can you backup Deparse.pm that came with AS Perl and replace it with the current version to see if that makes a difference?

Sinan Ünür
`$kid` could be a no-op, I don't think those get flags. If it is it sounds like a minor bug.
Brad Gilbert
@Brad thank you. I do not know much about internals but what you say makes sense.
Sinan Ünür
I don't actually know that much, but I do know that the optimizer will leave behind no-ops.
Brad Gilbert
Placed the new Deparse.pm file in and got the same errors. The line number in the errors just moved to line 4295.
Kurt W. Leucht
I don't get what you're asking me to do with that command line. (remember, I use Eclipse Epic IDE, so I don't know command line stuff) It appears to parse the name of my unit test build script when I perform that command line.
Kurt W. Leucht
perl -MO=Deparse,-d -e Build1-UnitTests.pl [ENTER]"Build1" - "UnitTests" . "pl"; [NEWLINE]-e syntax OK
Kurt W. Leucht
A: 

The author of B::Deparse emailed me that he was able to reproduce the error with the following one-liner:

% perl -MO=Deparse -we '$r = qr/foo/; my @a = split($r, $_)' 
BEGIN { $^W = 1; }
$r = qr/foo/;
Use of uninitialized value in bitwise and (&) at /usr/lib/perl/5.10/B/Deparse.pm line 4250.
my(@a) = split(/$r/, $_, 0);
-e syntax OK

Then he asked me to forward the bug to perlbug. I do not know what he is talking about. I hope this doesn't get dropped. Do any of you Perl gurus who are reading this want to take this ball and run with it?

Kurt W. Leucht
perlbug is http://bugs.perl.org/. The bug is fixed: http://rt.perl.org/rt3/Ticket/Display.html?id=71870
daxim

related questions