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 on close #5724

Open
4 tasks done
8thony opened this issue Nov 21, 2024 · 3 comments
Open
4 tasks done

Crash on close #5724

8thony opened this issue Nov 21, 2024 · 3 comments
Labels

Comments

@8thony
Copy link
Contributor

8thony commented Nov 21, 2024

Checklist

  • I'm reporting a problem with Chatterino
  • I've verified that I'm running the most recent nightly build or stable release
  • I've looked for my problem on the wiki
  • I've searched the issues and pull requests for similar looking reports

Describe your issue

c2 not always exit cleanly.

Stack isBroadcaster -> app was nullptr > chatterino.exe!chatterino::TwitchChannel::isBroadcaster() Line 836 C++ chatterino.exe!chatterino::TwitchChannel::addChannelPointReward(const chatterino::ChannelPointReward & reward) Line 429 C++ [Inline Frame] chatterino.exe!chatterino::TwitchIrcServer::initialize::__l2::::()::__l2::::operator()() Line 706 C++ [Inline Frame] chatterino.exe!chatterino::postToThread::__l2::Event::{dtor}() Line 30 C++ chatterino.exe!`chatterino::postToThread<``chatterino::TwitchIrcServer::initialize'::`2'::::operator()'::`2'::>'::`2'::Event::`scalar deleting destructor'(unsigned int) C++ Qt6Core.dll!00007ffe3b52a648() Unknown Qt6Gui.dll!00007ffe3bb3978d() Unknown Qt6Widgets.dll!00007ffe3c49771e() Unknown Qt6Core.dll!00007ffe3b570be8() Unknown chatterino.exe!main(int argc, char * * argv) Line 124 C++ chatterino.exe!qtEntryPoint() Line 50 C++ [Inline Frame] chatterino.exe!invoke_main() Line 102 C++ chatterino.exe!__scrt_common_main_seh() Line 288 C++ KERNEL32.DLL!00007ffe7f4e7374() Unknown ntdll.dll!00007ffe7f9fcc91() Unknown
Stack onEntitlementCreate -> tryGetApp returned nullptr > [Inline Frame] chatterino.exe!chatterino::SeventvEventAPI::onEntitlementCreate(const chatterino::seventv::eventapi::EntitlementCreateDeleteDispatch &) Line 381 C++ chatterino.exe!chatterino::SeventvEventAPI::handleDispatch(const chatterino::seventv::eventapi::Dispatch & dispatch) Line 214 C++ chatterino.exe!chatterino::SeventvEventAPI::onMessage(std::weak_ptr hdl, std::shared_ptr> msg) Line 161 C++ [Inline Frame] chatterino.exe!chatterino::BasicPubSubManager::{ctor}::__l2::::operator()(std::weak_ptr) Line 82 C++ [Inline Frame] chatterino.exe!std::invoke(chatterino::BasicPubSubManager::{ctor}::__l2:: &) Line 1714 C++ chatterino.exe!std::_Func_impl_no_alloc<`chatterino::BasicPubSubManager::BasicPubSubManager'::`2'::,void,std::weak_ptr,std::shared_ptr>>::_Do_call(std::weak_ptr && <_Args_0>, std::shared_ptr> && <_Args_1>) Line 874 C++ [Inline Frame] chatterino.exe!std::_Func_class,std::shared_ptr>>::operator()(std::weak_ptr) Line 920 C++ chatterino.exe!websocketpp::connection::handle_read_frame(const std::error_code & ec, unsigned __int64 bytes_transferred) Line 1212 C++ [Inline Frame] chatterino.exe!std::_Func_class::operator()(const std::error_code & <_Args_1>, unsigned __int64) Line 920 C++ chatterino.exe!websocketpp::transport::asio::connection::handle_async_read(std::function handler, const boost::system::error_code & ec, unsigned __int64 bytes_transferred) Line 912 C++ ...

OS and Chatterino Version

Chatterino Nightly 2.5.1 (commit 6ceb987) Qt 6.7.1 Running on Windows 10

@8thony 8thony added the issue-report An issue reported by a user. label Nov 21, 2024
@pajlada
Copy link
Member

pajlada commented Nov 21, 2024

@8thony What version are you on?

@pajlada pajlada added crash and removed issue-report An issue reported by a user. labels Nov 21, 2024
@8thony
Copy link
Contributor Author

8thony commented Nov 21, 2024

@pajlada the comment was too long to display, so it cut off the rest with the version. I edited the post.

@Nerixyz
Copy link
Contributor

Nerixyz commented Nov 21, 2024

More stuff:

  • Crash on dangling network request
     [0x0]    ntdll!NtDelayExecution+0x14   
     [0x1]    KERNELBASE!SleepEx+0x9e   
     [0x2]    chatterino!crashpad::`anonymous namespace'::UnhandledExceptionHandler+0xde   
     [0x3]    KERNELBASE!UnhandledExceptionFilter+0x1e7   
     [0x4]    ntdll!RtlUserThreadStart$filt$0+0xa2   
     [0x5]    ntdll!_C_specific_handler+0x96   
     [0x6]    ntdll!RtlpExecuteHandlerForException+0xf   
     [0x7]    ntdll!RtlDispatchException+0x244   
     [0x8]    ntdll!KiUserExceptionDispatch+0x2e   
     [0x9]    MSVCP140!mtx_do_lock+0x2f   
     [0xa]    chatterino!std::_Mutex_base::lock+0x9   
     [0xb]    chatterino!std::unique_lock<std::mutex>::{ctor}+0x13   
     [0xc]    chatterino!pajlada::Settings::Setting<bool>::getValue+0x29   
     [0xd]    chatterino!pajlada::Settings::Setting<bool>::operator bool+0x5   
     [0xe]    chatterino!`chatterino::LinkResolver::resolve'::`2'::<lambda_1>::operator()+0x24e   
     [0xf]    chatterino!std::_Func_class<void,chatterino::NetworkResult>::operator()+0x1b   
     [0x10]   chatterino!`chatterino::NetworkData::emitSuccess'::`2'::<lambda_1>::operator()+0x9c   
     [0x11]   chatterino!chatterino::postToThread::__l2::Event::{dtor}+0x13   
     [0x12]   chatterino!`chatterino::postToThread<`chatterino::NetworkData::emitSuccess'::`2'::<lambda_1> &>'::`2'::Event::`scalar deleting destructor'+0x27   
     [0x13]   Qt6Core!QCoreApplicationPrivate::cleanupThreadData+0xa9   
     [0x14]   Qt6Gui!QGuiApplicationPrivate::~QGuiApplicationPrivate+0x14d   
     [0x15]   Qt6Widgets!QStyleOptionViewItem::operator=+0x6ab   
     [0x16]   Qt6Core!QObject::~QObject+0x812   
     [0x17]   chatterino!main+0xd17   
     [0x18]   chatterino!qtEntryPoint+0x30   
     [0x19]   chatterino!invoke_main+0x21   
     [0x1a]   chatterino!__scrt_common_main_seh+0x106   
     [0x1b]   KERNEL32!BaseThreadInitThunk+0x14   
     [0x1c]   ntdll!RtlUserThreadStart+0x21 
    
  • Crash in onEmoteSetCreate
    [0x0]    ntdll!NtDelayExecution+0x14   
    [0x1]    KERNELBASE!SleepEx+0x9e   
    [0x2]    chatterino!crashpad::`anonymous namespace'::UnhandledExceptionHandler+0xde   
    [0x3]    KERNELBASE!UnhandledExceptionFilter+0x1e7   
    [0x4]    ntdll!RtlUserThreadStart$filt$0+0xa2   
    [0x5]    ntdll!_C_specific_handler+0x96   
    [0x6]    ntdll!RtlpExecuteHandlerForException+0xf   
    [0x7]    ntdll!RtlDispatchException+0x244   
    [0x8]    ntdll!KiUserExceptionDispatch+0x2e   
    [0x9]    chatterino!chatterino::SeventvEventAPI::onEmoteSetCreate+0x211   
    [0xa]    chatterino!chatterino::SeventvEventAPI::handleDispatch+0x43   
    [0xb]    chatterino!chatterino::SeventvEventAPI::onMessage+0x735   
    [0xc]    chatterino!chatterino::BasicPubSubManager<chatterino::BttvLiveUpdateSubscription>::{ctor}::__l2::<lambda_2>::operator()+0x54   
    [0xd]    chatterino!std::invoke+0x93   
    [0xe]    chatterino!std::_Func_impl_no_alloc<`chatterino::BasicPubSubManager<chatterino::BttvLiveUpdateSubscription>::BasicPubSubManager<chatterino::BttvLiveUpdateSubscription>'::`2'::<lambda_2>,void,std::weak_ptr<void>,std::shared_ptr<websocketpp::message_buffer::message<websocketpp::message_buffer::alloc::con_msg_manager> > >::_Do_call+0x9f   
    [0xf]    chatterino!std::_Func_class<void,std::weak_ptr<void>,std::shared_ptr<websocketpp::message_buffer::message<websocketpp::message_buffer::alloc::con_msg_manager> > >::operator()+0x30   
    [0x10]   chatterino!websocketpp::connection<chatterino::BasicPubSubConfig>::handle_read_frame+0xdc5   
    [0x11]   chatterino!std::_Func_class<void,std::error_code const &,unsigned __int64>::operator()+0xe   
    [0x12]   chatterino!websocketpp::transport::asio::connection<websocketpp::config::asio_tls_client::transport_config>::handle_async_read+0x317   
    [0x13]   chatterino!std::invoke+0x44   
    [0x14]   chatterino!std::_Invoker_ret<std::_Unforced>::_Call+0x44   
    [0x15]   chatterino!std::_Call_binder+0x44   
    [0x16]   chatterino!std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_tls_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,boost::system::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_tls_client::transport_config> >,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>::operator()+0x44   
    [0x17]   chatterino!websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_tls_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,boost::system::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_tls_client::transport_config> >,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &> >::operator()+0x44   
    (...asio...)
    [0x2c]   chatterino!boost::asio::io_context::run+0x23   
    [0x2d]   chatterino!websocketpp::transport::asio::endpoint<websocketpp::config::asio_tls_client::transport_config>::run+0xc   
    [0x2e]   chatterino!chatterino::BasicPubSubManager<chatterino::seventv::eventapi::Subscription>::runThread+0x67   
    [0x2f]   chatterino!chatterino::BasicPubSubManager<chatterino::seventv::eventapi::Subscription>::start::__l2::<lambda_1>::operator()+0x6a   
    [0x30]   chatterino!std::invoke+0x6a   
    [0x31]   chatterino!std::thread::_Invoke<std::tuple<`chatterino::BasicPubSubManager<chatterino::seventv::eventapi::Subscription>::start'::`2'::<lambda_1> >,0>+0x7c   
    [0x32]   ucrtbase!thread_start<unsigned int (__cdecl*)(void *),1>+0x42   
    [0x33]   KERNEL32!BaseThreadInitThunk+0x14   
    [0x34]   ntdll!RtlUserThreadStart+0x21   
    

Realistically, we can fix all of them to a certain degree, but not completely. What we really want is a read-write lock for Application for non-main threads (no need to lock on the main thread since that's the one destroying the app).

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

No branches or pull requests

3 participants