【发布时间】:2021-10-24 17:44:23
【问题描述】:
我正在尝试使用通过 vcpkg install v8 编译的 V8 库,但收到以下错误:
Failed to deserialize the V8 snapshot blob. This can mean that the snapshot blob file is corrupted or missing.
我正在发货的hello-world.cc 示例上对其进行测试:
v8::V8::InitializeICUDefaultLocation(argv[0]);
v8::V8::InitializeExternalStartupData(argv[0]);
std::unique_ptr<v8::Platform> platform = v8::platform::NewDefaultPlatform();
v8::V8::InitializePlatform(platform.get());
v8::V8::Initialize();
Isolate::CreateParams create_params;
create_params.array_buffer_allocator =
v8::ArrayBuffer::Allocator::NewDefaultAllocator();
Isolate* isolate = Isolate::New(create_params); // << here is the crash
Isolate::Scope isolate_scope(isolate);
在Isolate* isolate = Isolate::New(create_params); 中生成此错误是因为内部变量 i_isole 没有分配任何快照博客:
if (!i::Snapshot::Initialize(i_isolate)) {
// If snapshot data was provided and we failed to deserialize it must
// have been corrupted.
if (i_isolate->snapshot_blob() != nullptr) {
FATAL(
"Failed to deserialize the V8 snapshot blob. This can mean that the "
"snapshot blob file is corrupted or missing.");
}
很遗憾,我找不到任何有关此错误的参考。感谢您的建议。
更新:我正在 Visual Studio 2019 上尝试,在 32 位构建和 64 位构建上也是如此。
更新:基于 vcpkg.json 文件,版本为“9.0.257.17”。如果这不是一些已经修复的错误,我会尝试将其更新到最新版本。
【问题讨论】:
标签: javascript c++ v8 vcpkg