Page MenuHomePhabricator

block expiry too long cause mediawiki crash
Open, Needs TriagePublic

Description

I block user 127.0.0.1 with expiry 9999/12/31 23:59:59 on zh Beta Cluster, then I got Internal error.

https://zh.wikipedia.beta.wmflabs.org/w/index.php?title=Special:Log/block&page=User%3A127.0.0.1&uselang=en

[Wqhh7gpEE4AAAGOhsOUAAAAQ] /w/index.php?title=Special:%E6%97%A5%E5%BF%97/block&page=User%3A127.0.0.1&uselang=en MWException from line 1136 of /srv/mediawiki/php-master/languages/Language.php: Language::sprintfDate: The timestamp 100000101075959 should have 14 characters

Backtrace:

#0 /srv/mediawiki/php-master/languages/Language.php(2393): Language->sprintfDate(string, string)
#1 /srv/mediawiki/php-master/languages/Language.php(2462): Language->internalUserTimeAndDate(string, string, User, array)
#2 /srv/mediawiki/php-master/languages/Language.php(4114): Language->userTimeAndDate(integer, User)
#3 /srv/mediawiki/php-master/includes/logging/BlockLogFormatter.php(66): Language->translateBlockExpiry(string, User, string)
#4 /srv/mediawiki/php-master/includes/logging/LogFormatter.php(461): BlockLogFormatter->getMessageParameters()
#5 /srv/mediawiki/php-master/includes/logging/LogFormatter.php(436): LogFormatter->getActionMessage()
#6 /srv/mediawiki/php-master/includes/logging/LogEventsList.php(389): LogFormatter->getActionText()
#7 /srv/mediawiki/php-master/includes/logging/LogPager.php(365): LogEventsList->logLine(stdClass)
#8 /srv/mediawiki/php-master/includes/pager/IndexPager.php(445): LogPager->formatRow(stdClass)
#9 /srv/mediawiki/php-master/includes/specials/SpecialLog.php(232): IndexPager->getBody()
#10 /srv/mediawiki/php-master/includes/specials/SpecialLog.php(134): SpecialLog->show(FormOptions, array)
#11 /srv/mediawiki/php-master/includes/specialpage/SpecialPage.php(522): SpecialLog->execute(string)
#12 /srv/mediawiki/php-master/includes/specialpage/SpecialPageFactory.php(579): SpecialPage->run(string)
#13 /srv/mediawiki/php-master/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
#14 /srv/mediawiki/php-master/includes/MediaWiki.php(861): MediaWiki->performRequest()
#15 /srv/mediawiki/php-master/includes/MediaWiki.php(524): MediaWiki->main()
#16 /srv/mediawiki/php-master/index.php(42): MediaWiki->run()
#17 /srv/mediawiki/w/index.php(3): include(string)
#18 {main}

Event Timeline

Xiplus created this task.Mar 13 2018, 11:43 PM
Restricted Application added subscribers: Cosine02, Aklapper. · View Herald TranscriptMar 13 2018, 11:43 PM
Amitie_10g added a subscriber: Amitie_10g.EditedMay 31 2018, 12:51 PM

As I know, the limit for the current UNIX Timestamp implementation is ca. 2038 (as the Timestamp value is a 14 digit, signed 32-bit Integer), and this issue is related to PHP/HHVM and MySQL/MariaDB rather than MediaWiki.

Changing the data type in the software (for new installations), should be trivial, but changing it in a live wiki (specially huge protects like Wikipedia and Commons) may be dangerous, not just in resource consuming, but also in attributions.

See this for more info:
https://en.m.wikipedia.org/wiki/Year_2038_problem

It belongs to user blocking.

I think the block expiration time should be limited to 2018/1/19 03:14:07 at least.

Mmm, then, anything where the DB field is Timestamp in the MediaWiki function may be hardcoded to reject any value greater than 2147483647 (January 19, 3038), and send the proper message to the browser, until the Y2K38 problem is fixed in both HHVM and MariaDB.