Page MenuHomePhabricator

base-convert no longer works under PHP 7.2 because dividend and divisor are no longer truncated to integer when bcmath is installed and gmp is not
Closed, ResolvedPublic

Description

Hello,

After upgrading my Ubuntu server to Bionic (18.04) my wiki no longer work (version 1.30.0) .
I was in php 7.1 and now it is 7.2.

It is configured as private wiki with an authentication, i can (sometimes) display the login page but after i got the following php messages in loop:

[07-May-2018 16:36:20 Europe/Paris] PHP Notice: Undefined index: 15.0000000 in /var/www/wiki.astrololo.fr/vendor/wikimedia/base-convert/src/Functions.php on line 87
[07-May-2018 16:36:20 Europe/Paris] PHP Notice: Undefined index: 3.0000000 in /var/www/wiki.astrololo.fr/vendor/wikimedia/base-convert/src/Functions.php on line 87
[07-May-2018 16:36:20 Europe/Paris] PHP Notice: Undefined index: 25.0000000 in /var/www/wiki.astrololo.fr/vendor/wikimedia/base-convert/src/Functions.php on line 87
[07-May-2018 16:36:20 Europe/Paris] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/wiki.astrololo.fr/vendor/wikimedia/base-convert/src/Functions.php on line 86

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 7 2018, 3:04 PM

bcmod documentation has following note:

dividend and divisor are no longer truncated to integer, so now the behavior of bcmod() follows fmod() rather than the % operator.

Base-convert does not have a Phabricator tag and was missing from https://www.mediawiki.org/wiki/Upstream_projects#Invented_here

Special:Version lists @brion and @Parent5446 as authors.

Aklapper renamed this task from mediawiki no longer work after upgrade Ubuntu Bionic to base-convert no longer works under PHP 7.2 because dividend and divisor are no longer truncated to integer.May 7 2018, 3:33 PM
Legoktm added a subscriber: aaron.May 7 2018, 11:10 PM

installing package php-gmp resolve the problem

I can't reproduce the problem.

Vvjjkkii renamed this task from base-convert no longer works under PHP 7.2 because dividend and divisor are no longer truncated to integer to zgdaaaaaaa.Jul 1 2018, 1:11 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from zgdaaaaaaa to base-convert no longer works under PHP 7.2 because dividend and divisor are no longer truncated to integer.Jul 2 2018, 4:21 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.
Legoktm renamed this task from base-convert no longer works under PHP 7.2 because dividend and divisor are no longer truncated to integer to base-convert no longer works under PHP 7.2 because dividend and divisor are no longer truncated to integer when bcmath is installed and gmp is not.Oct 4 2018, 3:04 PM
Legoktm removed a project: TestMe.
BPirkle claimed this task.Oct 15 2018, 10:19 PM

Was able to reproduce by setting up a PHP 7.2 environment, then calling bcscale with a non-zero number of decimal places before calling base_convert.

I'm not quite sure how this might have happened in the original reporter's environment, but I'll fix it up to prevent the errors should it occur.

Change 467768 had a related patch set uploaded (by BPirkle; owner: BPirkle):
[base-convert@master] PHP 7.2 compatibility

https://gerrit.wikimedia.org/r/467768

Change 467768 merged by jenkins-bot:
[base-convert@master] Fix PHP 7.2 compatibility

https://gerrit.wikimedia.org/r/467768

Krinkle added a subscriber: Krinkle.

Next step: Release new version of base-convert and update mediawiki/core + mediawiki/vendor.

Change 469046 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/vendor@master] Update wikimedia/base-convert to 2.0.0

https://gerrit.wikimedia.org/r/469046

Change 469047 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/core@master] Update wikimedia/base-convert to 2.0.0

https://gerrit.wikimedia.org/r/469047

Change 469046 merged by jenkins-bot:
[mediawiki/vendor@master] Update wikimedia/base-convert to 2.0.0

https://gerrit.wikimedia.org/r/469046

Change 469047 merged by jenkins-bot:
[mediawiki/core@master] Update wikimedia/base-convert to 2.0.0

https://gerrit.wikimedia.org/r/469047

Change 469067 had a related patch set uploaded (by Jforrester; owner: Legoktm):
[mediawiki/core@REL1_32] Update wikimedia/base-convert to 2.0.0

https://gerrit.wikimedia.org/r/469067

Change 469075 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/vendor@REL1_32] Update wikimedia/base-convert to 2.0.0

https://gerrit.wikimedia.org/r/469075

Change 469077 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/vendor@REL1_31] Update wikimedia/base-convert to 2.0.0

https://gerrit.wikimedia.org/r/469077

Change 469091 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/core@REL1_31] Update wikimedia/base-convert to 2.0.0

https://gerrit.wikimedia.org/r/469091

Change 469075 merged by jenkins-bot:
[mediawiki/vendor@REL1_32] Update wikimedia/base-convert to 2.0.0

https://gerrit.wikimedia.org/r/469075

Change 469077 merged by jenkins-bot:
[mediawiki/vendor@REL1_31] Update wikimedia/base-convert to 2.0.0

https://gerrit.wikimedia.org/r/469077

Change 469067 merged by jenkins-bot:
[mediawiki/core@REL1_32] Update wikimedia/base-convert to 2.0.0

https://gerrit.wikimedia.org/r/469067

Change 469091 merged by jenkins-bot:
[mediawiki/core@REL1_31] Update wikimedia/base-convert to 2.0.0

https://gerrit.wikimedia.org/r/469091

Legoktm closed this task as Resolved.Oct 22 2018, 10:07 PM

OK, I think everything is backported now.