Luasandbox is broken under HHVM 3.10
Closed, ResolvedPublic

Description

After upgrading HHVM to version 3.10 from 3.9.1 and rebuilding luasandbox (sudo hphpize && cmake . && sudo make install && sudo service hhvm restart) luasandox is enabled: phpinfo () shows:

hhvm.dynamic_extensions = Array ( [0] => luasandbox.so )
...
hhvm.enable_zend_compat = 1

However, luasandbox doesn't work, the class Luasandbox does not exist and /var/log/hhvm/error.log says Fatal error: Class undefined: LuaSandbox in (path to MediaWiki)/extensions/Scribunto/engines/LuaSandbox/Engine.php on line 17.

Upgrading luasandbox didn't help.

If I run hhvm luasandbox.php this is what I get:

Fatal error: f_get_extension_funcs is not supported: extensions are built differently in (path to MediaWiki)/extensions/luasandbox/luasandbox.php on line 8

Upgrade: I downgraded HHVM to 3.9.1 and then to 3.9 but the issue remained. I suspect now, that the error is in LuaSandbox.

Upgrade: under HHVM 3.10.1 the issue persists.

alex-mashin updated the task description. (Show Details)
alex-mashin raised the priority of this task from to Needs Triage.
alex-mashin added a subscriber: alex-mashin.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 17 2015, 3:57 AM
alex-mashin updated the task description. (Show Details)Oct 17 2015, 4:50 AM
alex-mashin set Security to None.
alex-mashin updated the task description. (Show Details)Oct 17 2015, 6:46 AM
alex-mashin updated the task description. (Show Details)Oct 18 2015, 9:55 AM
alex-mashin updated the task description. (Show Details)Oct 18 2015, 10:10 AM
alex-mashin updated the task description. (Show Details)Nov 1 2015, 12:29 PM

Anybosy here? Anybody cares?

Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptDec 12 2015, 11:35 AM

Anybosy here?

Likely. :)

Anybody cares?

So far unfortunately not, as can be seen in the missing activity on this task.
If you have a strong personal interest to get a task fixed, contributing patches is the best way to initiate some progress.

Anybody cares?

So far unfortunately not, as can be seen in the missing activity on this task.

I care, but I also don't have HHVM 3.10 available without building it from source and don't really have the time at the moment to do so. Nor am I particularly familiar with HHVM and how extensions for it are built. @tstarling is probably the most-knowledgeable about that, or @ori might know it too.

Presumably what happened is that HHVM 3.10 broke backwards compatibility in some manner. If the break was unintentional then HHVM might want to restore BC, otherwise someone has to figure out how to adjust php-luasandbox for the new way of doing whatever is broken.

ori added a comment.Dec 18 2015, 12:26 AM

I can't reproduce this with the current HEAD of facebook/hhvm (3.12):

ori@hhvm-test:~/hhvm# hhvm --version
HipHop VM 3.12.0-dev (rel)
Compiler: heads/pr/6651-0-gec0481bb0405f96e60eb32c826f8e0e0bc007a9d
Repo schema: 06d86dc0f54b8e041cabb6d779fc5ce9d30bd816
ori@hhvm-test:~/hhvm# hhvm --php -r 'var_dump( extension_loaded("luasandbox") );'
bool(true)
ori@hhvm-test:~/hhvm# hhvm --php -r '$sandbox = new LuaSandbox; var_dump( $sandbox->loadString( "return 1" )->call() );'
array(1) {
  [0]=>
  int(1)
}

Is it possible your LuaSandbox directory is dirty from earlier build? You could try 'make clean' and also manually remove CMakeCache.txt if it is still there. Or better yet, try building from a fresh git-clone.

ori added a comment.Dec 18 2015, 2:49 AM

Oh, I should note that I used the cmake invocation in debian/rules, which is:

cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=None -DLUA_USE_CPP=1

alex-mashin added a comment.EditedDec 19 2015, 8:41 AM

I can't reproduce this with the current HEAD of facebook/hhvm (3.12):

Thank you, after replacing cmake . with cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=None -DLUA_USE_CPP=1, luasandbox started to work.

I documented this at https://www.mediawiki.org/wiki/Extension:Scribunto.

alex-mashin closed this task as Resolved.Dec 19 2015, 8:42 AM