From 5b68f21600680a7875232a878cc1ffaff18b114c Mon Sep 17 00:00:00 2001 From: Changgyu Choi Date: Thu, 17 Aug 2023 18:10:48 +0900 Subject: [PATCH] Fix crash issue This patch is for a below crash issue. #3 0xb6d503ce in __GI_abort () at abort.c:79 #4 0xb706dc1c in __gnu_cxx::__verbose_terminate_handler () at ../../../../libstdc++-v3/libsupc++/vterminate.cc:95 #5 0xb707c336 in __cxxabiv1::__terminate ( handler=0xb707e820 <__gnu_cxx::__verbose_terminate_handler()>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:47 #6 0xb707c39f in std::terminate () at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:57 #7 0x800b2cba in std::thread::~thread (this=0x810b5a9c, __in_chrg=) at /usr/lib/gcc/i586-tizen-linux-gnu/9.2.0/include/c++/thread:139 #8 launchpad::Worker::~Worker (this=0x810b5a80, __in_chrg=) at /usr/src/debug/launchpad-0.36.3-1.i386/src/launchpad-process-pool/worker.cc:46 #9 0x800b2ce2 in launchpad::Worker::~Worker (this=0x810b5a80, __in_chrg=) at /usr/src/debug/launchpad-0.36.3-1.i386/src/launchpad-process-pool/worker.cc:46 #10 0x8009978c in std::default_delete::operator() ( this=0x800ccb18 , __ptr=) at /usr/lib/gcc/i586-tizen-linux-gnu/9.2.0/include/c++/bits/unique_ptr.h:75 #11 std::unique_ptr >::reset ( __p=, this=0x800ccb18 ) at /usr/lib/gcc/i586-tizen-linux-gnu/9.2.0/include/c++/bits/unique_ptr.h:394 #12 launchpad::SignalManager::Dispose ( this=this@entry=0x800cca00 ) at /usr/src/debug/launchpad-0.36.3-1.i386/src/launchpad-process-pool/signal_manager.cc:121 #13 0x8009983f in launchpad::SignalManager::Dispose ( this=0x800cca00 ) at /usr/src/debug/launchpad-0.36.3-1.i386/src/launchpad-process-pool/signal_manager.cc:171 #14 launchpad::SignalManager::~SignalManager ( this=0x800cca00 , __in_chrg=) at /usr/src/debug/launchpad-0.36.3-1.i386/src/launchpad-process-pool/signal_manager.cc:171 #15 0xb6d6bfff in __run_exit_handlers (status=status@entry=-1, listp=0xb6f0339c <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108 #16 0xb6d6c1d5 in __GI_exit (status=-1) at exit.c:139 #17 0x80096948 in launchpad::ProcessPool::OnExecution (this=) at /usr/src/debug/launchpad-0.36.3-1.i386/src/launchpad-process-pool/process_pool.cc:118 #18 0x80071b03 in launchpad::Executor::Execute (this=this@entry=0x810b8044, priority=priority@entry=0) at /usr/src/debug/launchpad-0.36.3-1.i386/src/launchpad-process-pool/executor.cc:50 #19 0x80096b09 in launchpad::ProcessPool::PrepareProcess (this=0x810b8040) Change-Id: I96ff11d3fb0fc6d368d531e4ecc38bf10135bc84 Signed-off-by: Changgyu Choi --- src/launchpad-process-pool/dbus.cc | 2 ++ src/launchpad-process-pool/worker.cc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/launchpad-process-pool/dbus.cc b/src/launchpad-process-pool/dbus.cc index da24593..92a2a42 100644 --- a/src/launchpad-process-pool/dbus.cc +++ b/src/launchpad-process-pool/dbus.cc @@ -105,6 +105,8 @@ class DBusManager { } delete queue_; + } else { + thread_.detach(); } disposed_ = true; diff --git a/src/launchpad-process-pool/worker.cc b/src/launchpad-process-pool/worker.cc index 0b2dd45..1a2e972 100644 --- a/src/launchpad-process-pool/worker.cc +++ b/src/launchpad-process-pool/worker.cc @@ -48,6 +48,8 @@ Worker::~Worker() { Add(std::make_shared()); thread_.join(); delete queue_; + } else { + thread_.detach(); } } -- 2.7.4