MayamaTakeshi / sip-lab

A node module that helps to write SIP functional tests
3 stars 2 forks source link

Cannot use more than one websocket client #101

Closed MayamaTakeshi closed 4 weeks ago

MayamaTakeshi commented 1 month ago

In #79 we implemented support for start_speech_synth using pjwebsock (talking with ws_speech_server). This works fine if this function is called on only one side of a call. But if I try to call this function to both sides of the call I will get a segfault (100% reproducible):

(gdb) bt
#0  0x0000000000000001 in ?? ()
#1  0x00007ffff4ca78a0 in on_data_sent () from /home/takeshi/src/git/MayamaTakeshi/sip-lab/build/Release/addon.node
#2  0x00007ffff4ca6ba5 in tp_send () from /home/takeshi/src/git/MayamaTakeshi/sip-lab/build/Release/addon.node
#3  0x00007ffff4ca85a7 in on_connect_complete () from /home/takeshi/src/git/MayamaTakeshi/sip-lab/build/Release/addon.node
#4  0x00007ffff4d1e724 in ioqueue_dispatch_write_event (h=0x7fffcfefc200, ioqueue=0x5b24e68) at ../src/pj/ioqueue_common_abs.c:290
#5  ioqueue_dispatch_write_event (ioqueue=0x5b24e68, h=0x7fffcfefc200) at ../src/pj/ioqueue_common_abs.c:203
#6  0x00007ffff4d2084f in pj_ioqueue_poll (ioqueue=0x5b24e68, timeout=timeout@entry=0x7fffffffbdd0) at ../src/pj/ioqueue_select.c:1112
#7  0x00007ffff4ce760a in pjsip_endpt_handle_events2 (endpt=0x5b1a168, max_timeout=0x7fffffffbe20, p_count=0x0) at ../src/pjsip/sip_endpoint.c:745
#8  0x00007ffff4c76a07 in handle_events () at ../src/sip.cpp:492
#9  0x00007ffff4c77998 in __pjw_poll (out_evt=out_evt@entry=0x7fffffffbec0 "") at ../src/sip.cpp:1537
#10 0x00007ffff4c93b3e in do_poll (info=...) at ../src/addon.cpp:1323
#11 0x00007ffff4c9d005 in Napi::details::CallbackData<Napi::Value (*)(Napi::CallbackInfo const&), Napi::Value>::Wrapper(napi_env__*, napi_callback_info__*)::{lambda()#1}::operator()() const (__closure=<synthetic pointer>, __closure=<synthetic pointer>) at /home/takeshi/src/git/MayamaTakeshi/sip-lab/node_modules/node-addon-api/napi-inl.h:111
#12 Napi::details::WrapCallback<Napi::details::CallbackData<Napi::Value (*)(Napi::CallbackInfo const&), Napi::Value>::Wrapper(napi_env__*, napi_callback_info__*)::{lambda()#1}>(Napi::details::CallbackData<Napi::Value (*)(Napi::CallbackInfo const&), Napi::Value>::Wrapper(napi_env__*, napi_callback_info__*)::{lambda()#1}) (callback=...)
    at /home/takeshi/src/git/MayamaTakeshi/sip-lab/node_modules/node-addon-api/napi-inl.h:73
#13 Napi::details::CallbackData<Napi::Value (*)(Napi::CallbackInfo const&), Napi::Value>::Wrapper (env=0x5b008b0, info=0x7fffffffcfa0)
    at /home/takeshi/src/git/MayamaTakeshi/sip-lab/node_modules/node-addon-api/napi-inl.h:106
#14 0x0000000000d7c3a9 in v8impl::(anonymous namespace)::FunctionCallbackWrapper::Invoke(v8::FunctionCallbackInfo<v8::Value> const&) ()
#15 0x00007fffefe0eadd in ?? ()
#16 0x00007fffffffd060 in ?? ()
#17 0x00007fffffffd098 in ?? ()
#18 0x0000000000000000 in ?? ()
(gdb)