summaryrefslogtreecommitdiff
path: root/unoxml
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-01-16 11:23:21 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2023-01-17 06:17:36 +0000
commit48916eb11bea29ac2f7963d779b18491d6015737 (patch)
tree46151692b26c9090fdddfce1d25bfc85cbca6d3e /unoxml
parent3cecdaeab10d4fcb0f478035fa3831c2e255b10c (diff)
tdf#153009 Use recursive mutex in CDocumentBuilder
This was changed from `osl::Mutex` to `std::mutex` in commit e66fdb597b30fc701bb068824d0ae4d89fecd55f Date: Sat Jul 31 20:12:30 2021 +0200 osl::Mutex->std::mutex in CDocumentBuilder , but `DOM::CDocumentBuilder::parseURI` locks the mutex and then calls `DOM::CDocumentBuilder::parse` for the // if we failed to parse the URI as a simple file, lets try via a ucb stream. // For Android file:///assets/ URLs which must go via the osl/ file API. case, which would result in a deadlock because `DOM::CDocumentBuilder::parse` wants to lock the mutex again. This happens once that code path is executed on Android Viewer when creating a new Impress presentation with Change-Id Iba1ac68c0b983d3e465515f07b3fc67162a0ee3f ("tdf#153009 android: Include more doc layout related XML files") in place. Fix the deadlock by using a "std::recursive_mutex` instead. Part of the backtrace: DOM::CDocumentBuilder::parse(const com::sun::star::uno::Reference<…> &) documentbuilder.cxx:331 DOM::CDocumentBuilder::parseURI(const rtl::OUString &) documentbuilder.cxx:387 non-virtual thunk to DOM::CDocumentBuilder::parseURI(rtl::OUString const&) documentbuilder.cxx:0 SdDrawDocument::InitLayoutVector() drawdoc.cxx:1130 SdDrawDocument::SdDrawDocument(DocumentType, SfxObjectShell *) drawdoc.cxx:147 sd::DrawDocShell::Construct(bool) docshell.cxx:94 sd::DrawDocShell::DrawDocShell(SfxModelFlags, bool, DocumentType) docshell.cxx:140 sd_PresentationDocument_get_implementation::$_1::operator()(SfxModelFlags) const unodoc.cxx:65 std::__ndk1::__invoke<…>(sd_PresentationDocument_get_implementation::$_1 &, SfxModelFlags &&) type_traits:4353 std::__ndk1::__invoke_void_return_wrapper::__call<…>(sd_PresentationDocument_get_implementation::$_1 &, SfxModelFlags &&) __functional_base:318 std::__ndk1::__function::__alloc_func::operator()(SfxModelFlags &&) functional:1527 std::__ndk1::__function::__func::operator()(SfxModelFlags &&) functional:1651 std::__ndk1::__function::__value_func::operator()(SfxModelFlags &&) const functional:1799 std::__ndk1::function::operator()(SfxModelFlags) const functional:2347 sfx2::createSfxModelInstance(const com::sun::star::uno::Sequence<…> &, std::__ndk1::function<…>) sfxmodelfactory.cxx:82 sd_PresentationDocument_get_implementation(com::sun::star::uno::XComponentContext *, const com::sun::star::uno::Sequence<…> &) unodoc.cxx:61 std::__ndk1::__invoke<…>(com::sun::star::uno::XInterface *(*&)(com::sun::star::uno::XComponentContext *, const com::sun::star::uno::Sequence<…> &), com::sun::star::uno::XComponentContext *&&, const com::sun::star::uno::Sequence<…> &) type_traits:4353 std::__ndk1::__invoke_void_return_wrapper::__call<…>(com::sun::star::uno::XInterface *(*&)(com::sun::star::uno::XComponentContext *, const com::sun::star::uno::Sequence<…> &), com::sun::star::uno::XComponentContext *&&, const com::sun::star::uno::Sequence<…> &) __functional_base:318 std::__ndk1::__function::__alloc_func::operator()(com::sun::star::uno::XComponentContext *&&, const com::sun::star::uno::Sequence<…> &) functional:1527 std::__ndk1::__function::__func::operator()(com::sun::star::uno::XComponentContext *&&, const com::sun::star::uno::Sequence<…> &) functional:1651 std::__ndk1::__function::__value_func::operator()(com::sun::star::uno::XComponentContext *&&, const com::sun::star::uno::Sequence<…> &) const functional:1799 std::__ndk1::function::operator()(com::sun::star::uno::XComponentContext *, const com::sun::star::uno::Sequence<…> &) const functional:2347 cppuhelper::ServiceManager::Data::Implementation::doCreateInstance(const com::sun::star::uno::Reference<…> &) servicemanager.cxx:706 cppuhelper::ServiceManager::Data::Implementation::createInstance(const com::sun::star::uno::Reference<…> &, bool) servicemanager.cxx:675 cppuhelper::ServiceManager::createInstanceWithContext(const rtl::OUString &, const com::sun::star::uno::Reference<…> &) servicemanager.cxx:1006 non-virtual thunk to cppuhelper::ServiceManager::createInstanceWithContext(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) servicemanager.cxx:0 SfxFrameLoader_Impl::load(const com::sun::star::uno::Sequence<…> &, const com::sun::star::uno::Reference<…> &) frmload.cxx:707 non-virtual thunk to (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) frmload.cxx:0 framework::LoadEnv::impl_loadContent() loadenv.cxx:1167 framework::LoadEnv::start() loadenv.cxx:403 framework::LoadEnv::startLoading(const rtl::OUString &, const com::sun::star::uno::Sequence<…> &, const com::sun::star::uno::Reference<…> &, const rtl::OUString &, long, LoadEnvFeatures) loadenv.cxx:308 framework::LoadEnv::loadComponentFromURL(const com::sun::star::uno::Reference<…> &, const com::sun::star::uno::Reference<…> &, const rtl::OUString &, const rtl::OUString &, long, const com::sun::star::uno::Sequence<…> &) loadenv.cxx:168 framework::Desktop::loadComponentFromURL(const rtl::OUString &, const rtl::OUString &, long, const com::sun::star::uno::Sequence<…> &) desktop.cxx:594 non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, long, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) desktop.cxx:0 lo_documentLoadWithOptions(_LibreOfficeKit *, const char *, const char *) init.cxx:2666 lo_documentLoad(_LibreOfficeKit *, const char *) init.cxx:2532 Java_org_libreoffice_kit_Office_documentLoadNative(JNIEnv *, jobject, jstring) lokandroid.cxx:134 [...] Change-Id: I63bc7b6f682dab2e94f4e932429c513c5129428e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145620 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'unoxml')
-rw-r--r--unoxml/source/dom/documentbuilder.hxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/unoxml/source/dom/documentbuilder.hxx b/unoxml/source/dom/documentbuilder.hxx
index b29e0410e76e..7b93b170d4c1 100644
--- a/unoxml/source/dom/documentbuilder.hxx
+++ b/unoxml/source/dom/documentbuilder.hxx
@@ -46,7 +46,7 @@ namespace DOM
: public CDocumentBuilder_Base
{
private:
- std::mutex m_Mutex;
+ std::recursive_mutex m_Mutex;
css::uno::Reference< css::xml::sax::XEntityResolver > m_xEntityResolver;
css::uno::Reference< css::xml::sax::XErrorHandler > m_xErrorHandler;