https://bugzilla.wikimedia.org/show_bug.cgi?id=48393

Brad Jorsch <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
            Summary|Reusing object references   |Recursive data structures
                   |for module variables        |are silently broken in
                   |sometimes results in "Fatal |LuaSandbox, cause an error
                   |exception of type           |in LuaStandalone
                   |ScribuntoException" (Linux) |
                   |or "The interpreter exited  |
                   |with status 1" (Windows)    |
     Ever confirmed|0                           |1

--- Comment #1 from Brad Jorsch <[email protected]> ---
Your error only occurs in LuaStandalone, and also goes away if you comment out
the line "p.colors = colors".

The problem is that LuaStandalone cannot return data structures to PHP that
incorporate references. While it would almost be possible to do this,[1] PHP
does a shallow clone when passing the array around unless "&" is used
appropriately. So for something like "p.recurse = p", when it got back to PHP
$p['recurse'] !== $p although $p['recurse']['recurse'] === $p['recurse']. And
if PHP does $x = $p['recurse'], now $x['recurse'] !== $x.

The error doesn't occur on enwiki because LuaSandbox just silently replaces the
recursive object with an empty "placeholder". Odd that it was done in two
different ways there, that should probably be fixed.


 [1]: I looked at it back in December, Lua→PHP is easy but there are unresolved
issues for PHP→Lua.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to