Project

General

Profile

Actions

action #90371

closed

Warnings "Subroutine JSON::PP::Boolean::(0+ redefined"

Added by tinita about 3 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Regressions/Crashes
Target version:
Start date:
2021-03-19
Due date:
% Done:

0%

Estimated time:

Description

Currently the openQA fullstack tests show these warnings:

Subroutine JSON::PP::Boolean::(0+ redefined at /usr/lib/perl5/5.26.1/overload.pm line 48.
Subroutine JSON::PP::Boolean::(++ redefined at /usr/lib/perl5/5.26.1/overload.pm line 48.
Subroutine JSON::PP::Boolean::(++ redefined at /usr/lib/perl5/5.26.1/overload.pm line 48.
Subroutine JSON::PP::Boolean::(0+ redefined at /usr/lib/perl5/5.26.1/overload.pm line 48.
Subroutine JSON::PP::Boolean::(-- redefined at /usr/lib/perl5/5.26.1/overload.pm line 48.

https://app.circleci.com/pipelines/github/os-autoinst/openQA/5998/workflows/94c76040-f055-4899-8372-bd5d3f416a50/jobs/56590
https://app.circleci.com/pipelines/github/os-autoinst/openQA/5998/workflows/94c76040-f055-4899-8372-bd5d3f416a50/jobs/56591

The reason seems to be that Cpanel::JSON::XS creates the JSON::PP::Boolean namespace and overloads without using the module. Then when JSON::PP is used, perl sees that the overloads have already been defined.
https://github.com/rurban/Cpanel-JSON-XS/issues/65

perl -wE 'use Cpanel::JSON::XS (); use JSON::PP ()'
Subroutine JSON::PP::Boolean::(++ redefined at /usr/lib/perl5/5.26.1/overload.pm line 48.
Subroutine JSON::PP::Boolean::(0+ redefined at /usr/lib/perl5/5.26.1/overload.pm line 48.
Subroutine JSON::PP::Boolean::(-- redefined at /usr/lib/perl5/5.26.1/overload.pm line 48.

The reason in our case seems to be the following:

  • It only happens with Devel::Cover
  • Devel::Cover uses JSON::MaybeXS (which then uses Cpanel::JSON::XS)
  • Some other code in our code base or in CPAN modules used by us is using JSON::PP

Related issues 3 (0 open3 closed)

Related to openQA Project - action #72082: Reduce test runtime, e.g. less reliance on test fixtures or test database instancesResolvedokurz2020-09-18

Actions
Related to openQA Tests - action #38264: os-autoinst-distri-opensuse self-tests fail in travis CI with "Subroutine JSON::PP::Boolean::(0+ redefined" but not locallyResolvedokurz2018-07-06

Actions
Related to openQA Project - action #29048: perl warning about "Subroutine JSON::PP::Boolean::(0+ redefined" on manual startup of openqa-schedulerResolvedkraih2017-12-07

Actions
Actions

Also available in: Atom PDF