Page MenuHomePhabricator

RedisBagOStuff does not handle negative integers correctly
Closed, DuplicatePublic

Description

RedisBagOStuff deliberately does not serialize integers, so Redis INCR/DECR work. So when unserializing, it checks for int-like strings and just casts them. However, it wasn't recognizing negative integer strings.


Maybe a regression from rMWVA1bdfff151a33: Use Redis for main stash by default (and regardless).

( ! ) Notice: unserialize(): Error at offset 0 of 2 bytes in /vagrant/mediawiki/includes/objectcache/RedisBagOStuff.php on line 313
Call Stack
#	Time	Memory	Function	Location
1	0.0001	235992	{main}( )	../index.php:0
2	0.0065	251088	require( '/vagrant/mediawiki/index.php' )	../index.php:5
3	0.2169	6656352	MediaWiki->run( )	../index.php:43
4	0.2170	6657552	MediaWiki->main( )	../MediaWiki.php:519
5	6.5524	15884056	OutputPage->output( )	../MediaWiki.php:753
6	6.5577	15953656	SkinTemplate->outputPage( )	../OutputPage.php:2319
7	6.5617	15959072	SkinTemplate->prepareQuickTemplate( )	../SkinTemplate.php:246
8	6.7082	17070976	SkinTemplate->buildPersonalUrls( )	../SkinTemplate.php:472
9	6.7159	17080192	Hooks::run( )	../SkinTemplate.php:712
10	6.7160	17081128	call_user_func_array ( )	../Hooks.php:195
11	6.7160	17082800	EchoHooks::onPersonalUrls( )	../Hooks.php:195
12	6.7209	17113832	MWEchoNotifUser->getMessageCount( )	../Hooks.php:811
13	6.7209	17114296	MWEchoNotifUser->getNotificationCount( )	../NotifUser.php:170
14	6.7216	17124040	MWEchoNotifUser->getFromCache( )	../NotifUser.php:209
15	6.7266	17141184	RedisBagOStuff->getMulti( )	../NotifUser.php:558
16	6.7289	17147696	RedisBagOStuff->unserialize( )	../RedisBagOStuff.php:171
17	6.7289	17147744	unserialize ( )	../RedisBagOStuff.php:313

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptMay 12 2016, 8:25 PM
Mattflaschen-WMF renamed this task from Redis notices locally on MediaWiki-Vagrant to RedisBagOStuff does not handle negative integers correctly.May 12 2016, 9:38 PM
Mattflaschen-WMF claimed this task.
Mattflaschen-WMF updated the task description. (Show Details)
Mattflaschen-WMF updated the task description. (Show Details)
Mattflaschen-WMF added a subscriber: Krinkle.

Change 288522 had a related patch set uploaded (by Mattflaschen):
RedisBagOStuff: Correctly deserialize base 10 rep. of negative integers

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