Page MenuHomePhabricator

Uninitialized string offset warnings with HHVM 3.18 in LanguageAz.php and LanguageKk.php
Closed, ResolvedPublic

Description

Currently we're running HHVM 3.12 in production, but we're in the process of deploying 3.18 (currently deployed in deployment-prep, mwdebug* and mw1261.

I had a look at HHVM errors logged and with 3.18 these errors are logged for Kazakh and Azerbaijani (the errors are no found in other servers, so this seems caused by changes in HHVM 3.18):

Mar 22 10:18:53 mw1261 hhvm: #012Notice: Uninitialized string offset: 0 in /srv/mediawiki/php-1.29.0-wmf.16/languages/classes/LanguageKk.php on line 394
Mar 22 10:18:53 mw1261 hhvm[19736]: [Wed Mar 22 10:18:53 2017] [hphp] [19736:7f6fb8bff700:1501:000002] [] \nNotice: Uninitialized string offset: 0 in /srv/mediawiki/php-\1.29.0-wmf.16/languages/classes/LanguageKk.php on line 394
Mar 22 10:20:11 mw1261 hhvm: #012Notice: Uninitialized string offset: 0 in /srv/mediawiki/php-1.29.0-wmf.16/languages/classes/LanguageAz.php on line 36
Mar 22 10:20:11 mw1261 hhvm[19736]: [Wed Mar 22 10:20:11 2017] [hphp] [19736:7f6f77fff700:1583:000001] [] \nNotice: Uninitialized string offset: 0 in /srv/mediawiki/php-\1.29.0-wmf.16/languages/classes/LanguageAz.php on line 36
Mar 22 10:20:11 mw1261 hhvm: #012Notice: Uninitialized string offset: 0 in /srv/mediawiki/php-1.29.0-wmf.16/languages/classes/LanguageAz.php on line 36
Mar 22 10:20:11 mw1261 hhvm[19736]: [Wed Mar 22 10:20:11 2017] [hphp] [19736:7f6f77fff700:1583:000002] [] \nNotice: Uninitialized string offset: 0 in /srv/mediawiki/php-\1.29.0-wmf.16/languages/classes/LanguageAz.php on line 36
Mar 22 10:20:11 mw1261 hhvm: #012Notice: Uninitialized string offset: 0 in /srv/mediawiki/php-1.29.0-wmf.16/languages/classes/LanguageAz.php on line 36
Mar 22 10:20:11 mw1261 hhvm[19736]: [Wed Mar 22 10:20:11 2017] [hphp] [19736:7f6f77fff700:1583:000003] [] \nNotice: Uninitialized string offset: 0 in /srv/mediawiki/php-\1.29.0-wmf.16/languages/classes/LanguageAz.php on line 36
Mar 22 10:20:11 mw1261 hhvm: #012Notice: Uninitialized string offset: 0 in /srv/mediawiki/php-1.29.0-wmf.16/languages/classes/LanguageAz.php on line 36
Mar 22 10:20:11 mw1261 hhvm[19736]: [Wed Mar 22 10:20:11 2017] [hphp] [19736:7f6f77fff700:1583:000004] [] \nNotice: Uninitialized string offset: 0 in /srv/mediawiki/php-\1.29.0-wmf.16/languages/classes/LanguageAz.php on line 36
Mar 22 10:20:11 mw1261 hhvm: #012Notice: Uninitialized string offset: 0 in /srv/mediawiki/php-1.29.0-wmf.16/languages/classes/LanguageAz.php on line 36
Mar 22 10:20:11 mw1261 hhvm[19736]: [Wed Mar 22 10:20:11 2017] [hphp] [19736:7f6f77fff700:1583:000005] [] \nNotice: Uninitialized string offset: 0 in /srv/mediawiki/php-\1.29.0-wmf.16/languages/classes/LanguageAz.php on line 36
Mar 22 10:20:11 mw1261 hhvm: #012Notice: Uninitialized string offset: 0 in /srv/mediawiki/php-1.29.0-wmf.16/languages/classes/LanguageAz.php on line 36

I've depooled mw1261 for now since I'm not fully sure whether that causes disruption for Kazakh and Azerbaijani Wikipedia. If these are just logspam, let me know and I can repool mw1261.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 22 2017, 10:35 AM

Change 344120 had a related patch set uploaded (by Aklapper):
[mediawiki/core] Check for string initialization in ucfirst() to make HHVM 3.18 happy

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

Change 344120 merged by jenkins-bot:
[mediawiki/core] Check for string initialization in ucfirst() to make HHVM 3.18 happy

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

Nikerabbit added a subscriber: Nikerabbit.

I'm leaving this open in case someone is expected to do backports.

Change 344141 had a related patch set uploaded (by Hashar; owner: Aklapper):
[mediawiki/core] Check for string initialization in ucfirst() to make HHVM 3.18 happy

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

Change 344142 had a related patch set uploaded (by Hashar; owner: Aklapper):
[mediawiki/core] Check for string initialization in ucfirst() to make HHVM 3.18 happy

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

hashar added a subscriber: hashar.

I am handling the backports to wmf.16 / wmf.17

Change 344141 merged by jenkins-bot:
[mediawiki/core] Check for string initialization in ucfirst() to make HHVM 3.18 happy

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

Change 344142 merged by jenkins-bot:
[mediawiki/core] Check for string initialization in ucfirst() to make HHVM 3.18 happy

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

Mentioned in SAL (#wikimedia-operations) [2017-03-22T15:33:45Z] <hashar@tin> Synchronized php-1.29.0-wmf.17/languages/classes/LanguageAz.php: Check for string initialization in ucfirst() to make HHVM 3.18 happy - T161095 (duration: 00m 59s)

Mentioned in SAL (#wikimedia-operations) [2017-03-22T15:34:47Z] <hashar@tin> Synchronized php-1.29.0-wmf.17/languages/classes/LanguageKk.php: Check for string initialization in ucfirst() to make HHVM 3.18 happy - T161095 (duration: 00m 54s)

Mentioned in SAL (#wikimedia-operations) [2017-03-22T15:36:29Z] <hashar> Deploying LanguageAz.php and LanguageKk.php hotfix for HHVM 3.18 on mwdebug* and mw1261 - T161095

Mentioned in SAL (#wikimedia-operations) [2017-03-22T15:40:34Z] <hashar@tin> Synchronized php-1.29.0-wmf.16/languages/classes/LanguageAz.php: Check for string initialization in ucfirst() to make HHVM 3.18 happy - T161095 (duration: 00m 48s)

Mentioned in SAL (#wikimedia-operations) [2017-03-22T15:41:32Z] <hashar@tin> Synchronized php-1.29.0-wmf.16/languages/classes/LanguageKk.php: Check for string initialization in ucfirst() to make HHVM 3.18 happy - T161095 (duration: 00m 44s)

I have deployed the hotfix on both wmf versions. There is most probably some useless call to ucfirst('') somewhere in the code.

As for the sudden notices, I would guess that HHVM 3.12 was shallowing the notice. Zend throw the notice when the variable passed is an empty string as does HHVM 3.18.

https://3v4l.org/stcgS

<?php
// https://phabricator.wikimedia.org/T161095

$string = '';
$string[0];

Output for 5.6.15 - 5.6.30, hhvm-3.15.4 - 3.18.1, 7.0.0 - 7.1.3:

Notice: Uninitialized string offset: 0 in /in/stcgS on line 5

Output for hhvm-3.12.14

So yeah hhvm got aligned to match Zend behavior.

I am leaving the task open in case one want to investigate why we have ucfirst('') called.

hashar moved this task from Backlog to New features on the HHVM board.Mar 22 2017, 3:47 PM

Mentioned in SAL (#wikimedia-operations) [2017-03-23T08:47:46Z] <moritzm> repooled mw1261 now that T161095 is deployed

The ucfirst error is fixed, but when reviewing the error logs of mw1261 I noticed a very similar error also applying to Kazakh, it's essentially the same error, but for lcfirst() instead of ucfirst():

Mar 23 13:30:44 mw1261 hhvm: #012Notice: Uninitialized string offset: 0 in /srv/mediawiki/php-1.29.0-wmf.16/languages/classes/LanguageKk.php on line 411
Mar 23 13:30:44 mw1261 hhvm[19736]: [Thu Mar 23 13:30:44 2017] [hphp] [19736:7f6f81fff700:51142:000001] [] \nNotice: Uninitialized string offset: 0 in /srv/mediawiki/php-1.29.0-wmf.16/languages/classes/LanguageKk.php on line 411

Change 344617 had a related patch set uploaded (by Hashar):
[mediawiki/core@master] Check for string initialization in lcfirst() for HHVM 3.18

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

Change 344618 had a related patch set uploaded (by Hashar):
[mediawiki/core@wmf/1.29.0-wmf.17] Check for string initialization in lcfirst() for HHVM 3.18

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

Change 344617 merged by jenkins-bot:
[mediawiki/core@master] Check for string initialization in lcfirst() for HHVM 3.18

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

Change 344618 merged by jenkins-bot:
[mediawiki/core@wmf/1.29.0-wmf.17] Check for string initialization in lcfirst() for HHVM 3.18

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

Mentioned in SAL (#wikimedia-operations) [2017-03-27T08:38:16Z] <hashar@tin> Synchronized php-1.29.0-wmf.17/languages/classes/LanguageKk.php: Check for string initialization in lcfirst() for HHVM 3.18 - T161095 (duration: 00m 52s)

LanguageKk:lcfirst() should be fine on mw1261 now.

Change 344922 had a related patch set uploaded (by DCausse):
[operations/mediawiki-config@master] [cirrus] enable more accurate regex timeout

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

Mentioned in SAL (#wikimedia-operations) [2017-03-27T13:22:07Z] <moritzm> repooled mw1261 (now that fix for lcfirst() issue from T161095 is deployed)

Change 344922 merged by jenkins-bot:
[operations/mediawiki-config@master] [cirrus] enable more accurate regex timeout

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

Mentioned in SAL (#wikimedia-operations) [2017-03-27T13:26:44Z] <dereckson@tin> Synchronized wmf-config/CirrusSearch-common.php: [cirrus] enable more accurate regex timeout (T161095) (duration: 00m 44s)

Krinkle closed this task as Resolved.Apr 10 2017, 11:36 PM
Krinkle claimed this task.
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:10 PM