运行以下程序时,我遇到V8报告的致命错误:
var Fiber = require("fibers");
Fiber(function () {});
global.gc();
用于运行它的命令:
> node --expose-gc scratch.js
致命错误的内容如下:
#
# Fatal error in ..\..\src\global-handles.cc, line 99
# CHECK(state_ != FREE) failed
#
我使用以下版本:
vcbuild x86 Debug
构建)断言失败发生在gc()
电话下方。这是一个调用堆栈,从GC回调调用回{{1}}一直到ASSERT语句:
fibers
node.exe!v8::internal::GlobalHandles::Node::Release(v8::internal::GlobalHandles * global_handles) Line 99 C++
node.exe!v8::internal::GlobalHandles::Destroy(v8::internal::Object * * location) Line 431 C++
node.exe!v8::V8::DisposeGlobal(v8::internal::Object * * obj) Line 680 C++
node.exe!v8::Persistent<v8::Object>::Dispose() Line 4241 C++
fibers.node!Fiber::`scalar deleting destructor'(unsigned int) C++
fibers.node!Fiber::WeakCallback(void * data) Line 235 C++
fibers.node!uni::WeakCallbackShim<&Fiber::WeakCallback>(v8::Persistent<v8::Value> value, void * data) Line 111 C++
node.exe!v8::internal::GlobalHandles::Node::PostGarbageCollectionProcessing(v8::internal::Isolate * isolate, v8::internal::GlobalHandles * global_handles) Line 233 C++
版本的节点中没有出现此致命错误。然而,它似乎巧妙地破坏了V8引擎,它最终在一段随机代码中失败了一段时间。
目前,我提出的唯一解决方法是泄漏光纤,以免这段代码被击中。我做了什么特别错误或者这是Release
中的错误吗?
答案 0 :(得分:2)
此错误现在显然已通过此提交修复:
https://github.com/laverdet/node-fibers/commit/3e154941ba5c3234752af304defcf028107e5557
src/fibers.cc
@@ -231,7 +231,6 @@ class Fiber {
return;
}
- that.handle.Dispose();
delete &that;
}