v8js: V8JS Segfaults with React DOM Server > 16.6.3 because of `Uint16Array`

In versions of React > 16.6.3 they start using the Uint16Array. This construct works fine when executing string; however, segfaults when creating snapshot:

use V8Js;

$jsTest = 'var newArray = new Uint16Array(15);';

$v8js = new V8Js('PHP');
$v8js->executeString($jsTest); // WORKS

$result = V8Js::createSnapshot($jsTest); // Segfaults;

Maybe this is fixed in the v8 upstream and we need a new version? Otherwise, unable to get debugging setup correct to determine more information regarding segfault.


php --version

PHP 7.2.14-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jan 13 2019 10:05:18) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

php --ri v8js

v8js

V8 Javascript Engine => enabled
V8 Engine Compiled Version => 7.1.302.12
V8 Engine Linked Version => 7.1.302.12
Version => 2.1.0

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (13 by maintainers)

Most upvoted comments

Here is the issue I just filed with v8: https://bugs.chromium.org/p/v8/issues/detail?id=8822 PR for building with master: https://github.com/phpv8/v8js/pull/395

Previously, just instantiating and not assigning would throw the segfault: new Uint16Array(16);. That works fine on master now… but the second you try to assign it to a variable, it still segfaults. I’ll still add my PR for updating V8JS to support the latest master branch though.

Thinking it’s time to file an issue with v8.