Skip Menu |

This queue is for tickets about the Test-Valgrind CPAN distribution.

Report information
The Basics
Id: 108873
Status: resolved
Priority: 0/
Queue: Test-Valgrind

People
Owner: Nobody in particular
Requestors: paul [...] city-fan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 1.16
Fixed in: 1.17



Subject: Tests fail due to "Text file busy"
This is with 5.18.4 but I'm seeing similar results with every perl I try: $ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t # Testing Test::Valgrind 1.16, Perl 5.018004, /usr/bin/perl t/00-load.t ................... ok # Using valgrind 3.10.1 located at /usr/bin/valgrind # Generating suppressions... # Suppressions for this perl stored in /builddir/.perl/Test-Valgrind/suppressions/1.16/memcheck-3.10.1-64b3999cd637fdce2e2463e67092e2e9.supp # Using suppressions from /builddir/.perl/Test-Valgrind/suppressions/1.16/memcheck-3.10.1-64b3999cd637fdce2e2463e67092e2e9.supp # 1..1 # not ok 1 - dummy test in the child, should not interfere with the actual TAP stream # # # Failed test 'dummy test in the child, should not interfere with the actual TAP stream' # # at t/10-good.t line 30. # # Looks like you failed 1 test of 1. t/10-good.t ................... ok # Using valgrind 3.10.1 located at /usr/bin/valgrind # Using suppressions from /builddir/.perl/Test-Valgrind/suppressions/1.16/memcheck-3.10.1-64b3999cd637fdce2e2463e67092e2e9.supp # dummy run-time exception, should not cause the test to fail at t/12-good-run-exception.t line 20. t/12-good-run-exception.t ..... ok # Using valgrind 3.10.1 located at /usr/bin/valgrind # Using suppressions from /builddir/.perl/Test-Valgrind/suppressions/1.16/memcheck-3.10.1-64b3999cd637fdce2e2463e67092e2e9.supp # # leaking some bytes! # The subsequent report was correctly caught: # 10,000 bytes in 1 blocks are still reachable in loss record 10 of 10 # malloc (/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) [?:?] # tv_leak (/builddir/build/BUILD/Test-Valgrind-1.16/blib/arch/auto/Test/Valgrind/Valgrind.so) [Valgrind.xs:34] # XS_Test__Valgrind_leak (/builddir/build/BUILD/Test-Valgrind-1.16/blib/arch/auto/Test/Valgrind/Valgrind.so) [Valgrind.xs:54] # Perl_pp_entersub (/usr/lib64/libperl.so.5.18.4) [?:?] # Perl_runops_standard (/usr/lib64/libperl.so.5.18.4) [?:?] # perl_run (/usr/lib64/libperl.so.5.18.4) [?:?] # ? (/usr/bin/perl) [?:?] # (below main) (/usr/lib64/libc-2.20.so) [?:?] t/20-bad.t .................... ok # Using IO::Handle 1.34 # Using IO::Select 1.21 # Using IPC::Open3 1.13 t/30-skip.t ................... ok Can't exec "/tmp/3kdi0uYEDF": Text file busy at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 128. Use of uninitialized value $ver in pattern match (m//) at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 129. Can't exec "/tmp/c6X72bPcvc": Text file busy at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 128. Use of uninitialized value $ver in pattern match (m//) at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 129. # Failed test 'new valgrind' # at t/70-session.t line 48. # got: 'No appropriate valgrind executable could be found at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 140. # Test::Valgrind::Session::new("Test::Valgrind::Session", "valgrind", "/tmp/c6X72bPcvc", "min_version", "3.1.0") called at t/70-session.t line 44 # eval {...} called at t/70-session.t line 44 # ' # expected: '' # Failed test ''new valgrind isa Test::Valgrind::Session' isa 'Test::Valgrind::Session'' # at t/70-session.t line 49. # 'new valgrind isa Test::Valgrind::Session' isn't defined Can't exec "/tmp/3kdi0uYEDF": Text file busy at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 128. Use of uninitialized value $ver in pattern match (m//) at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 129. Can't exec "/tmp/c6X72bPcvc": Text file busy at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 128. Use of uninitialized value $ver in pattern match (m//) at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 129. # Failed test 'old and new valgrind' # at t/70-session.t line 56. # got: 'No appropriate valgrind executable could be found at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 140. # Test::Valgrind::Session::new("Test::Valgrind::Session", "search_dirs", ARRAY(0x1c1cdc0), "valgrind", ARRAY(0x181f200), "min_version", "3.1.0") called at t/70-session.t line 51 # eval {...} called at t/70-session.t line 51 # ' # expected: '' # Failed test ''old and new valgrind isa Test::Valgrind::Session' isa 'Test::Valgrind::Session'' # at t/70-session.t line 57. # 'old and new valgrind isa Test::Valgrind::Session' isn't defined # Looks like you failed 4 tests of 7. t/70-session.t ................ Dubious, test returned 4 (wstat 1024, 0x400) Failed 4/7 subtests t/71-session-command.t ........ ok # The default suppression file contains 18 suppressions, of which 18 are not empty and 18 apply to perl Can't exec "/tmp/bfaqdt2206": Text file busy at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 128. Use of uninitialized value $ver in pattern match (m//) at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 129. # Failed test 'incompatible suppression file' # at t/80-suppressions.t line 130. # 'No appropriate valgrind executable could be found at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 140. # Test::Valgrind::Session::new("Test::Valgrind::Session", "valgrind", "/tmp/bfaqdt2206", "no_def_supp", 1, "extra_supp", ARRAY(0x1621400)) called at t/80-suppressions.t line 121 # eval {...} called at t/80-suppressions.t line 121 # ' # doesn't match '(?^:No compatible suppressions available)' Can't exec "/tmp/bfaqdt2206": Text file busy at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 128. Use of uninitialized value $ver in pattern match (m//) at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 129. # Failed test 'incompatible suppression file, but forced' # at t/80-suppressions.t line 143. # got: 'No appropriate valgrind executable could be found at /builddir/build/BUILD/Test-Valgrind-1.16/blib/lib/Test/Valgrind/Session.pm line 140. # Test::Valgrind::Session::new("Test::Valgrind::Session", "valgrind", "/tmp/bfaqdt2206", "no_def_supp", 1, "allow_no_supp", 1, "extra_supp", ARRAY(0x1621400), ...) called at t/80-suppressions.t line 133 # eval {...} called at t/80-suppressions.t line 133 # ' # expected: '' # Looks like you failed 2 tests of 4. t/80-suppressions.t ........... Dubious, test returned 2 (wstat 512, 0x200) Failed 2/4 subtests t/81-suppressions-demangle.t .. ok Test Summary Report ------------------- t/70-session.t (Wstat: 1024 Tests: 7 Failed: 4) Failed tests: 4-7 Non-zero exit status: 4 t/80-suppressions.t (Wstat: 512 Tests: 4 Failed: 2) Failed tests: 3-4 Non-zero exit status: 2 Files=9, Tests=79, 9 wallclock secs ( 0.03 usr 0.00 sys + 8.66 cusr 0.20 csys = 8.89 CPU) Result: FAIL Failed 2/9 test programs. 6/79 subtests failed. Makefile:1070: recipe for target 'test_dynamic' failed make: *** [test_dynamic] Error 255
From: paul [...] city-fan.org
1.17 resolves the Text File Busy issue but there are some compatibility issues with old set-ups: 1. Use of File::Temp->newdir in the test suite means that the test suite now requires File::Temp 0.19 or later. 2. Prior to version 0.87_01, Test::Builder would emit "Skip" in the TAP output rather than "SKIP" with the skip reason, so the test regexes would need to accept either in t/30-skip.t in order to still work with old Test::Builder versions.
From: paul [...] city-fan.org
On Fri Nov 13 11:37:45 2015, paul@city-fan.org wrote: Show quoted text
> 1.17 resolves the Text File Busy issue but there are some > compatibility issues with old set-ups: > > 1. Use of File::Temp->newdir in the test suite means that the test > suite now requires File::Temp 0.19 or later. > > 2. Prior to version 0.87_01, Test::Builder would emit "Skip" in the > TAP output rather than "SKIP" with the skip reason, so the test > regexes would need to accept either in t/30-skip.t in order to still > work with old Test::Builder versions.
Attached patch fixes compatibility with old Test::Builder versions. I'm still seeing some warnings from File::Temp when running the tests on slightly older systems: $ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t # Testing Test::Valgrind 1.17, Perl 5.016003, /usr/bin/perl t/00-load.t ................... ok # Using valgrind 3.8.1 located at /usr/bin/valgrind # Generating suppressions... # Suppressions for this perl stored in /builddir/.perl/Test-Valgrind/suppressions/1.17/memcheck-3.8.1-f1d9115d8e70359e11ca09409c393eaf.supp # Using suppressions from /builddir/.perl/Test-Valgrind/suppressions/1.17/memcheck-3.8.1-f1d9115d8e70359e11ca09409c393eaf.supp # 1..1 # not ok 1 - dummy test in the child, should not interfere with the actual TAP stream # # # Failed test 'dummy test in the child, should not interfere with the actual TAP stream' # # at t/10-good.t line 30. # # Looks like you failed 1 test of 1. t/10-good.t ................... ok # Using valgrind 3.8.1 located at /usr/bin/valgrind # Using suppressions from /builddir/.perl/Test-Valgrind/suppressions/1.17/memcheck-3.8.1-f1d9115d8e70359e11ca09409c393eaf.supp # dummy run-time exception, should not cause the test to fail at t/12-good-run-exception.t line 20. t/12-good-run-exception.t ..... ok # Using valgrind 3.8.1 located at /usr/bin/valgrind # Using suppressions from /builddir/.perl/Test-Valgrind/suppressions/1.17/memcheck-3.8.1-f1d9115d8e70359e11ca09409c393eaf.supp # # leaking some bytes! # The subsequent report was correctly caught: # 10,000 bytes in 1 blocks are still reachable in loss record 12 of 12 # malloc (/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) [vg_replace_malloc.c:270] # tv_leak (/builddir/build/BUILD/Test-Valgrind-1.17/blib/arch/auto/Test/Valgrind/Valgrind.so) [Valgrind.xs:34] # XS_Test__Valgrind_leak (/builddir/build/BUILD/Test-Valgrind-1.17/blib/arch/auto/Test/Valgrind/Valgrind.so) [Valgrind.xs:54] # Perl_pp_entersub (/usr/lib64/perl5/CORE/libperl.so) [?:?] # Perl_runops_standard (/usr/lib64/perl5/CORE/libperl.so) [?:?] # perl_run (/usr/lib64/perl5/CORE/libperl.so) [?:?] # ? (/usr/bin/perl) [?:?] # (below main) (/usr/lib64/libc-2.16.so) [?:?] t/20-bad.t .................... ok # Using IO::Handle 1.33 # Using IO::Select 1.21 # Using IPC::Open3 1.12 t/30-skip.t ................... ok tempfile(): temporary filename requested but not opened. Possibly unsafe, consider using tempfile() with OPEN set to true tempfile(): temporary filename requested but not opened. Possibly unsafe, consider using tempfile() with OPEN set to true t/70-session.t ................ ok t/71-session-command.t ........ ok # The default suppression file contains 20 suppressions, of which 20 are not empty and 20 apply to perl tempfile(): temporary filename requested but not opened. Possibly unsafe, consider using tempfile() with OPEN set to true t/80-suppressions.t ........... ok t/81-suppressions-demangle.t .. ok All tests successful. Files=9, Tests=79, 9 wallclock secs ( 0.03 usr 0.00 sys + 8.84 cusr 0.22 csys = 9.09 CPU) Result: PASS
Subject: Test-Valgrind-1.17-old-Test::Builder.patch
Prior to version 0.87_01, Test::Builder would emit "Skip" in the TAP output rather than "SKIP" with the skip reason --- t/30-skip.t +++ t/30-skip.t @@ -15,7 +15,7 @@ use Test::Valgrind::FakeValgrind; SKIP: { my ($stat, $out, $err) = capture_perl 'BEGIN { delete $ENV{PATH} } use Test::Valgrind; 1'; skip CAPTURE_PERL_FAILED($out) => 1 unless defined $stat; - like $out, qr/^1..0 # SKIP Empty valgrind candidates list/, + like $out, qr/^1..0 # (SKIP|Skip) Empty valgrind candidates list/, 'correctly skip when no valgrind is available'; } @@ -31,7 +31,7 @@ SKIP: { my ($stat, $out, $err) = capture_perl "BEGIN { \$ENV{PATH} = q[$tmp_dir] } use Test::Valgrind; 1"; skip CAPTURE_PERL_FAILED($out) => 1 unless defined $stat; - like $out, qr/^1..0 # SKIP No appropriate valgrind executable could be found/, + like $out, qr/^1..0 # (SKIP|Skip) No appropriate valgrind executable could be found/, 'correctly skip when no good valgrind was found'; } @@ -47,7 +47,7 @@ SKIP: { my ($stat, $out, $err) = capture_perl "BEGIN { \$ENV{PATH} = q[$tmp_dir] } use Test::Valgrind no_def_supp => 1, extra_supps => [ q[t/supp/no_perl] ]; 1"; skip CAPTURE_PERL_FAILED($out) => 1 unless defined $stat; - like $out, qr/^1..0 # SKIP No compatible suppressions available/, + like $out, qr/^1..0 # (SKIP|Skip) No compatible suppressions available/, 'correctly skip when no compatible suppressions were available'; }
Le Dim 15 Nov 2015 09:11:23, paul@city-fan.org a écrit : Show quoted text
> On Fri Nov 13 11:37:45 2015, paul@city-fan.org wrote:
> > 1.17 resolves the Text File Busy issue but there are some > > compatibility issues with old set-ups: > > > > 1. Use of File::Temp->newdir in the test suite means that the test > > suite now requires File::Temp 0.19 or later. > > > > 2. Prior to version 0.87_01, Test::Builder would emit "Skip" in the > > TAP output rather than "SKIP" with the skip reason, so the test > > regexes would need to accept either in t/30-skip.t in order to still > > work with old Test::Builder versions.
Thanks for the heads up. Show quoted text
> > I'm still seeing some warnings from File::Temp when running the tests > on slightly older systems:
This was caused by old versions of Test::Harness, which used to run the tests with -w. The original issue this ticket refers to has been fixed in version 1.17, and the test nits in version 1.18.