Page MenuHomePhabricator

Unknown exception from Thomas Mann page on rowiki
Closed, DuplicatePublic

Description

Repro url: https://ro.wikipedia.org/w/index.php?title=Thomas_Mann&diff=10758157&oldid=9788822
Logged error: https://logstash.wikimedia.org/app/kibana#/doc/logstash-*/logstash-2017.03.24/mediawiki/?id=AVsCWMuLlL3ktRIGFTtD

No stack trace found, but digging around in mwrepl i can find it gets the exception at: Scribunto_LuaSandboxInterpreter::callFunction() on line 329 of /srv/mediawiki/php-1.29.0-wmf.17/extensions/Scribunto/engines/LuaSandbox/Engine.php

I couldn't figure out the exact exception, but setting a gdb breakpoint on __cxa_throw we get the following stack trace:

#0  __cxxabiv1::__cxa_throw (obj=0x7fffd0a93900, tinfo=0x7fffe39e3d00 <typeinfo for lua_longjmp*>, 
    dest=0x0) at ../../../../src/libstdc++-v3/libsupc++/eh_throw.cc:62
#1  0x00007fffe37c3c1f in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1-c++.so.0
#2  0x00007fffe37c7c5f in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1-c++.so.0
#3  0x00007fffe37c5006 in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1-c++.so.0
#4  0x00007fffe37bfff1 in lua_pushcclosure () from /usr/lib/x86_64-linux-gnu/liblua5.1-c++.so.0
#5  0x00007fffe39f4c51 in ?? () from /usr/lib/x86_64-linux-gnu/hhvm/extensions/20150212/luasandbox.so
#6  0x00007fffe39f5175 in zim_LuaSandboxFunction_call(int, HPHP::RefData*, HPHP::RefData**, HPHP::RefData*, int, void***) () from /usr/lib/x86_64-linux-gnu/hhvm/extensions/20150212/luasandbox.so

Unfortunately a good part of the stack has been lost, or perhaps terbium just doesn't have enough debugging symbols.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 25 2017, 12:27 AM

Currently able to reproduce this in mwrepl with:

break Scribunto_LuaSandboxInterpreter::callFunction()
$ctx = new RequestContext();$ctx->setTitle(Title::newFromText('Thomas_Mann')); $ctx->setRequest(new FauxRequest(['title'=>'Thomas_Mann','diff'=>'10758157','oldid'=>'9788822']));$article = new Article(Title::newFromText('Thomas Mann')); $article->setContext($ctx); Action::factory('view', $article, $ctx)->show();
c 35

That will, currently, stop in the function that then calls into luasandbox and errors out. Probably a very fragile way but couldn't find anything better.

It doesn't have debug symbols for /usr/lib/x86_64-linux-gnu/liblua5.1-c++.so.0 Those are provided by the liblua5.1-0-dbg package.

EBernhardson updated the task description. (Show Details)Mar 25 2017, 1:10 AM

FWIW, I managed to work around the issue by optimizing some modules so that they load less Wikidata items. However, the error should be better reported.

Anomie changed the task status from Open to Stalled.Mar 27 2017, 2:31 PM
Anomie added a subscriber: Anomie.

FWIW, I managed to work around the issue by optimizing some modules so that they load less Wikidata items. However, the error should be better reported.

Unfortunately, now I can't reproduce the error to start trying to debug it. If someone can manage to reproduce it there in a sandbox, or on Beta Labs somehow, that'd be helpful.

Andrei_Stroe added a comment.EditedMar 27 2017, 3:26 PM

This is the change that I made in order to avoid it. That module was loading up the Wikidata item of the city of birth in order to get the country where it was located. If you want to test it, just rollback my change and you can test live on ro.wp. We're a small community and we discussed the issue at the village pump, so just mention you're investigating it when you rollback my change and the patrollers should leave you alone. Thomas Mann is the only article where we encountered this so far, anyway.

Anomie added a comment.EditedMar 27 2017, 3:43 PM

What I have been able to determine/guess here:

  • The only place I see "unknown exception" as the only text of an error is from runtime/vm/unwind-inl.h in HHVM. It doesn't appear in MediaWiki core, Scribunto, other deployed extensions, luasandbox, or lua-5.1.
  • Based on what little bit of stack info we have here, my best guess is that #5 is this line.
  • I see some other instances of the same error in the logs (kibana link), but so far not one that's reproducible. No idea if they're the same cause or just the same error message.