summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-01-07 11:21:31 +0300
committerXisco Fauli <xiscofauli@libreoffice.org>2022-01-10 18:39:24 +0100
commit1dff55f964bcf4a5c3fc1c1381d706125262bc2b (patch)
tree7683efd2c0b400d3f619c018ce0073e08ef53d88
parent7c51b1129c67b2c8bc85a4560b36555b83adeeb3 (diff)
tdf#146621: handle an exception that may hang process at ExitProcess time
Change-Id: I3ffc2303ae1851ab909612ae9bb7f70a077b24fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128097 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 639419601a3730eb84d0922ef3a540c961b81910) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128157 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--pyuno/source/module/pyuno_gc.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/pyuno/source/module/pyuno_gc.cxx b/pyuno/source/module/pyuno_gc.cxx
index e4ed6cb9d0a6..1efca400d510 100644
--- a/pyuno/source/module/pyuno_gc.cxx
+++ b/pyuno/source/module/pyuno_gc.cxx
@@ -111,11 +111,20 @@ void decreaseRefCount( PyInterpreterState *interpreter, PyObject *object )
// to be a method, which tells, whether the global
// interpreter lock is held or not
// TODO: Look for a more efficient solution
- rtl::Reference< GCThread >(new GCThread(interpreter, object))->launch();
+ try
+ {
+ rtl::Reference< GCThread >(new GCThread(interpreter, object))->launch();
//TODO: a protocol is missing how to join with the launched thread
// before exit(3), to ensure the thread is no longer relying on any
// infrastructure while that infrastructure is being shut down in
// atexit handlers
+ }
+ catch (std::runtime_error&)
+ {
+ // tdf#146621: Thread creation will fail on Windows with ERROR_ACCESS_DENIED
+ // when called at ExitProcess time; unhandled exception would hang the process
+ abort();
+ }
}
}