From 80e547000673b1f8f9804a3cacbe5dc934077493 Mon Sep 17 00:00:00 2001 From: ts-korhonen Date: Mon, 25 Jul 2022 14:13:30 +0300 Subject: [PATCH 1/2] Fix crash at exit due to a unreleased mutex. Qt startblit() and endblit() use a mutex that can remain locked at exit. A thread static wrapper makes sure that each thread using the mutex will also release it before terminating. --- src/qt/qt_platform.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index eff022b3d..89ead7acd 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -54,6 +54,7 @@ QElapsedTimer elapsed_timer; static std::atomic_int blitmx_contention = 0; static std::recursive_mutex blitmx; +static thread_local std::unique_lock blit_lock { blitmx, std::defer_lock }; class CharPointer { public: @@ -468,17 +469,17 @@ void dynld_close(void *handle) void startblit() { blitmx_contention++; - if (blitmx.try_lock()) { + if (blit_lock.try_lock()) { return; } - blitmx.lock(); + blit_lock.lock(); } void endblit() { blitmx_contention--; - blitmx.unlock(); + blit_lock.unlock(); if (blitmx_contention > 0) { // a deadlock has been observed on linux when toggling via video_toggle_option // because the mutex is typically unfair on linux From 42cb69fd66b82e03b39f4ba73108ec6ed0a19684 Mon Sep 17 00:00:00 2001 From: richardg867 Date: Mon, 25 Jul 2022 18:29:11 -0300 Subject: [PATCH 2/2] Jenkins: Move extra-cmake-modules to platform-independent dependencies --- .ci/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index 3ac28eb8a..60917f43e 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -590,7 +590,7 @@ else esac # Establish general dependencies. - pkgs="cmake ninja-build pkg-config git wget p7zip-full wayland-protocols tar gzip file appstream" + pkgs="cmake ninja-build pkg-config git wget p7zip-full extra-cmake-modules wayland-protocols tar gzip file appstream" if [ "$(dpkg --print-architecture)" = "$arch_deb" ] then pkgs="$pkgs build-essential" @@ -608,7 +608,7 @@ else fi # Establish architecture-specific dependencies we don't want listed on the readme... - pkgs="$pkgs linux-libc-dev:$arch_deb extra-cmake-modules:$arch_deb qttools5-dev:$arch_deb qtbase5-private-dev:$arch_deb" + pkgs="$pkgs linux-libc-dev:$arch_deb qttools5-dev:$arch_deb qtbase5-private-dev:$arch_deb" # ...and the ones we do want listed. Non-dev packages fill missing spots on the list. libpkgs=""