From c2ecd58e99de3e6e0ef3c18a41dcf71165256da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Fri, 23 Oct 2026 09:58:35 +0200 Subject: [PATCH] [Tests] Keep the icon render test QApplication alive until exit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Creating it as a function-local static tears it down before Qt's library statics at exit, and libQt6Network then runs QObject destructors against freed memory — a SEGV the sanitizer leg reports after the tests have already passed. Leak the application instead, the usual pattern for a test binary. --- tests/theme_migration/theme_icon_render_test.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/theme_migration/theme_icon_render_test.cpp b/tests/theme_migration/theme_icon_render_test.cpp index 5d0c13e3f..f12db5b16 100644 --- a/tests/theme_migration/theme_icon_render_test.cpp +++ b/tests/theme_migration/theme_icon_render_test.cpp @@ -28,7 +28,10 @@ void ensureGuiApplication() static int argc = 1; static char name[] = "theme_icon_test"; static char *argv[] = {name, nullptr}; - static QApplication app(argc, argv); + // Leaked on purpose: a function-local static QApplication is destroyed before Qt's + // own library statics at exit, and the network module's destructors then run + // against a torn-down QObject layer (SEGV under AddressSanitizer). + static QApplication *app = new QApplication(argc, argv); Q_UNUSED(app); }