Abort when callback is called #103

Closed
pgarnero06 opened this Issue Jan 8, 2013 · 3 comments

Comments

Projects
None yet
3 participants

Hello.

The issue seems almost identical to issue #84.

Basically, node.js aborts with the following message:

node: ../src/node_object_wrap.h:60: static T* node::ObjectWrap::Unwrap(v8::Handlev8::Object) [with T = node::Buffer]: Assertion `!handle.IsEmpty()' failed.
Aborted

I use the following versions:

  • ffi 1.2.3
  • node-ffi 0.5.5
  • node.js 0.8.16

I have created an FFI callback that way:

var websock_send_callback_ptr = new ffi.Callback('void', ['int', 'string'], function(conid,msg) {
console.log('AVIRER callback called conid: ' + conid);
console.log('AVIRER callback called msg: ' + msg);
for (var key in clients)
{
if (clients[key] == conid)
{
key.sendUTF(msg);
}
}
});

According to issue#84, I have tried to keep a reference on this object for ever (but please note that I have never seen any message related to GC issue):

process.on('exit', function() {
websock_send_callback_ptr;
});

I have registered the callback that way:
var libconnector = ffi.Library('libvst_con_web_node_linux_x86',
{
'CON_connection_up_web_node' : [ 'void', ['int'] ],
'CON_connection_down_web_node' : [ 'void', ['int'] ],
'CON_register_send_cb_web_node' : [ 'void', ['pointer'] ],
'CON_receive_msg_web_node' : [ 'void', ['int', 'string'] ],
});
.....
libconnector.CON_register_send_cb_web_node(websock_send_callback_ptr);

My "registering" C function has the following prototype:

void MM_CON_FUNCTION(register_send_cb)(void *inFuncPtr);

At the end, I get the following trace under gdb:

(gdb) where
#0 0x0012d422 in __kernel_vsyscall ()
#1 0x002cd651 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2 0x002d0a82 in *__GI_abort () at abort.c:92
#3 0x002c6718 in *__GI___assert_fail (assertion=0x8592c77 "!handle.IsEmpty()", file=0x8592ac4 "../src/node_object_wrap.h", line=60,

function=0x85933c0 "static T* node::ObjectWrap::Unwrap(v8::Handle<v8::Object>) [with T = node::Buffer]") at assert.c:81

#4 0x081c91dd in node::Buffer::New(char_, unsigned int, void ()(char, void_), void*) ()
#5 0x00e13018 in WrapPointer(char*, unsigned int) () from /home/dev/nodejs2/node_modules/ffi/build/Release/ffi_bindings.node
#6 0x00e14ab8 in CallbackInfo::DispatchToV8(callback_info, void_, void**, bool) () from /home/dev/nodejs2/node_modules/ffi/build/Release/ffi_bindings.node
#7 0x00e1816f in ffi_closure_SYSV_inner () from /home/dev/nodejs2/node_modules/ffi/build/Release/ffi_bindings.node
#8 0x00e1851a in ffi_closure_SYSV () from /home/dev/nodejs2/node_modules/ffi/build/Release/ffi_bindings.node
#9 0x00ed4c6f in hmi_webSockSend (inWebCnxId=0x87899f0,

inpData=0x8800070 "<msg instance=\"1\">\n\t<tokens url=\"http://192.168.136.130:8080/temp_files/file_0.xml\" id=\"1234\" >\n\t</tokens>\n</msg>\n", inDataLen=115)
at /mnt/hgfs/pgarnero_view_uicockpit_v10/sw_hmi_ss/07_subsystem/ui.cockpit_framework/plugin_connectors/con_web_node/03_code/src/hmi_nodewebsocket.c:144

#10 0x00ed1d3b in conDoInitToken (inOid=0xbfffe23c, inParam=0xbfffe218)

at /mnt/hgfs/pgarnero_view_uicockpit_v10/sw_hmi_ss/07_subsystem/ui.cockpit_framework/plugin_connectors/con_web_node/03_code/src/hmi_connector_web_node.c:2865

#11 0x00ed3903 in conDo (inOid=0xbfffe23c, inDo=2415919138, inParam=0xbfffe218)

at /mnt/hgfs/pgarnero_view_uicockpit_v10/sw_hmi_ss/07_subsystem/ui.cockpit_framework/plugin_connectors/con_web_node/03_code/src/hmi_connector_web_node.c:3498

#12 0x00ecb84e in CON_do_web_node (inOid=0xbfffe23c, inDo=2415919138, inParam=0xbfffe218)

at /mnt/hgfs/pgarnero_view_uicockpit_v10/sw_hmi_ss/07_subsystem/ui.cockpit_framework/plugin_connectors/con_web_node/03_code/src/hmi_connector_web_node.c:456

#13 0x00f98208 in hmi_loaDo (inLibraryId=0x87596f0, inOid=0xbfffe23c, inDo=2415919138, inParam=0xbfffe218)

at /mnt/hgfs/pgarnero_view_uicockpit_v10/sw_hmi_ss/07_subsystem/ui.cockpit_framework/server/loader/03_code/src/hmi_loa_module_loader_interface.c:896

#14 0x00ea098b in hmi_prxSendDictionary (inInstanceId=1)

at /mnt/hgfs/pgarnero_view_uicockpit_v10/sw_hmi_ss/07_subsystem/ui.cockpit_framework/server/prx_manager/03_code/src/hmi_prx_module.c:677

#15 0x00ea1b62 in hmi_prxConnect (inConnectionId=1, inLibraryId=0x87596f0)

at /mnt/hgfs/pgarnero_view_uicockpit_v10/sw_hmi_ss/07_subsystem/ui.cockpit_framework/server/prx_manager/03_code/src/hmi_prx_request.c:507

#16 0x00ea1ff9 in hmi_prxConnectCallBack0 (inConnectionId=1)

at /mnt/hgfs/pgarnero_view_uicockpit_v10/sw_hmi_ss/07_subsystem/ui.cockpit_framework/server/prx_manager/03_code/src/hmi_prx_request.c:659

#17 0x00ecd7b7 in parseXml (inCnxId=0x87899f0, inpXmlData=0x8782ca0 "<init session_id="731" touchscreen="true" standalone="true">front_driver\n", inBufLen=80)

at /mnt/hgfs/pgarnero_view_uicockpit_v10/sw_hmi_ss/07_subsystem/ui.cockpit_framework/plugin_connectors/con_web_node/03_code/src/hmi_connector_web_node.c:1140

#18 0x00eccd11 in serverReadyRead (inCnxId=0x87899f0, inpContext=0x0, inpBuf=0x8782ca0 "<init session_id="731" touchscreen="true" standalone="true">front_driver\n",

inBufLen=80) at /mnt/hgfs/pgarnero_view_uicockpit_v10/sw_hmi_ss/07_subsystem/ui.cockpit_framework/plugin_connectors/con_web_node/03_code/src/hmi_connector_web_node.c:935

#19 0x00ecb9bf in CON_receive_msg_web_node (inNodeJsConId=0, inMsg=0x8782ca0 "<init session_id="731" touchscreen="true" standalone="true">front_driver\n")

at /mnt/hgfs/pgarnero_view_uicockpit_v10/sw_hmi_ss/07_subsystem/ui.cockpit_framework/plugin_connectors/con_web_node/03_code/src/hmi_connector_web_node.c:492

#20 0x00e1845e in ffi_call_SYSV () from /home/dev/nodejs2/node_modules/ffi/build/Release/ffi_bindings.node
#21 0x00e182ad in ffi_call () from /home/dev/nodejs2/node_modules/ffi/build/Release/ffi_bindings.node
#22 0x00e14201 in FFI::FFICall(v8::Arguments const&) () from /home/dev/nodejs2/node_modules/ffi/build/Release/ffi_bindings.node
#23 0x0833b695 in v8::internal::Builtin_HandleApiCall(v8::internal::(anonymous namespace)::BuiltinArguments<(v8::internal::BuiltinExtraArguments)1>, v8::internal::Isolate*) ()
#24 0xa9f0a236 in ?? ()
#25 0xb7c81418 in ?? ()
#26 0xa9f0edc1 in ?? ()
#27 0xb7c126bb in ?? ()
#28 0xa9f2ecc8 in ?? ()
#29 0xa9f0edc1 in ?? ()
#30 0xb7c29dc2 in ?? ()
#31 0xb7c28c6e in ?? ()
#32 0xa9f0f3d9 in ?? ()

---Type to continue, or q to quit---
#33 0xa9f0a0aa in ?? ()
#34 0x0835f39e in v8::internal::Invoke(bool, v8::internal::Handlev8::internal::JSFunction, v8::internal::Handlev8::internal::Object, int, v8::internal::Handlev8::internal::Object_, bool_) ()
#35 0x0835fbdd in v8::internal::Execution::Call(v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, int, v8::internal::Handlev8::internal::Object_, bool_, bool) ()
#36 0x0848deca in v8::internal::Runtime_Apply(v8::internal::Arguments, v8::internal::Isolate*) ()
#37 0xa9f0a236 in ?? ()
#38 0xb7cb9e85 in ?? ()
#39 0xa9f0edc1 in ?? ()
#40 0xa9f2ecc8 in ?? ()
#41 0xa9f0edc1 in ?? ()
#42 0xb7c46877 in ?? ()
#43 0xa9f0f3d9 in ?? ()
#44 0xa9f0a0aa in ?? ()
#45 0x0835f39e in v8::internal::Invoke(bool, v8::internal::Handlev8::internal::JSFunction, v8::internal::Handlev8::internal::Object, int, v8::internal::Handlev8::internal::Object_, bool_) ()
#46 0x0835fbdd in v8::internal::Execution::Call(v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, int, v8::internal::Handlev8::internal::Object_, bool_, bool) ()
#47 0x083131e4 in v8::Function::Call(v8::Handlev8::Object, int, v8::Handlev8::Value*) ()
#48 0x081c229f in node::MakeCallback(v8::Handlev8::Object, v8::Handlev8::Function, int, v8::Handlev8::Value*) ()
#49 0x081c2489 in node::MakeCallback(v8::Handlev8::Object, v8::Handlev8::String, int, v8::Handlev8::Value*) ()
#50 0x081e1ed7 in node::StreamWrap::OnReadCommon(uv_stream_s*, int, uv_buf_t, uv_handle_type) ()
#51 0x081e212e in node::StreamWrap::OnRead(uv_stream_s*, int, uv_buf_t) ()
#52 0x0822bdba in uv__read (loop=0x8711d40, w=0x8789b80, events=1) at ../deps/uv/src/unix/stream.c:653
#53 uv__stream_io (loop=0x8711d40, w=0x8789b80, events=1) at ../deps/uv/src/unix/stream.c:745
#54 0x082206b3 in ev_invoke_pending (loop=0x8712140) at ../deps/uv/src/unix/ev/ev.c:2145
#55 0x0821c94d in uv__poll (loop=0x8711d40) at ../deps/uv/src/unix/core.c:248
#56 uv__run (loop=0x8711d40) at ../deps/uv/src/unix/core.c:257
#57 0x0821cbf7 in uv_run (loop=0x8711d40) at ../deps/uv/src/unix/core.c:265
#58 0x081c39b7 in node::Start(int, char**) ()
#59 0x081d957b in main ()

Do you have any hint regarding this problem ?

Cheers,

Pierre

Sorry for the inconvenience. The problem is on my side and has been fixed.

Cheers,

Pierre

@pgarnero06 pgarnero06 closed this Jan 8, 2013

nbppp2 commented May 29, 2013

@pgarnero06 I am very interested in knowing what you did to fix this.

@pgarnero06 I caught the same on our logs, can you please explain the reason?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment