调试失败的node-ffi回调/分段错误

时间:2012-05-10 09:53:53

标签: node.js crash vlc v8 node-ffi

我正在尝试使用node-ffi在node.js中使用libvlc,虽然它似乎对于一般的基本媒体播放器功能非常有用,但是当我在程序中遇到崩溃,分段错误和一般冻结时尝试使用libvlc的异步事件系统并将其与node的EventEmitter集成。我到目前为止使用的代码托管在https://gist.github.com/2644721,但似乎无法正常工作。

GDB产生了一堆混合结果,但我收到的最后一次崩溃是:

Program received signal SIGSEGV, Segmentation fault.
0x000000000057cc86 in v8::Function::Call(v8::Handle<v8::Object>, int, v8::Handle<v8::Value>*) ()
(gdb) bt
#0  0x000000000057cc86 in v8::Function::Call(v8::Handle<v8::Object>, int, v8::Handle<v8::Value>*) ()
#1  0x00007ffff5997a41 in CallbackInfo::DispatchToV8(CallbackInfo*, void*, void**) ()
   from /home/adam/node_modules/node-ffi/compiled/0.6/linux/x64/ffi_bindings.node
#2  0x00007ffff5997adb in CallbackInfo::WatcherCallback(uv_async_s*, int) ()
   from /home/adam/node_modules/node-ffi/compiled/0.6/linux/x64/ffi_bindings.node
#3  0x00000000007be12f in ev_invoke_pending ()
#4  0x00000000007c2087 in ev_run ()
#5  0x00000000007b597f in uv_run ()
#6  0x000000000052a147 in node::Start(int, char**) ()
#7  0x00007ffff63ca76d in __libc_start_main ()
   from /lib/x86_64-linux-gnu/libc.so.6
#8  0x0000000000524fe5 in _start ()

很明显我在这里做错了 - node-ffi文档说如果你做错了就很容易引起这种行为。我想也许回调不是从同一个线程或范围运行,但我不确定如何检查甚至修复它。任何帮助将不胜感激......

Program received signal SIGSEGV, Segmentation fault.
IsGlobalObject (this=0x1)
    at /build/buildd/nodejs-0.6.17/deps/v8/src/objects-inl.h:796
796 in /build/buildd/nodejs-0.6.17/deps/v8/src/objects-inl.h
(gdb) bt
#0  IsGlobalObject (this=0x1)
    at /build/buildd/nodejs-0.6.17/deps/v8/src/objects-inl.h:796
#1  v8::internal::Invoke (construct=<optimised out>, func=..., receiver=..., 
    argc=2, args=0x7fffffffdeb0, has_pending_exception=0x7fffffffde1f)
    at /build/buildd/nodejs-0.6.17/deps/v8/src/execution.cc:101
#2  0x00000000005ae967 in v8::internal::Execution::Call (callable=..., 
    receiver=..., argc=2, args=0x7fffffffdeb0, 
    pending_exception=0x7fffffffde1f, convert_receiver=<optimised out>)
    at /build/buildd/nodejs-0.6.17/deps/v8/src/execution.cc:175
#3  0x000000000057cd31 in v8::Function::Call (this=0xc0aae0, recv=..., argc=2, 
    argv=0x7fffffffdeb0) at /build/buildd/nodejs-0.6.17/deps/v8/src/api.cc:3601
#4  0x00007ffff5997a41 in CallbackInfo::DispatchToV8(CallbackInfo*, void*, void**) ()
   from /home/adam/node_modules/node-ffi/compiled/0.6/linux/x64/ffi_bindings.node
#5  0x00007ffff5997adb in CallbackInfo::WatcherCallback(uv_async_s*, int) ()
   from /home/adam/node_modules/node-ffi/compiled/0.6/linux/x64/ffi_bindings.node
#6  0x00000000007be12f in ev_invoke_pending (loop=0xb9dea0)
    at src/unix/ev/ev.c:2149
#7  0x00000000007c2087 in ev_run (loop=0xb9dea0, flags=0)
    at src/unix/ev/ev.c:2525
#8  0x00000000007b597f in uv_run (loop=<optimised out>) at src/unix/core.c:194

0 个答案:

没有答案