From 9d273178738836d936a67498997b027ce0c72a72 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sun, 13 Jun 2021 20:11:34 -0700 Subject: [PATCH] gsettings: Emit glib logs on stderr, not stdout Having G_MESSAGES_DEBUG=all set in the environment (a normal thing to do when debugging Gnome troubles) causes gsettings-helper to emit a bunch of helpful gnome debug logs (which is good), but before this change they were printed on stdout rather than stderr (which was bad!). Rather than going somewhere the user could see, these log messages were being sent to the pulesaudio server and interpreted as the src/modules/stdin-util.c protocol. pulseadio waits to see a '!' message from gsettings-helper before continuing startup. With the log messages mixed in messing up the stdin-util protocol, pulseaudio never saw the '!' message, and so never completed startup. This simple fix relies on a recent glib > 2.68 (Mar 2021), so builds against old versions of glib will still have this problem! We consider this good enough until some complains otherwise. Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1222 Part-of: --- src/modules/gsettings/gsettings-helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/gsettings/gsettings-helper.c b/src/modules/gsettings/gsettings-helper.c index 1bf2f13cf..0b379bab7 100644 --- a/src/modules/gsettings/gsettings-helper.c +++ b/src/modules/gsettings/gsettings-helper.c @@ -85,6 +85,9 @@ int main(int argc, char *argv[]) { #if !GLIB_CHECK_VERSION(2,36,0) g_type_init(); #endif +#if GLIB_CHECK_VERSION(2,68,0) + g_log_writer_default_set_use_stderr(true); +#endif /* gsettings-data-convert copies data from GConf to GSettings. The * conversion is defined in the pulseaudio.convert file. The conversion is