Bug 2380086
| Summary: | perl-BSON-1.12.2-16.fc43 FTBFS: t/mapping/double.t fail with perl 5.42.0 | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Petr Pisar <ppisar> |
| Component: | perl-BSON | Assignee: | Petr Pisar <ppisar> |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | perl-devel, ppisar |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | https://koschei.fedoraproject.org//package/perl-BSON | ||
| Whiteboard: | |||
| Fixed In Version: | perl-BSON-1.12.2-17.fc43 | Doc Type: | --- |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2025-07-15 12:12:34 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 2339432 | ||
|
Description
Petr Pisar
2025-07-15 07:00:07 UTC
The warning is unrelated.
The failure appeared in 5.41.7 and this perldelta seems related:
When assigning from an SVt_IV into a SVt_NV (or vice versa),
providing that both are "bodyless" types, Perl_sv_setsv_flags will
now just change the destination type to match the source type.
Previously, an SVt_IV would have been upgraded to a SVt_PVNV to
store an NV, and an SVt_NV would have been upgraded to a SVt_PVIV to
store an IV. This change prevents the need to allocate - and later
free - the relevant body struct.
That probably corresponds to perl commit fbebf96ce083dc15b63c04d5695997d6e2657b03 ("Perl_sv_setsv_flags: handle mixed IV and NV fast case").
When minimizing the failing test too much:
my $hash = decode( encode( { A => unpack("d<",pack("H*","000000000000f0ff")) } ) );
is( ref(B::svref_2object( \$hash->{A} )), 'B::PVNV', "double->double" );
the type becomes NV not only on perl 5.42.0 but also on perl 5.40.2.
If one calls:
my $hash2 = decode( encode( { A => 3.14159 } ), wrap_numbers => 1);
before the test, the test returns PVPN on old perl.
I conclude the test or the BSON code builds on a side effect of the interpreter implementation which does not hold true anymore.
Normally I would adjust the test, but here BSON task is to reproduce Perl data structures and it does not reproduce them anymore.
I'm keen to remove perl-BSON and perl-Mongo from Rawhide. It's unmaintained since 2020 by upstream.
Actually BSON::decode(, wrap_numbers => 1) is documented to "ensure fields can round-trip if unmodified". So any decoding without wrap_numbers == 1 does not guarantee preserving the type. Maybe the change in the decoding is acceptable. Actually new perl behaves better: Input in the test is NV. Output in the new perl is also NV, while in the old perl it was PVNV. |