phpv8 / v8js

V8 Javascript Engine for PHP — This PHP extension embeds the Google V8 Javascript Engine
http://pecl.php.net/package/v8js
MIT License
1.84k stars 200 forks source link

PHP 7.4 support #440

Closed stesie closed 4 years ago

stesie commented 4 years ago

closes #430 closes #409

stesie commented 4 years ago

Current version runs just fine on old PHP versions (and V8 7.5), like Travis shows us.

V8 7.5 with ppa:ondrej/php 7.4 however does not work correctly. It keeps crashing

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Test V8::executeString() : Testing lifespan of V8Js context objects [tests/ctx_lifetime.phpt]

root@2c6616b9defc:/app# cat tests/ctx_lifetime.out 
object(V8Object)#4 (0) {
}
Segmentation fault (core dumped)
Thread 1 "php" received signal SIGSEGV, Segmentation fault.
0x000055df9adc64ec in ?? ()
(gdb) bt
#0  0x000055df9adc64ec in ?? ()
#1  0x000055df9adc8db0 in execute_ex ()
#2  0x000055df9adcfdb3 in zend_execute ()
#3  0x000055df9ad41d33 in zend_execute_scripts ()
#4  0x000055df9acdf2e0 in php_execute_script ()
#5  0x000055df9add1d66 in ?? ()
#6  0x000055df9ab9c15a in ?? ()
#7  0x00007fe0e7be7830 in __libc_start_main (main=0x55df9ab9bca0, argc=6, argv=0x7fffc63fc668, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7fffc63fc658) at ../csu/libc-start.c:291
#8  0x000055df9ab9c279 in _start ()

... yet looks completely unrelated to v8js (on first sight?)

Contrary I can not reproduce this with self-compiled PHP 7.4.4 with -fsanitize=address :-(

stesie commented 4 years ago

For the moment I'll give up trying to reproduce the above behaviour. Maybe some patch the apply before packaging, ...

Build with self-compiled PHP + ASAN is green: https://jenkins.brokenpipe.de/job/v8js-github-stesie/job/php-7.4-support/2/

... so merging now.

V8 8.0 isn't working properly though

stesie commented 4 years ago

... if someone manages to reproduce the ondrej bug with a known codebase (and at best running ASAN yourself), let me know/open a specific issue