Subject: | Statement and time counts inaccurate if a program forks |
If a perl program forks, then the statements before the fork point count
twice in the coverage report. Also, times seem also to be doubled. This
can be easily tested with the following script:
#!/usr/bin/perl
use strict;
my $x;
for (1..100) {
$x++;
}
if (fork) {
exit;
}
__END__
For example, the $x++ statement count should be only 100 (which it is if
the fork() block is removed), but it's actually 200.
I don't know how to fix this best, but if a fork() can be detected, then
it's probably best to reset all collected statistics in the child process.
Regards,
Slaven