summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartlomiej Grzelewski <b.grzelewski@samsung.com>2017-09-20 11:19:33 +0200
committerDong Sun Lee <ds73.lee@samsung.com>2017-09-25 00:23:18 +0000
commit0dc962e1beae0e2c4825233ee08414c34528315a (patch)
treec3943edf4abf519d655ebb4975e2f6bc9ce48ea7
parenta8a5076372d8473663ed565eac3a14503f4c99b2 (diff)
downloadkey-manager-0dc962e1beae0e2c4825233ee08414c34528315a.tar.gz
key-manager-0dc962e1beae0e2c4825233ee08414c34528315a.tar.bz2
key-manager-0dc962e1beae0e2c4825233ee08414c34528315a.zip
Key-manager client crashed during pthread_cancel because try catch sections did not support stack unwind correctly. Change-Id: I7089160603394a11d94b437bb4f80cf19b632da0 (cherry picked from commit 3eb9315f621035b8ea237096506e77dfb232d842)
-rw-r--r--src/manager/client/client-common.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/manager/client/client-common.cpp b/src/manager/client/client-common.cpp
index d0c7a2f5..7cb11089 100644
--- a/src/manager/client/client-common.cpp
+++ b/src/manager/client/client-common.cpp
@@ -27,6 +27,7 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
+#include <cxxabi.h>
#include <dpl/errno_string.h>
#include <dpl/log/log.h>
@@ -330,6 +331,9 @@ int try_catch(const std::function<int()> &func)
LogError("CKM::MessageBuffer::Exception " << e.DumpToString());
} catch (const std::exception &e) {
LogError("STD exception " << e.what());
+ } catch (const abi::__forced_unwind &) {
+ LogDebug("abi::__forced_unwind caught. Thread cancelation.");
+ throw;
} catch (...) {
LogError("Unknown exception occured");
}
@@ -347,6 +351,9 @@ int try_catch_enclosure(const std::function<int()> &func)
} catch (const std::exception &e) {
LogError("std exception occured: " << e.what());
return CKMC_ERROR_UNKNOWN;
+ } catch (const abi::__forced_unwind &) {
+ LogDebug("abi::__forced_unwind caught. Thread cancelation.");
+ throw;
} catch (...) {
LogError("Unknown exception occured.");
return CKMC_ERROR_UNKNOWN;
@@ -367,6 +374,9 @@ void try_catch_async(const std::function<void()> &func,
} catch (const std::exception &e) {
LogError("STD exception " << e.what());
error(CKM_API_ERROR_UNKNOWN);
+ } catch (const abi::__forced_unwind &) {
+ LogDebug("abi::__forced_unwind caught. Thread cancelation.");
+ throw;
} catch (...) {
LogError("Unknown exception occured");
error(CKM_API_ERROR_UNKNOWN);