Closed TomCaserta closed 9 years ago
Aha just looking this looks like this may have been addressed in #152, will attempt one of the resolutions mentioned in there now.
Ok after waiting an hour to finish compiling, nope, doesnt appear to have fixed the issue by adding the snapshot=off to the make command.
Heres the console output of the build: http://pastebin.com/raw.php?i=HB4yX18N
Err, the provided console output tells that the test suite did pass the test, so V8Js is working. Maybe the previously compiled version is around somewhere and it's actually loading that one?
There also is that strange message fatal: destination path 'v8js' already exists and is not an empty directory.
the output. Depends on what the ran script is, whether that's a critical one. Just in case ...
@TomCaserta ping
Did that solve the problem you reported? Or doesn't it still work for you?
Sorry was away for the weekend, I'm not entirely sure the path v8js existing would be a issue of which would cause it to not work (maybe, really do not know). I believe I have deleted all traces of v8js on my system and then recompiled, that fatal error did not occur when building it this time.
Thing is, it is still giving me a segmentation fault, I must have missed some reference to an older version of v8js somewhere but I cant figure out where.
Here is the build script I used:
#!/bin/bash -eux
apt-get install chrpath
cd /tmp
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"
fetch v8
cd v8
make native snapshot=off library=shared -j8
chrpath -r '$ORIGIN' out/native/lib.target/libv8.so
sudo mkdir -p /tmp/v8-install/lib /tmp/v8-install/include
sudo cp out/native/lib.target/lib*.so /tmp/v8-install/lib/
sudo cp -R include/* /tmp/v8-install/include
echo -e "create /tmp/v8-install/lib/libv8_libplatform.a\naddlib out/native/obj.target/tools/gyp/libv8_libplatform.a\nsave\nend" | sudo ar -M
cd /tmp
git clone https://github.com/preillyme/v8js.git
cd v8js
phpize
./configure --with-v8js=/tmp/v8-install
make
make test
sudo make install
echo "extension=v8js.so" > /etc/php5/mods-available/v8js.ini
ln -s /etc/php5/mods-available/v8js.ini /etc/php5/cli/conf.d/20-v8js.ini
service php5-fpm restart
service nginx restart
Oh wow, okay sorted it. So originally there was definitely some sort of issue with the extension I compiled, which then caused me to use Xdebug.
Now I decided to not use xdebug and just try running it normally after I compiled it with the snapshot=off. It didn't segfault this time, I double checked it was working by printing something via javascript and that all worked correctly. So at this point I know that everything was correct in the config files and it was loading the correct extension. And thats when I realised that when I was issuing the php5-fpm restart command it wasnt actually restarting due to a bug on ubuntu that is laid out here:
http://stackoverflow.com/questions/19998526/ubuntu-php5-fpm-throws-unknown-instance-on-reload
After applying that fix. Killing php5-fpm and starting it up again, everything works correctly now which is great.
Thank you for your help @stesie.
Hi whenever I attempt to create an instance of V8Js using
new V8Js();
PHP segfaults with no error message. I turned on xdebug to figure out what was going on and this was the result:
From the command:
My PHP info on V8Js looks like the following:
Should the version be 0.2.1 or is that unrelated to the actual version of the extension. I compiled it only yesterday and previously had an older version of the extension working correctly on my site.
Output of php -v:
Is there anything I can do about this issue except downgrade to the previous version that was working? Is there any other information that you require?
Here is a link to my full phpinfo: http://pastebin.com/raw.php?i=Sw82J4vi