Last modified: 2014-03-01 00:00:34 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T64078, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62078 - Infinite loop in MobileContext->toggleView('mobile')
Infinite loop in MobileContext->toggleView('mobile')
Status: RESOLVED FIXED
Product: MobileFrontend
Classification: Unclassified
stable (Other open bugs)
unspecified
All All
: Immediate blocker
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-28 22:05 UTC by Bryan Davis
Modified: 2014-03-01 00:00 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bryan Davis 2014-02-28 22:05:21 UTC
39,289 line stacktrace recorded in fatal.log on fluorine of the form ABCDEF(GHIJ)+. Frames 6-9 are repeated until PHP runs out of memory.


[28-Feb-2014 09:40:48] Fatal error: Allowed memory size of 230686720 bytes exhau
sted (tried to allocate 523800 bytes) at /usr/local/apache/common-local/php-1.23
wmf16/includes/profiler/ProfilerSimple.php on line 38
Server: mw1186
Method: GET
URL: http://test2.wikipedia.org/w/index.php?title=Template:Orphan&action=edit&mo
bileaction=toggle_view_mobile
Cookie:
Backtrace:
#0 /usr/local/apache/common-local/php-1.23wmf16/includes/profiler/Profiler.php(3
8): ProfilerSimple->profileIn('hook: GetLocalU...')
#1 /usr/local/apache/common-local/php-1.23wmf16/includes/Hooks.php(137): wfProfi
leIn('hook: GetLocalU...')
#2 /usr/local/apache/common-local/php-1.23wmf16/includes/GlobalFunctions.php(400
8): Hooks::run('GetLocalURL::Ar...', Array, NULL)
#3 /usr/local/apache/common-local/php-1.23wmf16/includes/Title.php(1568): wfRunH
ooks('GetLocalURL::Ar...', Array)
#4 /usr/local/apache/common-local/php-1.23wmf16/includes/Title.php(1514): Title-
>getLocalURL('')
#5 /usr/local/apache/common-local/php-1.23wmf16/extensions/MobileFrontend/includes/MobileContext.php(800): Title->getFullURL()
#6 /usr/local/apache/common-local/php-1.23wmf16/extensions/MobileFrontend/includes/MobileContext.php(849): MobileContext->toggleView('mobile')
#7 /usr/local/apache/common-local/php-1.23wmf16/extensions/MobileFrontend/includes/MobileContext.php(278): MobileContext->checkToggleView()
#8 /usr/local/apache/common-local/php-1.23wmf16/extensions/MobileFrontend/includes/MobileContext.php(615): MobileContext->shouldDisplayMobileView()
#9 /usr/local/apache/common-local/php-1.23wmf16/extensions/MobileFrontend/includes/MobileContext.php(817): MobileContext->getMobileUrl('//test2.wikiped...')
#10 /usr/local/apache/common-local/php-1.23wmf16/extensions/MobileFrontend/includes/MobileContext.php(849): MobileContext->toggleView('mobile')
#11 /usr/local/apache/common-local/php-1.23wmf16/extensions/MobileFrontend/includes/MobileContext.php(278): MobileContext->checkToggleView()
#12 /usr/local/apache/common-local/php-1.23wmf16/extensions/MobileFrontend/includes/MobileContext.php(615): MobileContext->shouldDisplayMobileView()
#13 /usr/local/apache/common-local/php-1.23wmf16/extensions/MobileFrontend/includes/MobileContext.php(817): MobileContext->getMobileUrl('//test2.wikiped...')
[...snip...]
#39289 /usr/local/apache/common-local/php-1.23wmf16/extensions/MobileFrontend/in
cludes/MobileContext.php(817): MobileContext->getMobileUrl('//test2.wikiped...')
Comment 1 Bingle 2014-02-28 22:08:45 UTC
Prioritization and scheduling of this bug is tracked on Mingle card https://wikimedia.mingle.thoughtworks.com/projects/mobile/cards/1740
Comment 2 Arthur Richards 2014-02-28 22:30:01 UTC
Huh - http://test2.wikipedia.org/w/index.php?title=Template:Orphan&action=edit&mo
bileaction=toggle_view_mobile is not a URL that should ever get exposed, and from poking around I can't figure out where this would have come from. URLs with 'mobileaction=toggle_view_mobile' should only ever appear on wikis that do not have a mobile-specific subdomain configured. I wonder if someone created this manually. Regardless, the infinite loop should not be happening and I suspect it's happening because MobileFrontend does not expect to see mobileaction=toggle_view_mobile on a wiki with a mobile-specific subdomain. I am digging into it now.
Comment 3 Arthur Richards 2014-02-28 22:36:41 UTC
I am not seeing the behavior on wikipedias. I believe this was introduced by https://gerrit.wikimedia.org/r/#/c/114392/1

The scope of this problem theoretically ought to be small, since URLs that trigger  this behavior are not being exposed anywhere (at least that I could find). Bryan, do you have any way of confirming that the scope here is relatively small?
Comment 4 Bryan Davis 2014-02-28 22:43:16 UTC
It does not seem to be widespread yet, but the 1.23wmf16 branch is only on the group 0 wikis at the moment.

fluorine:~
bd808$ fgrep toggle_view_mobile /a/mw-log/*.log
/a/mw-log/api.log:2014-02-28 17:08:28 mw1120 enwiki: API POST 10.64.32.73 10.64.32.73 T=52ms format=json action=parse text=%3Csyntaxhighlight%20lang%3D%22javascript%22%3E%0A$(%27a%5Bhref$%3D%22toggle_view_mobile%22%5D%27).click(function()%7B%0A%20%20%20%20%20%20%20document.cookie%20%3D%20%27stopMobileRedirect%3Dfalse;%20domain%3D.wikipedia.org;%27%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2B%20%27path%3D/;%20expires%3DThu,%2001-Jan-1970%2000:00:00%20GMT;%27;%0A%7D);%0A%3C/syntaxhigh[...] disablepp=true
/a/mw-log/api.log:2014-02-28 17:08:28 mw1129 enwiki: API POST 10.64.32.73 10.64.32.73 T=79ms format=json action=parse text=%3Csyntaxhighlight%20lang%3D%22javascript%22%3E%0A$(%27a%5Bhref$%3D%22toggle_view_mobile%22%5D%27).click(function()%7B%0A%20%20%20%20%20%20%20$.cookie(%27stopMobileRedirect%27,%27false%27,%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20domain:%20%27.wikipedia.org%27,%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20path:%20%27/%27,%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20expires:%20%27Thu,%2001-Jan-1970%2000:[...] disablepp=true
/a/mw-log/fatal.log:URL: http://test2.wikipedia.org/w/index.php?title=Template:Orphan&action=edit&mobileaction=toggle_view_mobile
/a/mw-log/fatal.log:URL: http://test2.wikipedia.org/w/index.php?title=Bahrain&action=edit&mobileaction=toggle_view_mobile
/a/mw-log/fatal.log:URL: http://test2.wikipedia.org/w/index.php?title=Kyrgyzstan&action=edit&mobileaction=toggle_view_mobile
/a/mw-log/fatal.log:URL: http://test2.wikipedia.org/w/index.php?title=Talk:Nepal&action=edit&redlink=1&mobileaction=toggle_view_mobile
/a/mw-log/fatal.log:URL: http://test2.wikipedia.org/w/index.php?title=Rule&action=edit&redlink=1&mobileaction=toggle_view_mobile
/a/mw-log/fatal.log:URL: http://test2.wikipedia.org/w/index.php?title=Bluebook&action=edit&redlink=1&mobileaction=toggle_view_mobile
/a/mw-log/fatal.log:URL: http://test2.wikipedia.org/w/index.php?title=User:RobLa-WMF&mobileaction=toggle_view_mobile
/a/mw-log/fatal.log:URL: http://test2.wikipedia.org/w/index.php?title=Justice&action=edit&redlink=1&mobileaction=toggle_view_mobile
/a/mw-log/fatal.log:URL: http://test2.wikipedia.org/w/index.php?title=Template:Orphan&action=edit&mobileaction=toggle_view_mobile
/a/mw-log/fatal.log:URL: http://www.mediawiki.org/w/index.php?title=Template:Orphan&action=edit&mobileaction=toggle_view_mobile
/a/mw-log/test2wiki.log:Start request GET /w/index.php?title=Special:UserLogin&type=signup&returnto=Chris+Montez&returntoquery=action%3Dedit%26redlink%3D1%26mobileaction%3Dtoggle_view_mobile
/a/mw-log/test2wiki.log:20140228084840  0.123   /w/index.php?title=Special:UserLogin&type=signup&returnto=Chris Montez&returntoquery=action=edit&redlink=1&mobileaction=toggle_view_mobile      (proxied via 10.64.0.102 forwarded for 137.110.244.134, 10.128.0.116, 10.128.0.109) anon
/a/mw-log/test2wiki.log:Start request GET /w/index.php?title=Template:Orphan&action=edit&mobileaction=toggle_view_mobile
/a/mw-log/test2wiki.log:Start request GET /w/index.php?title=Special:UserLogin&returnto=Maggie+May+%28traditional+song%29&returntoquery=action%3Dedit%26mobileaction%3Dtoggle_view_mobile&type=signup
/a/mw-log/test2wiki.log:20140228110135  0.154   /w/index.php?title=Special:UserLogin&returnto=Maggie May (traditional song)&returntoquery=action=edit&mobileaction=toggle_view_mobile&type=signup       (proxied via 10.64.32.107 forwarded for 137.110.244.139, 10.128.0.110, 10.128.0.108) anon
/a/mw-log/test2wiki.log:Start request GET /w/index.php?title=Bahrain&action=edit&mobileaction=toggle_view_mobile
/a/mw-log/test2wiki.log:Start request GET /w/index.php?title=Kyrgyzstan&action=edit&mobileaction=toggle_view_mobile
/a/mw-log/test2wiki.log:Start request GET /w/index.php?title=Special:UserLogin&returnto=Talk%3AAlbum&returntoquery=action%3Dedit%26redlink%3D1%26mobileaction%3Dtoggle_view_mobile&type=signup
/a/mw-log/test2wiki.log:20140228122857  0.101   /w/index.php?title=Special:UserLogin&returnto=Talk:Album&returntoquery=action=edit&redlink=1&mobileaction=toggle_view_mobile&type=signup        (proxied via 10.64.0.103 forwarded for 137.110.244.139, 10.128.0.118, 10.128.0.110) anon
/a/mw-log/test2wiki.log:Start request GET /w/index.php?title=Talk:Nepal&action=edit&redlink=1&mobileaction=toggle_view_mobile
/a/mw-log/test2wiki.log:Start request GET /w/index.php?title=Rule&action=edit&redlink=1&mobileaction=toggle_view_mobile
/a/mw-log/test2wiki.log:Start request GET /w/index.php?title=Bluebook&action=edit&redlink=1&mobileaction=toggle_view_mobile
/a/mw-log/test2wiki.log:Start request GET /w/index.php?title=User:RobLa-WMF&mobileaction=toggle_view_mobile
/a/mw-log/test2wiki.log:Start request GET /w/index.php?title=Special:UserLogin&type=signup&returnto=Jazz&returntoquery=action%3Dedit%26redlink%3D1%26mobileaction%3Dtoggle_view_mobile
/a/mw-log/test2wiki.log:20140228191618  0.098   /w/index.php?title=Special:UserLogin&type=signup&returnto=Jazz&returntoquery=action=edit&redlink=1&mobileaction=toggle_view_mobile      (proxied via 10.64.32.107 forwarded for 137.110.244.139, 10.128.0.110, 10.128.0.118) anon
/a/mw-log/test2wiki.log:Start request GET /w/index.php?title=Justice&action=edit&redlink=1&mobileaction=toggle_view_mobile
/a/mw-log/test2wiki.log:Start request GET /w/index.php?title=Template:Orphan&action=edit&mobileaction=toggle_view_mobile
Comment 5 Arthur Richards 2014-02-28 23:27:17 UTC
Alright, I can't gracefully fix this without some consultation from the Zero team, so the change that introduced this bug is reverted (but not deployed):
https://gerrit.wikimedia.org/r/#/c/116174/
Comment 6 Arthur Richards 2014-03-01 00:00:34 UTC
Merged, deployed. All seems OK now.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links