Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 2222854 - perl-Test-Valgrind-1.19-22.fc39 FTBFS with perl 5.38.0: t/20-bad.t fails
Summary: perl-Test-Valgrind-1.19-22.fc39 FTBFS with perl 5.38.0: t/20-bad.t fails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-Test-Valgrind
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Paul Howarth
QA Contact: Fedora Extras Quality Assurance
URL: https://koschei.fedoraproject.org/pac...
Whiteboard:
Depends On:
Blocks: F39FTBFS
TreeView+ depends on / blocked
 
Reported: 2023-07-14 07:17 UTC by Petr Pisar
Modified: 2023-08-03 18:26 UTC (History)
2 users (show)

Fixed In Version: perl-Test-Valgrind-1.19-23.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-07-30 16:33:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
CPAN 149286 0 None None None 2023-08-03 18:26:13 UTC

Description Petr Pisar 2023-07-14 07:17:14 UTC
perl-Test-Valgrind-1.19-22.fc39 fails to build because a test fails with perl 5.38.0:

t/00-load.t ................... ok
# Using valgrind 3.21.0 located at /usr/bin/valgrind
# Generating suppressions...
# Suppressions for this perl stored in /builddir/.perl/Test-Valgrind/suppressions/1.19/memcheck-3.21.0-89544340d2cf0ab61f972f6ffa315e7d.supp
# Using suppressions from /builddir/.perl/Test-Valgrind/suppressions/1.19/memcheck-3.21.0-89544340d2cf0ab61f972f6ffa315e7d.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.21.0 located at /usr/bin/valgrind
# Using suppressions from /builddir/.perl/Test-Valgrind/suppressions/1.19/memcheck-3.21.0-89544340d2cf0ab61f972f6ffa315e7d.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.21.0 located at /usr/bin/valgrind
# Using suppressions from /builddir/.perl/Test-Valgrind/suppressions/1.19/memcheck-3.21.0-89544340d2cf0ab61f972f6ffa315e7d.supp
# # leaking some bytes!
#   10,000 bytes in 1 blocks are still reachable in loss record 18 of 18
#     malloc (/usr/libexec/valgrind/vgpreload_memcheck-x86-linux.so) [vg_replace_malloc.c:431]
#     tv_leak (/builddir/build/BUILD/Test-Valgrind-1.19/blib/arch/auto/Test/Valgrind/Valgrind.so) [Valgrind.xs:34]
#     XS_Test__Valgrind_leak (/builddir/build/BUILD/Test-Valgrind-1.19/blib/arch/auto/Test/Valgrind/Valgrind.so) [Valgrind.xs:54]
#     ? (/usr/lib/libperl.so.5.38.0) [?:?]
#     Perl_runops_standard (/usr/lib/libperl.so.5.38.0) [?:?]
#     perl_run (/usr/lib/libperl.so.5.38.0) [?:?]
#     ? (/usr/bin/perl) [?:?]
#     (below main) (/usr/lib/libc.so.6) [?:?]
#   Failed test 'Leak_StillReachable'
#   at /builddir/build/BUILD/Test-Valgrind-1.19/blib/lib/Test/Valgrind/Session.pm line 598.
#          got: 1
#     expected: 0
#   Failed test 'caught one extra leak'
#   at /builddir/build/BUILD/Test-Valgrind-1.19/blib/lib/Test/Valgrind.pm line 307.
#          got: '0'
#     expected: '1'
#   Failed test 'no extra leak caught, hence no bytes leaked'
#   at /builddir/build/BUILD/Test-Valgrind-1.19/blib/lib/Test/Valgrind.pm line 307.
#   Failed test 'no extra leak caught, hence no block leaked'
#   at /builddir/build/BUILD/Test-Valgrind-1.19/blib/lib/Test/Valgrind.pm line 307.
# Looks like your test exited with 1 just after 18.
t/20-bad.t .................... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 4/18 subtests 
# Using IO::Handle 1.52
# Using IO::Select 1.52
# Using IPC::Open3 1.22
t/30-skip.t ................... ok
t/60-version.t ................ ok
t/70-session.t ................ ok
t/71-session-command.t ........ ok
# The default suppression file contains 12 suppressions, of which 12 are not empty and 12 apply to perl
t/80-suppressions.t ........... ok
t/81-suppressions-demangle.t .. ok
Test Summary Report
-------------------
t/20-bad.t                  (Wstat: 256 (exited 1) Tests: 18 Failed: 4)
  Failed tests:  15-18
  Non-zero exit status: 1
Files=10, Tests=200, 39 wallclock secs ( 0.09 usr  0.02 sys + 37.38 cusr  1.17 csys = 38.66 CPU)
Result: FAIL
Failed 1/10 test programs. 4/200 subtests failed.

Comment 1 Paul Howarth 2023-07-24 15:26:26 UTC
This appears to be related to valgrind 3.21.0 rather than Perl 5.38. I did a mock build, keeping the chroot, then "mock ... --remove valgrind" and then "mock ... --install valgrind-3.20.0-3.fc38.x86_64.rpm" and the tests passed with a "mock ... shell" and "make test":

[mockbuild@7e50b388172e4f27b426ac5f2ac2d88a Test-Valgrind-1.19]$ make test
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Valgrind.bs blib/arch/auto/Test/Valgrind/Valgrind.bs 644
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
t/00-load.t ................... 1/1 # Testing Test::Valgrind 1.19, Perl 5.038000, /usr/bin/perl
t/00-load.t ................... ok   
t/10-good.t ................... # Using valgrind 3.20.0 located at /usr/bin/valgrind
# Generating suppressions...
# Suppressions for this perl stored in /builddir/.perl/Test-Valgrind/suppressions/1.19/memcheck-3.20.0-d58730dcab9961e1c0618f9f9a87aee3.supp
# Using suppressions from /builddir/.perl/Test-Valgrind/suppressions/1.19/memcheck-3.20.0-d58730dcab9961e1c0618f9f9a87aee3.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    
t/12-good-run-exception.t ..... # Using valgrind 3.20.0 located at /usr/bin/valgrind
# Using suppressions from /builddir/.perl/Test-Valgrind/suppressions/1.19/memcheck-3.20.0-d58730dcab9961e1c0618f9f9a87aee3.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     
t/20-bad.t .................... # Using valgrind 3.20.0 located at /usr/bin/valgrind
# Using suppressions from /builddir/.perl/Test-Valgrind/suppressions/1.19/memcheck-3.20.0-d58730dcab9961e1c0618f9f9a87aee3.supp
# # leaking some bytes!
t/20-bad.t .................... 1/18 # The subsequent report was correctly caught:
#   10,000 bytes in 1 blocks are still reachable in loss record 18 of 18
#     malloc (/usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) [vg_replace_malloc.c:393]
#     tv_leak (/builddir/build/BUILD/Test-Valgrind-1.19/blib/arch/auto/Test/Valgrind/Valgrind.so) [Valgrind.xs:34]
#     XS_Test__Valgrind_leak (/builddir/build/BUILD/Test-Valgrind-1.19/blib/arch/auto/Test/Valgrind/Valgrind.so) [Valgrind.xs:54]
#     Perl_pp_entersub (/usr/lib64/libperl.so.5.38.0) [pp_hot.c:5555]
#     Perl_runops_standard (/usr/lib64/libperl.so.5.38.0) [run.c:41]
#     UnknownInlinedFun (/usr/lib64/libperl.so.5.38.0) [perl.c:2812]
#     perl_run (/usr/lib64/libperl.so.5.38.0) [perl.c:2727]
#     main (/usr/bin/perl) [perlmain.c:127]
t/20-bad.t .................... ok     
t/30-skip.t ................... # Using IO::Handle 1.52
# Using IO::Select 1.52
# Using IPC::Open3 1.22
t/30-skip.t ................... ok   
t/60-version.t ................ ok       
t/70-session.t ................ ok   
t/71-session-command.t ........ ok   
t/80-suppressions.t ........... 1/4 # The default suppression file contains 12 suppressions, of which 12 are not empty and 9 apply to perl
t/80-suppressions.t ........... ok   
t/81-suppressions-demangle.t .. ok     
All tests successful.
Files=10, Tests=200, 32 wallclock secs ( 0.03 usr  0.00 sys + 17.83 cusr  0.98 csys = 18.84 CPU)
Result: PASS
[mockbuild@7e50b388172e4f27b426ac5f2ac2d88a Test-Valgrind-1.19]$ 

Reassign to valgrind?

Comment 2 Paul Howarth 2023-07-25 09:46:44 UTC
Well, Fedora 38 also has valgrind 3.21.0 and that still builds OK, so it looks like it's the combination of Perl 5.38 and valgrind 3.21.0 that's the problem. Or maybe even something else, like the compiler in Rawhide.

Comment 3 Paul Howarth 2023-07-30 15:56:13 UTC
OK, the test is failing because the trace report from valgrind does not include the symbol 'Perl_pp_entersub' (see the Fedora 38 trace for comparison). Not sure why that is, or if it would be there if debuginfo was installed, so I don't know if this is an upstream issue or not.

In any case, I'm able to work around it by having the test look for the 'XS_Test__Valgrind_leak' and 'Perl_runops_standard' symbols surrounding where 'Perl_pp_entersub' was expected.

Comment 4 Fedora Update System 2023-07-30 16:31:39 UTC
FEDORA-2023-6f45694481 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-6f45694481

Comment 5 Fedora Update System 2023-07-30 16:33:04 UTC
FEDORA-2023-6f45694481 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 Petr Pisar 2023-07-31 12:13:31 UTC
It might be related to this <https://github.com/Perl/perl5/commit/214a9432e04871da2b88eba02ea3f1148a99f9c8> "call_sv, amagic_call: call pp_entersub via runops" Perl commit.

Comment 7 Paul Howarth 2023-07-31 12:38:14 UTC
(In reply to Petr Pisar from comment #6)
> It might be related to this <https://github.com/Perl/perl5/commit/214a9432e04871da2b88eba02ea3f1148a99f9c8> "call_sv, amagic_call: call pp_entersub via runops" Perl commit.

Perhaps. That would then be an issue for upstream. The CPAN Testers matrix isn't helping since the testers don't generally have valgrind installed so the failing test just gets skipped.

Comment 8 Paul Howarth 2023-07-31 12:45:27 UTC
I installed perl-debuginfo and perl-libs-debuginfo then re-ran the tests and the Perl_pp_entersub symbol showed up again:

#   10,000 bytes in 1 blocks are still reachable in loss record 18 of 18
#     malloc (/usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) [vg_replace_malloc.c:431]
#     tv_leak (/builddir/build/BUILD/Test-Valgrind-1.19/blib/arch/auto/Test/Valgrind/Valgrind.so) [Valgrind.xs:34]
#     XS_Test__Valgrind_leak (/builddir/build/BUILD/Test-Valgrind-1.19/blib/arch/auto/Test/Valgrind/Valgrind.so) [Valgrind.xs:54]
#     Perl_pp_entersub (/usr/lib64/libperl.so.5.38.0) [pp_hot.c:5555]
#     Perl_runops_standard (/usr/lib64/libperl.so.5.38.0) [run.c:41]
#     UnknownInlinedFun (/usr/lib64/libperl.so.5.38.0) [perl.c:2812]
#     perl_run (/usr/lib64/libperl.so.5.38.0) [perl.c:2727]
#     ? (/usr/bin/perl) [?:?]
#     (below main) (/usr/lib64/libc.so.6) [?:?]

So that looks like a downstream issue rather than an upstream one.

Comment 9 Petr Pisar 2023-08-01 12:32:55 UTC
Do you say debuginfo? Then it's because the symbol is not exported anymore:

$ nm -D /usr/lib64/libperl.so.5.36 | grep Perl_pp_entersub
000000000011f0f0 T Perl_pp_entersub

That was an intentional change in the upstream <https://github.com/Perl/perl5/commit/0351a629e71de127cbfd1b142e9eaa6069deabf5> "hide private functions with __attribute__((visibility("hidden"))
)". Valgrind translates call addresses into function names based on a symbol table in an executable, and if not found, then from a symbol table in debuginfo data.


Note You need to log in before you can comment on or make changes to this bug.