open my $fh, '>', $target
or $self->_croak("open(\$fh, '>', \$self->target): $!");
- my (%seen, $id);
+ my $id = 0;
+ my %seen;
for (sort { $a->data cmp $b->data }
grep !$seen{$_->data}++, @{$self->{supps}}) {
print $fh "{\n"
=head2 C<parse>
- $tvp->parse($session, $fh);
+ my $aborted = $tvp->parse($session, $fh);
-Parse the output of the C<valgrind> process attached to the session C<$session> received through the filehandle C<$fh>.
+Parses the output of the C<valgrind> process attached to the session C<$session> received through the filehandle C<$fh>.
+Returns true when the output indicates that C<valgrind> has aborted.
This method must be implemented when subclassing.
while (<$fh>) {
s/^\s*#\s//; # Strip comments
- next if /^==/; # Valgrind info line
+ if (/^==/) { # Valgrind info line
+ if (/Signal 11 being dropped from thread/) {
+ # This might loop endlessly
+ return 1;
+ }
+ next;
+ }
s/^\s*//; # Strip leading spaces
s/<[^>]+>//; # Strip tags
kind => 'Suppression',
data => $_,
)) for @supps, @extra;
+
+ return 0;
}
=head1 SEE ALSO
$self->protocol_version(undef);
- return;
+ return 0;
}
sub finish {
close $vwtr or $self->_croak("close(\$vwtr): $!");
- $self->parser->parse($self, $vrdr);
+ my $aborted = $self->parser->parse($self, $vrdr);
+
+ kill -(POSIX::SIGKILL()) => $pid if $aborted;
$self->{exit_code} = (waitpid($pid, 0) == $pid) ? $? >> 8 : 255;