summaryrefslogtreecommitdiffstats
path: root/desktop/source
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 05:03:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 05:09:28 +0000
commit97ac77f067910fa5e8206d75160fa63546a9358d (patch)
treee6fa64b43e8150ef65578afa4f1f40f3e19f7fa3 /desktop/source
parentReleasing progress-linux version 4:24.2.2-3~progress7.99u1. (diff)
downloadlibreoffice-97ac77f067910fa5e8206d75160fa63546a9358d.tar.xz
libreoffice-97ac77f067910fa5e8206d75160fa63546a9358d.zip
Merging upstream version 4:24.2.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configuration.cxx8
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx17
2 files changed, 22 insertions, 3 deletions
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index 6228142486..ceba81f947 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -654,7 +654,7 @@ OUString replaceOrigin(
void BackendImpl::PackageImpl::processPackage_(
- ::osl::ResettableMutexGuard &,
+ ::osl::ResettableMutexGuard & guard,
bool doRegisterPackage,
bool startup,
::rtl::Reference<AbortChannel> const &,
@@ -689,7 +689,10 @@ void BackendImpl::PackageImpl::processPackage_(
if ((that->m_eContext != Context::Bundled && !startup)
|| comphelper::LibreOfficeKit::isActive())
{
- if (m_isSchema)
+ bool bIsSchema = m_isSchema;
+ // tdf#159790 prevent lock-ordering deadlock, the code below might acquire the solar mutex
+ guard.clear();
+ if (bIsSchema)
{
css::configuration::Update::get(
that->m_xComponentContext)->insertExtensionXcsFile(
@@ -701,6 +704,7 @@ void BackendImpl::PackageImpl::processPackage_(
that->m_xComponentContext)->insertExtensionXcuFile(
that->m_eContext == Context::Shared, expandUnoRcUrl(url));
}
+ guard.reset();
}
that->addToConfigmgrIni( m_isSchema, true, url, xCmdEnv );
data.iniEntry = dp_misc::makeRcTerm(url);
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 6af2fb5515..d5c1feeb49 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -781,7 +781,7 @@ uno::Reference< graphic::XGraphic > BackendImpl::PackageImpl::getIcon( sal_Bool
void BackendImpl::PackageImpl::processPackage_(
- ::osl::ResettableMutexGuard &,
+ ::osl::ResettableMutexGuard & guard,
bool doRegisterPackage,
bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
@@ -802,10 +802,20 @@ void BackendImpl::PackageImpl::processPackage_(
xPackage->createAbortChannel() );
AbortChannel::Chain chain( abortChannel, xSubAbortChannel );
try {
+ // tdf#159790 temporarily release mutex for child packages
+ // This code is normally run on a separate thread so if a
+ // child package tries to acquire the solar mutex, a deadlock
+ // can occur if the main thread calls isRegistered() on this
+ // package or any of its parents. So, temporarily release
+ // this package's mutex while registering the child package.
+ guard.clear();
xPackage->registerPackage( startup, xSubAbortChannel, xCmdEnv );
+ guard.reset();
}
catch (const Exception &)
{
+ guard.reset();
+
//We even try a rollback if the user cancelled the action (CommandAbortedException)
//in order to prevent invalid database entries.
Any exc( ::cppu::getCaughtException() );
@@ -856,6 +866,11 @@ void BackendImpl::PackageImpl::processPackage_(
::cppu::throwException(exc);
}
}
+ catch (...) {
+ guard.reset();
+ throw;
+ }
+
data.items.emplace_back(xPackage->getURL(),
xPackage->getPackageType()->getMediaType());
}