Last modified: 2014-09-25 16:40:36 UTC
Lua错误 模块:Wikidata的第16行:attempt to concatenate a nil value 回溯: [C]: 在函数“getExpandedArgument”中 mw.lua:141: ? 模块:Infobox:338: 在函数“preprocessArgs”中 模块:Infobox:414: 在函数“chunk”中 mw.lua:497: ? (Translated version below:) Lua error Line 16 of Module:Wikidata: attempt to concatenate a nil value Backtrace: [C]: In function “getExpandedArgument” mw.lua:141: ? Module:Infobox:338: In function “preprocessArgs” Module:Infobox:414: In function “chunk” mw.lua:497: ? Pages / revisions: https://zh.wikipedia.org/w/index.php?title=%E6%9F%8F%E6%9E%97%E8%92%BC%E7%A9%B9%E4%B8%8B&oldid=30390918 https://zh.wikipedia.org/w/index.php?title=%E6%A8%A1%E5%9D%97:Wikidata&oldid=32739940 https://zh.wikipedia.org/w/index.php?title=%E6%A8%A1%E5%9D%97:Infobox&oldid=28580418
Bumping severity because it causes (recoverable) data loss in *links table when someone triggering a linksupdate is using HHVM.
It looks like nested Lua calls are propagating errors up further than they should. I'm investigating why.
Created attachment 16553 [details] Test case I've reduced this to a more minimal test case. What's happening is that EG(exception) isn't getting cleared despite the try-catch in the PHP function, so luasandbox_call_php rethrows it.
This problem appears quite widespread. Setting High importance.
I think the correct thing to do is to clear EG(exception) at the end of zend_wrap_func(). In Zend, EG(exception) is an "active" exception, i.e. prior to being handled by the VM. EG(exception) is cleared by the ZEND_CATCH opcode. So it makes sense to clear it before returning to HHVM's VM. In a recursive call into zend_wrap_func() via zend_call_function(), the Zend exception will be converted to a C++ exception and back again, so there will only be one sort of exception active at any one time. Whereas in the current situation, after the return from zend_wrap_func(), we have both a Zend exception and a C++ exception being active.
https://github.com/facebook/hhvm/pull/3834
(In reply to Tim Starling from comment #6) > https://github.com/facebook/hhvm/pull/3834 Thanks Tim.