V8 Check failed: (params.array_buffer_allocator) != nullptr

0

I am trying to run the hello world application with the V8 engine. I've built V8 myself by following this guide. The version of V8 that I'm using is 8.0.93.

When I try to run the code, it fails at line 24 on v8::Isolate::New(create_params). This is what appears on the console:

#
# Fatal error in ../../../../../src/api.cc, line 8164
# Check failed: (params.array_buffer_allocator) != nullptr.
#
#
#
#FailureMessage Object: 0022F8D8
==== C stack trace ===============================

        v8::base::debug::StackTrace::StackTrace [0x0F3186A5+53]
        v8::platform::DefaultPlatform::GetStackTracePrinter [0x0039C42F+63]
        V8_Fatal [0x0F30194D+253]
        v8::Isolate::Initialize [0x0F3F4856+118]
        v8::Isolate::New [0x0F3F4F86+38]
        main [0x00373364+20] (C:\Users\redacted\main.cpp:23)
        invoke_main [0x00374343+51] (d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78)
        __scrt_common_main_seh [0x00374197+343] (d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
        __scrt_common_main [0x0037402D+13] (d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:331)
        mainCRTStartup [0x003743C8+8] (d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:17)
        BaseThreadInitThunk [0x76BB0419+25]
        RtlGetAppContainerNamedObjectPath [0x772C662D+237]
        RtlGetAppContainerNamedObjectPath [0x772C65FD+189]
        (No symbol) [0x00000000]

And here's the snippet of the sample code where the assertion fails:

...
// Create a new Isolate and make it the current one.
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator =
    v8::ArrayBuffer::Allocator::NewDefaultAllocator();
v8::Isolate* isolate = v8::Isolate::New(create_params); // <-- CHECK() fails in this function
{
...

I have looked into the api.cc file where the assertion fails, and it doesn't seem logical, because params.array_buffer_allocator is in fact set to an allocator, as can be seen in the sample code. When I tried to run the same code in older versions of V8, it worked perfectly.

Is the sample code in V8's repo outdated, or am I doing something wrong? How can I fix this?

EDIT: I forgot to mention that this is not a duplicate of V8: Fatal error: CHECK(V8::ArrayBufferAllocator() != NULL) failed because that post is almost 6 years old, and the solution proposed in it doesn't fix the problem.

c++
visual-c++
v8
asked on Stack Overflow Oct 30, 2019 by Lázár Zsolt

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0