summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-03-22 14:40:04 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2023-03-24 13:49:34 +0000
commit35a46563b9cfe87a76ad5e637d77c37e4286bb62 (patch)
tree584871b43d207569bac627cc9257330de99d8f4f
parent5987e002772fa6b58fb7de25290396161fd2683c (diff)
rhbz#2171265 Report fatal InitApplicationServiceManager failures more reliably
For example, when initialization of the UNO type manager failed, any code run between this SetBootstrapError and the HandleBootstrapErrors in Desktop::Main which would need the type manager (e.g., to set a css::uno::Any) would have caused a crash, so would have failed to print to std::cerr the sought-after css::uno::Exception message. The mis-initialized process would most definitely crash sooner or later anyway, so there's no harm in a controlled std::abort() here (if that is even reached, and the process doesn't already crash in HandleBootstrapErrors, after it has printed the relevant information to std::cerr). Change-Id: Ic5889aedec0908fa4b1e2966eb188508d0f92d26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149323 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit a1faf14f74a62ea76141115538d7d30d90c9eeb6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149440 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149498
-rw-r--r--desktop/source/app/app.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index a45ce9f82a51..b205d5b189e1 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -28,6 +28,7 @@
#include <sal/config.h>
+#include <cstdlib>
#include <iostream>
#include <string_view>
@@ -455,7 +456,8 @@ void Desktop::Init()
}
catch (css::uno::Exception & e)
{
- SetBootstrapError( BE_UNO_SERVICEMANAGER, e.Message );
+ HandleBootstrapErrors( BE_UNO_SERVICEMANAGER, e.Message );
+ std::abort();
}
// Check whether safe mode is enabled