Skip to content

Commit 16f4bd1

Browse files
committed
Merge bitcoin/bitcoin#35954: qa: Disable Qt's glib event dispatcher for GUI tests on OpenBSD
de2adc3 qa: Disable Qt's glib event dispatcher for GUI tests on OpenBSD (Hennadii Stepanov) Pull request description: When `bitcoin-gui` is built against OpenBSD's system Qt packages (which have GLib support), shutdown emits "GLib-CRITICAL **: g_main_context_pop_thread_default: assertion 'stack != NULL' failed" messages on `stderr`, which the test framework treats as a failure. Set `QT_NO_GLIB=1` so Qt falls back to its poll-based event dispatcher, which avoids the GLib thread-default context entirely. Fixes bitcoin/bitcoin#35851. See the CI log here: https://github.com/hebasto/bitcoin-core-nightly/actions/runs/31510478034. ACKs for top commit: maflcko: lgtm ACK de2adc3 Tree-SHA512: edc991c7a174bc304a4da0ca29ec97bcaece463289de3da5350a046f1133ce6d830c37d5188536ca2ce238d462e56de8f2167fdeeb1d1e5ecca38d60c8495cce
2 parents 4ca07c2 + de2adc3 commit 16f4bd1

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/functional/test_framework/test_node.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,17 @@ def start(self, extra_args=None, *, cwd=None, stdout=None, stderr=None, env=None
287287
# does not provide. In particular, painting a QGroupBox can make Qt call
288288
# addSubview: on an invalid native object (QTBUG-49686).
289289
subp_env.setdefault("QT_STYLE_OVERRIDE", "fusion")
290+
if platform.system() == "OpenBSD":
291+
# The system Qt packages are built with GLib support, so Qt uses
292+
# QEventDispatcherGlib, which pushes/pops the GLib thread-default
293+
# main context in each thread. On OpenBSD the pop can run during
294+
# thread exit after GLib's per-thread context stack has already
295+
# been torn down, so shutdown emits messages like
296+
# (process:NNN): GLib-CRITICAL **: g_main_context_pop_thread_default:
297+
# assertion 'stack != NULL' failed
298+
# on stderr, which the test framework treats as a failure.
299+
# Fall back to Qt's poll-based event dispatcher instead.
300+
subp_env.setdefault("QT_NO_GLIB", "1")
290301
subp_env.setdefault("LC_ALL", "nl_NL.UTF-8") # Set language to try to trigger translation bugs
291302
if sys.platform.startswith("linux") and "XDG_RUNTIME_DIR" not in subp_env:
292303
# Qt prints warnings to stderr when XDG_RUNTIME_DIR is unset or has wrong

0 commit comments

Comments
 (0)