Page MenuHomePhabricator

MediaWiki core tests fail with HHVM 3.6.1+dfsg1-1+wm2 : gmp_init(): Unable to convert variable to GMP - string is not an integer
Closed, ResolvedPublic

Description

I have upgraded HHVM on the CI slaves from 3.3.1+dfsg1-1+wm3.1 to 3.6.1+dfsg1-1+wm2 and mediawiki/core tests started to fail:

HHVM 3.6.1 is installed.

There were 7 errors:

1) WfBaseConvertTest::testDigitToBase2 with data set #0 ('0', '0', '0', '0', '0', '0', '0')
gmp_init(): Unable to convert variable to GMP - string is not an integer

includes/GlobalFunctions.php:3356
tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php:53
tests/phpunit/MediaWikiTestCase.php:131

2) WfBaseConvertTest::testDigitToBase3 with data set #0 ('0', '0', '0', '0', '0', '0', '0')
gmp_init(): Unable to convert variable to GMP - string is not an integer

includes/GlobalFunctions.php:3356
tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php:65
tests/phpunit/MediaWikiTestCase.php:131

3) WfBaseConvertTest::testDigitToBase5 with data set #0 ('0', '0', '0', '0', '0', '0', '0')
gmp_init(): Unable to convert variable to GMP - string is not an integer

includes/GlobalFunctions.php:3356
tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php:77
tests/phpunit/MediaWikiTestCase.php:131

4) WfBaseConvertTest::testDigitToBase8 with data set #0 ('0', '0', '0', '0', '0', '0', '0')
gmp_init(): Unable to convert variable to GMP - string is not an integer

includes/GlobalFunctions.php:3356
tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php:89
tests/phpunit/MediaWikiTestCase.php:131

5) WfBaseConvertTest::testDigitToBase10 with data set #0 ('0', '0', '0', '0', '0', '0', '0')
gmp_init(): Unable to convert variable to GMP - string is not an integer

includes/GlobalFunctions.php:3356
tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php:101
tests/phpunit/MediaWikiTestCase.php:131

6) WfBaseConvertTest::testDigitToBase16 with data set #0 ('0', '0', '0', '0', '0', '0', '0')
gmp_init(): Unable to convert variable to GMP - string is not an integer

includes/GlobalFunctions.php:3356
tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php:113
tests/phpunit/MediaWikiTestCase.php:131

7) WfBaseConvertTest::testDigitToBase36 with data set #0 ('0', '0', '0', '0', '0', '0', '0')
gmp_init(): Unable to convert variable to GMP - string is not an integer

includes/GlobalFunctions.php:3356
tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php:125
tests/phpunit/MediaWikiTestCase.php:131

--


There was 1 failure:

1) IPTCTest::testIPTCParseForcedUTFButInvalid
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => 'ø'
+    0 => ''
 )

So it seems we have regressions in both IPTC and GMP.

Related Objects

Event Timeline

hashar created this task.May 12 2015, 3:30 PM
hashar raised the priority of this task from to Unbreak Now!.
hashar updated the task description. (Show Details)
hashar added subscribers: Joe, hashar, matmarex and 2 others.

@Smalyshev would you have any time to look at HHVM's iconv implementation and see if backporting your PHP 5.5 patch (< https://github.com/php/php-src/commit/473ec539a1c3d242c8b171dd6a5a98fa17e05c13>) would be possible?

If we can get a working patch filed upstream @Joe can cherry-pick it to our internal HHVM builds even if it hasn't landed yet.

@bd808 I'll take a look though I'm not very familiar with hhvm and setting up build environment for it probably take some time. If we have anything in labs, etc. where I could test (i.e. source/build setup for hhvm) it would help.

bd808 added a comment.May 12 2015, 7:13 PM

@bd808 I'll take a look though I'm not very familiar with hhvm and setting up build environment for it probably take some time. If we have anything in labs, etc. where I could test (i.e. source/build setup for hhvm) it would help.

@Joe can you provide some help to get @Smalyshev bootstrapped into the fun world of HHVM's C++ build chain?

Joe added a comment.EditedMay 12 2015, 7:26 PM

Smalyshev I can surely help you get into the nightt^H^H^H^H^H WONDERFUL experience of building HHVM the debian way. But I advise you NOT to do that.

To build it from source, just follow instructions here:

https://github.com/facebook/hhvm/wiki/Building-and-installing-HHVM-on-Ubuntu-14.04

Please take care of making the fix backportable to the 3.6 branch :)

I think I know what's causing the gmp_init() failures and will upload a fix for that bug.

Change 210653 had a related patch set uploaded (by PleaseStand):
wfBaseConvert(): Avoid PHP warning when converting zero

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

Change 210653 merged by jenkins-bot:
wfBaseConvert(): Avoid PHP warning when converting zero

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

@bd808 I've made a patch for HHVM: https://github.com/smalyshev/hhvm/commit/33cb291c8de75d7f61a263c18dc27f6dac0c3475 for my tests, seems to fix it. I'll see how I can propose it for hhvm in general.

hashar renamed this task from MediaWiki core tests fail with HHVM 3.6.1+dfsg1-1+wm2 to MediaWiki core tests fail with HHVM 3.6.1+dfsg1-1+wm2 : gmp_init(): Unable to convert variable to GMP - string is not an integer.Jun 1 2015, 12:49 PM
hashar lowered the priority of this task from Unbreak Now! to High.
hashar set Security to None.
hashar added a subscriber: demon.

@bd808 it turns out hhvm has option hhvm.hack.lang.iconv_ignore_correct=true which despite its name seems to apply to PHP as well as Hack, and with this option the iconv bug does not seem to manifest.

Change 218269 had a related patch set uploaded (by BryanDavis):
Set hhvm.hack.lang.iconv_ignore_correct for //IGNORE behavior

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

Change 218271 had a related patch set uploaded (by BryanDavis):
Set hhvm.hack.lang.iconv_ignore_correct for //IGNORE behavior

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

Change 218271 merged by Ori.livneh:
Set hhvm.hack.lang.iconv_ignore_correct for //IGNORE behavior

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

Change 218269 merged by jenkins-bot:
Set hhvm.hack.lang.iconv_ignore_correct for //IGNORE behavior

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

hashar lowered the priority of this task from High to Normal.Jun 16 2015, 9:35 PM

Changing priority since we have the workaround of setting hhvm.hack.lang.iconv_ignore_correct = true.

As I understand it, this task is pending @Smalyshev proposed fix on https://reviews.facebook.net/D39231 . So I guess we should keep it open.

@hashar now that I found that setting I'm not even sure whether we need to patch hhvm. It works with this setting, so maybe the patch is not needed after all. For PHP, the patch is necessary, but for hhvm not sure.

@Smalyshev Joelm comment on https://reviews.facebook.net/D39231#637341 seems to indicate its an actual bug in HHVM. 'ignore' settings that have to be set manually always sounds evil to me :-D

@hashar you're right, settings like fix.bug = true are ugly, I'll finish the patch.

From an IRC conversation:

I have lowered the task priority yesterday since we have the workaround. It works for CI for the gmp_init() tests and should be suitable for production as well.

I think having the patch completed and upstreamed will save hassle for other peoples. I might be wrong though or underestimating the amount of work needed to finish it. Up to you guys :-)

Change 219516 had a related patch set uploaded (by Legoktm):
wfBaseConvert(): Avoid PHP warning when converting zero

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

Change 219516 merged by jenkins-bot:
wfBaseConvert(): Avoid PHP warning when converting zero

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

Krinkle closed this task as Resolved.Dec 15 2015, 11:58 PM
Krinkle claimed this task.
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:12 PM