Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in wspp_callback_client::send_msg #127

Open
jordanrudd opened this issue Apr 14, 2016 · 1 comment
Open

Crash in wspp_callback_client::send_msg #127

jordanrudd opened this issue Apr 14, 2016 · 1 comment

Comments

@jordanrudd
Copy link
Contributor

jordanrudd commented Apr 14, 2016

Crash dumps shows source of crash is this line:

next_msg = this_client->m_outgoing_msg_queue.front();

Crash dumps show that the crash happened in the call to std::queue::front. Calling front() on an empty queue leads to undefined behavior. Fix is probably to validate the queue isn't empty before doing this operation, and then doing the right thing if it is empty.

Callstack:

    RTC.DLL!std::_Deque_const_iterator<std::_Deque_val<std::_Deque_simple_types<Concurrency::streams::details::basic_producer_consumer_buffer<unsigned char>::_request> > >::operator*() Line 344   C++
>   RTC.DLL!web::websockets::client::details::wspp_callback_client::send_msg::__l2::<lambda>(Concurrency::task<std::error_code> previousTask) Line 544  C++
    RTC.DLL!std::_Invoker_functor::_Call<void <lambda>(Concurrency::task<std::error_code>) &,Concurrency::task<std::error_code> >(web::websockets::client::details::wspp_callback_client::send_msg::__l2::void <lambda>(Concurrency::task<std::error_code>) & _Obj, Concurrency::task<std::error_code> && <_Args_0>) Line 1410  C++
    RTC.DLL!std::_Func_impl<void <lambda>(Concurrency::task<std::error_code>),std::allocator<int>,void,Concurrency::task<std::error_code> >::_Do_call(Concurrency::task<std::error_code> && <_Args_0>) Line 211 C++
    RTC.DLL!std::_Func_class<void,Concurrency::task<signalr::negotiation_response> >::operator()(Concurrency::task<signalr::negotiation_response> <_Args_0>) Line 275   C++
    RTC.DLL!std::_Invoker_functor::_Call<std::function<void __cdecl(std::shared_ptr<signalr::transport>)> &,std::shared_ptr<signalr::transport> >(std::function<void __cdecl(std::shared_ptr<signalr::transport>)> & _Obj, std::shared_ptr<signalr::transport> && <_Args_0>) Line 1410  C++
    RTC.DLL!std::_Func_impl<std::function<void __cdecl(Concurrency::task<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > >)>,std::allocator<int>,void,Concurrency::task<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > > >::_Do_call(Concurrency::task<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > > && <_Args_0>) Line 211  C++
    RTC.DLL!std::_Func_class<void,Concurrency::task<signalr::negotiation_response> >::operator()(Concurrency::task<signalr::negotiation_response> <_Args_0>) Line 275   C++
    RTC.DLL!std::_Invoker_functor::_Call<<lambda_3b7b84cee8b4b5e9e10e6a06cc20f41a> &,Concurrency::task<signalr::negotiation_response> >(Concurrency::details::_MakeTToUnitFunc::__l2::<lambda_3b7b84cee8b4b5e9e10e6a06cc20f41a> & _Obj, Concurrency::task<signalr::negotiation_response> && <_Args_0>) Line 1408    C++
    RTC.DLL!std::_Func_impl<<lambda_3b7b84cee8b4b5e9e10e6a06cc20f41a>,std::allocator<int>,unsigned char,Concurrency::task<signalr::negotiation_response> >::_Do_call(Concurrency::task<signalr::negotiation_response> && <_Args_0>) Line 211    C++
    RTC.DLL!std::_Func_class<unsigned char,Concurrency::task<std::error_code> >::operator()(Concurrency::task<std::error_code> <_Args_0>) Line 275  C++
    RTC.DLL!Concurrency::task<unsigned char>::_ContinuationTaskHandle<void,void,std::function<void __cdecl(Concurrency::task<void>)>,std::integral_constant<bool,1>,Concurrency::details::_TypeSelectorNoAsync>::_LogWorkItemAndInvokeUserLambda<std::function<unsigned char __stdcall(Concurrency::task<void>)>,Concurrency::task<void> >(std::function<unsigned char __stdcall(Concurrency::task<void>)> && _func, Concurrency::task<void> && _value) Line 3581   C++
    RTC.DLL!Concurrency::task<std::error_code>::_ContinuationTaskHandle<std::error_code,void,std::function<void __cdecl(Concurrency::task<std::error_code>)>,std::integral_constant<bool,1>,Concurrency::details::_TypeSelectorNoAsync>::_Continue(std::integral_constant<bool,1> __formal, Concurrency::details::_TypeSelectorNoAsync __formal) Line 3696  C++
    RTC.DLL!Concurrency::details::_PPLTaskHandle<unsigned char,Concurrency::task<std::error_code>::_ContinuationTaskHandle<std::error_code,void,std::function<void __cdecl(Concurrency::task<std::error_code>)>,std::integral_constant<bool,1>,Concurrency::details::_TypeSelectorNoAsync>,Concurrency::details::_ContinuationTaskHandleBase>::invoke() C++
    RTC.DLL!Concurrency::details::_TaskProcHandle::_RunChoreBridge(void * _Parameter) Line 146  C++
    RTC.DLL!Concurrency::details::_DefaultPPLTaskScheduler::_PPLTaskChore::_Callback(void * _Args) Line 51  C++
    msvcp140.dll!Concurrency::details::`anonymous namespace'::task_scheduler_callback(_TP_CALLBACK_INSTANCE * __formal, void * args, _TP_WORK * __formal) Line 13   C++
    ntdll.dll!TppWorkpExecuteCallback(_TP_CALLBACK_INSTANCE * Instance, _TP_TASK * Task) Line 671   C
    ntdll.dll!TppWorkerThread(void * Parameter) Line 1076   C
    kernel32.dll!BaseThreadInitThunk(unsigned long RunProcessInit, long (void *) * StartAddress, void * Argument) Line 64   C
    ntdll.dll!__RtlUserThreadStart(long (void *) * StartAddress, void * Argument) Line 997  C
    ntdll.dll!_RtlUserThreadStart(long (void *) * StartAddress, void * Argument) Line 914   C
@Sonic78
Copy link

Sonic78 commented Mar 21, 2017

Is this problem related to #393 (a merge of PR #217 from ws_client_winrt.cpp to ws_client_wspp.cpp)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants