diff --git a/0002-backport-tests-Adapt-to-clang-differences-when-causing-a-segfault.patch b/0002-backport-tests-Adapt-to-clang-differences-when-causing-a-segfault.patch new file mode 100644 index 0000000000000000000000000000000000000000..bdb9af1f3b2da5ea57cfc8a2498b9591f8a34505 --- /dev/null +++ b/0002-backport-tests-Adapt-to-clang-differences-when-causing-a-segfault.patch @@ -0,0 +1,46 @@ +From 14cfa06dc97615c1e8508d875d5a087ba9b652ff Mon Sep 17 00:00:00 2001 +From: zhoujing +Date: Wed, 18 Oct 2023 10:26:51 +0800 +Subject: [PATCH] tests: Adapt to clang differences when causing a segfault + +Reference:https://github.com/storaged-project/udisks/pull/1205/commits/14cfa06dc97615c1e8508d875d5a087ba9b652ff +--- + src/tests/helper.c | 5 +++++ + src/tests/test.c | 4 ---- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/src/tests/helper.c b/src/tests/helper.c +index 79384c39..2c375c8f 100644 +--- a/src/tests/helper.c ++++ b/src/tests/helper.c +@@ -27,6 +27,11 @@ + + #include "testutil.h" + ++#ifdef __clang__ ++__attribute__((optnone)) ++#else ++__attribute__((optimize((0)))) ++#endif + int + main (int argc, char *argv[]) + { +diff --git a/src/tests/test.c b/src/tests/test.c +index 3ddbdf2c..bd93c59c 100644 +--- a/src/tests/test.c ++++ b/src/tests/test.c +@@ -323,11 +323,7 @@ test_spawned_job_abnormal_termination (void) + job = udisks_spawned_job_new (s, NULL, getuid (), geteuid (), NULL, NULL); + udisks_spawned_job_start (job); + _g_assert_signal_received (job, "completed", G_CALLBACK (on_completed_expect_failure), +-#ifdef __clang__ +- (gpointer) "Command-line `./udisks-test-helper 4' was signaled with signal SIGILL (4): " +-#else + (gpointer) "Command-line `./udisks-test-helper 4' was signaled with signal SIGSEGV (11): " +-#endif + "OK, deliberately causing a segfault\n"); + g_object_unref (job); + g_free (s); +-- +2.27.0 + diff --git a/udisks2.spec b/udisks2.spec index 0346fd01a4b0117a1114b75c86094054fcaeb917..4679b5121faabc1f11078c47674784e6e0b74410 100644 --- a/udisks2.spec +++ b/udisks2.spec @@ -58,12 +58,13 @@ Name: udisks2 Summary: Disk Manager Version: 2.9.4 -Release: 4 +Release: 5 License: GPL-2.0+ and LGPL-2.0+ Group: System Environment/Libraries URL: https://github.com/storaged-project/udisks Source0: https://github.com/storaged-project/udisks/releases/download/udisks-%{version}/udisks-%{version}.tar.bz2 Patch1: 0001-udiskslinuxmountoptions-Do-not-free-static-daemon-resources.patch +Patch2: 0002-backport-tests-Adapt-to-clang-differences-when-causing-a-segfault.patch BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version} @@ -436,6 +437,9 @@ udevadm trigger %endif %changelog +* Wed Oct 18 2023 zhoujing - 2.9.4-5 +- [backport]tests: Adapt to clang differences when causing a segfault + * Tue Feb 21 2023 miaoguanqin - 2.9.4-4 - fix coredump while stop udisks2