Resolves: rhbz#2171265 Failure to start with junk in program/services/

f41
Stephan Bergmann 2 years ago
parent 9f1dd53c30
commit 7ecfc95d35

@ -0,0 +1,43 @@
From feb8b04a0ee86b0146a17393da220ae188babda8 Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Wed, 22 Mar 2023 17:19:49 +0100
Subject: [PATCH] rhbz#2171265 Filter out all non *.rdb files
In that rhbz issue ("Libreoffice cannot start"), it looks like some junk file
named /usr/lib64/libreoffice/program/services/services.rdb;63ddcd86 caused
soffice.bin to crash early, without any information (cf.
a1faf14f74a62ea76141115538d7d30d90c9eeb6 "rhbz#2171265 Report fatal
InitApplicationServiceManager failures more reliably"). So, following up on
b8c7548527f5fc14fe8fcbe74a749c7e3c10d385 "ignore backup files in services/
directory to avoid debugging grief", extend the set of ignored files to anything
starting with "." or not ending in ".rdb" (in any case).
Change-Id: I154750465d2128b3ff6493f4ab606072dda61503
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149328
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
---
cppuhelper/source/paths.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx
index ece7650ded4c..dd8fe56df2bf 100644
--- a/cppuhelper/source/paths.cxx
+++ b/cppuhelper/source/paths.cxx
@@ -99,9 +99,11 @@ bool cppu::nextDirectoryItem(osl::Directory & directory, OUString * url) {
"Cannot stat in directory");
}
if (stat.getFileType() != osl::FileStatus::Directory) { //TODO: symlinks
- // Ignore backup files:
+ // Ignore backup and spurious junk files:
OUString name(stat.getFileName());
- if (!(name.match(".") || name.endsWith("~"))) {
+ if (name.match(".") || !name.endsWithIgnoreAsciiCase(u".rdb")) {
+ SAL_WARN("cppuhelper", "ignoring <" << stat.getFileURL() << ">");
+ } else {
*url = stat.getFileURL();
return true;
}
--
2.40.0

@ -0,0 +1,49 @@
From a1faf14f74a62ea76141115538d7d30d90c9eeb6 Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Wed, 22 Mar 2023 14:40:04 +0100
Subject: [PATCH] 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>
---
desktop/source/app/app.cxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 5a35b5a745c2..f1ec0b679bc0 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>
@@ -458,7 +459,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
--
2.40.0

@ -55,7 +55,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice
Epoch: 1
Version: %{libo_version}.2
Release: 3%{?libo_prerelease}%{?dist}
Release: 4%{?libo_prerelease}%{?dist}
# default new files are: MPLv2
# older files are typically: MPLv2 incorporating work under ASLv2
# nlpsolver is: LGPLv3
@ -268,9 +268,11 @@ Patch3: 0001-Revert-tdf-101630-gdrive-support-w-oAuth-and-Drive-A.patch
Patch4: 0001-don-t-crash-with-disable-pdfium.patch
Patch5: 0001-tdf-152073-tdf-153895-basicide-Set-bg-color-for-bord.patch
Patch6: 0001-Use-sifr-and-sifr_dark-for-gnome.patch
Patch7: 0001-rhbz-2171265-Report-fatal-InitApplicationServiceMana.patch
Patch8: 0001-rhbz-2171265-Filter-out-all-non-.rdb-files.patch
# TODO investigate these
Patch7: 0001-aarch64-failing-here.patch
Patch8: 0001-include-filename-if-the-test-fails.patch
Patch9: 0001-aarch64-failing-here.patch
Patch10: 0001-include-filename-if-the-test-fails.patch
# not upstreamed
Patch500: 0001-disable-libe-book-support.patch
@ -2249,6 +2251,9 @@ gtk-update-icon-cache -q %{_datadir}/icons/hicolor &>/dev/null || :
%{_includedir}/LibreOfficeKit
%changelog
* Wed Mar 22 2023 Stephan Bergmann <sbergman@redhat.com> - 1:7.5.1.2-4
- Resolves: rhbz#2171265 Failure to start with junk in program/services/
* Fri Mar 10 2023 Caolán McNamara <caolanm@redhat.com> - 1:7.5.1.2-3
- Use sifr/sifr_dark for gnome,
https://pagure.io/fedora-workstation/issue/361

Loading…
Cancel
Save