Athanasius has asked for the wisdom of the Perl Monks concerning the following question:
I’m trying to install MongoDB for Strawberry Perl 5.26.0:
This is perl 5, version 26, subversion 0 (v5.26.0) built for MSWin32-x +64-multi-thread-ld
under Windows 8.1 64-bit. One of MongoDB’s dependencies is BSON. which not only fails to install but actually crashes the Perl interpreter while doing so.
After some debugging I eventually reduced the problem code to the following SSCCE:
use strict; use warnings; use JSON::MaybeXS; my $json_codec = JSON::MaybeXS->new; print ref $json_codec, "\n"; print $json_codec->encode( { d => 1.0 } ), "\n";
Note that I have the following modules installed:
16:27 >mversion -f JSON::MaybeXS Cpanel::JSON::XS JSON::XS JSON::PP JSON::MaybeXS 1.003009 Cpanel::JSON::XS 3.0233 JSON::XS 3.04 JSON::PP 2.94 16:27 >
Now to the point: when I run the SSCCE, I get the following output:
19:26 >perl 1800_SoPW.pl Cpanel::JSON::XS
and the Perl interpreter crashes. But if I change the JSON module:
19:26 >perl -MJSON::XS 1800_SoPW.pl JSON::XS {"d":1} 19:27 >
the code completes successfully. I have also tested the SSCCE on Strawberry Perl 5.24.1, and it runs without a problem:
16:37 >perl 1800_SoPW.pl Cpanel::JSON::XS {"d":1.0} 16:38 >
So, I have two sets of questions:
(1) Can other monks confirm this behaviour under Perl 5.26.0? If so, is it confined to Windows or does it occur on other platforms as well? And does anyone know of a change from 5.24 to 5.26 which could account for this? Should I report it as a bug under Cpanel::JSON::XS?
(2) Until the bug is fixed, what’s the best way to prevent JSON::MaybeXS from defaulting to Cpanel::JSON::XS? I can add -MJSON::XS to the command line when invoking a Perl script directly, but how can I get cpanm to do this? Or will I need to uninstall Cpanel::JSON::XS from my system?
Thanks,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Cpanel::JSON::XS crash under Perl 5.26.0
by kevbot (Vicar) on Aug 19, 2017 at 07:30 UTC | |
|
Re: Cpanel::JSON::XS crash under Perl 5.26.0
by Anonymous Monk on Aug 19, 2017 at 08:07 UTC | |
by Athanasius (Archbishop) on Aug 19, 2017 at 08:24 UTC | |
by Anonymous Monk on Aug 19, 2017 at 08:33 UTC | |
by Athanasius (Archbishop) on Aug 19, 2017 at 08:53 UTC | |
by Anonymous Monk on Aug 20, 2017 at 09:20 UTC |