Access violation executing location 0x0000000000000000 after calling Isolate::New()

自闭症网瘾萝莉.ら 提交于 2020-12-13 03:53:41

问题


I can't seem to figure out something getting V8 started up. I have this code:

if (!_V8Initialized)
{
    v8::V8::InitializeICU();

    v8::V8::InitializeExternalStartupData("x86\\"); // (this loads ok, I checked)

    auto platform = v8::platform::CreateDefaultPlatform();
    v8::V8::InitializePlatform(platform);

    v8::V8::Initialize();

    _V8Initialized = true;
}

auto params = Isolate::CreateParams();
params.array_buffer_allocator = ArrayBuffer::Allocator::NewDefaultAllocator();
_Isolate = Isolate::New(params);

But I get this error:

Exception thrown at 0x0000000000000000 in V8.Net.Console.exe: 0xC0000005: Access violation executing location 0x0000000000000000.

v8_libbase.dll!v8::base::OS::Abort() Line 832 C++ v8_libbase.dll!V8_Fatal(const char * file, int line, const char * format, ...) Line 74 C++ v8.dll!v8::internal::SnapshotData::SnapshotData(const v8::internal::Vector snapshot) Line 28 C++ v8.dll!v8::internal::Snapshot::Initialize(v8::internal::Isolate * isolate) Line 43 C++ v8.dll!v8::Isolate::New(const v8::Isolate::CreateParams & params) Line 8237 C++ V8_Net_Proxy_x64.dll!V8EngineProxy::V8EngineProxy(bool enableDebugging, void()() debugMessageDispatcher, int debugPort) Line 89 C++ V8_Net_Proxy_x64.dll!CreateV8EngineProxy(bool enableDebugging, void()() debugMessageDispatcher, int debugPort) Line 19 C++ [Managed to Native Transition]
V8.Net.dll!V8.Net.V8Engine.V8Engine() Line 246 C# V8.Net.Console.exe!V8.Net.Program.Main(string[] args) Line 31 C# [Native to Managed Transition]
mscoreei.dll!00007ffdbdd281ad() Unknown mscoree.dll!00007ffdbddc10ab() Unknown kernel32.dll!00007ffdd3868364() Unknown ntdll.dll!00007ffdd5ef70d1() Unknown

It seems to be failing here:

explicit SnapshotData(const Vector<const byte> snapshot)
  : SerializedData(const_cast<byte*>(snapshot.begin()), snapshot.length()) {
    CHECK(IsSane()); <-- THIS FAILS
}

I followed the source code here (for the most part): https://chromium.googlesource.com/v8/v8/+/branch-heads/4.8/samples/hello-world.cc

... but I'm not sure why it seems I'm getting a null error. I must be missing something...


回答1:


Nevermind, I always seem to figure things out AFTER posting to SO, lol. It turns out I was loading from the x86 directory and not the x64 directory (which I should have guess given the V8_Net_Proxy_x64.dll! lol).

I was going to delete the question, but I'll leave this here anyhow in case someone else falls into this in the middle of the night half asleep. ;)



来源:https://stackoverflow.com/questions/43215911/access-violation-executing-location-0x0000000000000000-after-calling-isolatene

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!