Skip Menu |

This queue is for tickets about the TAP-Formatter-JUnit CPAN distribution.

Report information
The Basics
Id: 91219
Status: open
Priority: 0/
Queue: TAP-Formatter-JUnit

People
Owner: Nobody in particular
Requestors: kozunov [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.09
Fixed in: (no value)



Subject: JUnit don't report when segfault occure
cat segfault2.t #!/usr/bin/perl use strict; use warnings; use POSIX; $|=1; print "1..1\nok\n"; kill POSIX::SIGSEGV => $$; Let's try test it prove --formatter TAP::Formatter::JUnit ./segfault2.t <testsuites> <testsuite failures="0" errors="0" tests="1" name="segfault2_t"> <testcase name="1"></testcase> <system-out><![CDATA[1..1 ok ]]></system-out> <system-err></system-err> </testsuite> </testsuites> So we don't see a problem and think that all right. I've pathed TAP/Formatter/JUnit/Session.pm 181a182,183 Show quoted text
> } elsif ( my $wait = $parser->wait ) { > $die_msg = "Non-zero wait status: $wait";
after apply this patch, when we run test prove --formatter TAP::Formatter::JUnit ./segfault2.t <testsuites failures="0" errors="0" tests="1"> <testsuite failures="0" errors="1" tests="1" name="linux_segfault2_t"> <system-out><![CDATA[1..1 ok ]]></system-out> <system-err><![CDATA[Non-zero wait status: 139 ]]></system-err> <error message="Non-zero wait status: 139" /> </testsuite> </testsuites>
Subject: [rt.cpan.org #91219] JUnit don't report when segfault occure
Date: Tue, 5 Sep 2017 13:51:14 +0000
To: "bug-TAP-Formatter-JUnit [...] rt.cpan.org" <bug-TAP-Formatter-JUnit [...] rt.cpan.org>
From: Lukas Mai <Mai [...] jochen-schweizer.de>
We ran into this bug, which still affects version 0.11 of TAP::Formatter::JUnit. As the patch indicates, the problem is that the close_test method only checks $parser->exit(), which happens to return 0 for processes that don't have an exit status because they were killed by a signal. It should test $parser->wait() in the first place. Or maybe check $parser->has_problems as a fallback. -- Lukas Mai / Software Developer Jochen Schweizer Technology Solutions GmbH, München Amtsgericht München, HRB 203111 Geschäftsführer: Florian Herschke, Saad Daoud; Prokurist: Herbert Leitz