GLib-CRITICAL **: 14:04:30.328: g_strsplit: assertion 'string != NULL' failed
When I run gnome-shell in my jhbuild environment, it crashes on startup in libgdm:
(gdb) bt
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=5, no_tid=no_tid@entry=0)
at pthread_kill.c:44
#1 0x00007fc1adc138c3 in __pthread_kill_internal (signo=5, threadid=<optimized out>) at pthread_kill.c:78
#2 0x00007fc1adbc66b6 in __GI_raise (sig=5) at ../sysdeps/posix/raise.c:26
#3 0x0000000000402d48 in dump_gjs_stack_on_signal_handler (signo=5)
at ../../../../Projects/gnome-shell/src/main.c:353
#4 <signal handler called>
#5 _g_log_abort (breakpoint=1) at ../../../../Projects/glib/glib/gmessages.c:559
#6 0x00007fc1aecff9d4 in g_logv (log_domain=0x7fc1aed70b8f "GLib", log_level=G_LOG_LEVEL_CRITICAL,
format=0x7fc1aed6bd35 "%s: assertion '%s' failed", args=0x7ffe5914fd58)
at ../../../../Projects/glib/glib/gmessages.c:1413
#7 0x00007fc1aecffac8 in g_log (log_domain=0x7fc1aed70b8f "GLib", log_level=G_LOG_LEVEL_CRITICAL,
format=0x7fc1aed6bd35 "%s: assertion '%s' failed") at ../../../../Projects/glib/glib/gmessages.c:1455
#8 0x00007fc1aed01af7 in g_return_if_fail_warning (log_domain=0x7fc1aed70b8f "GLib",
pretty_function=0x7fc1aed71038 <__func__.15> "g_strsplit", expression=0x7fc1aed70bd7 "string != NULL")
at ../../../../Projects/glib/glib/gmessages.c:2894
#9 0x00007fc1aed1f0ab in g_strsplit (string=0x0, delimiter=0x7fc1385b6415 ":", max_tokens=-1)
at ../../../../Projects/glib/glib/gstrfuncs.c:2402
#10 0x00007fc1385aec80 in collect_sessions () at ../libgdm/gdm-sessions.c:282
#11 0x00007fc1385af7d5 in gdm_get_session_ids () at ../libgdm/gdm-sessions.c:374
#12 0x00007fc1ad133c04 in ffi_call_unix64 () at ../src/x86/unix64.S:76
Problem is surely here:
supported_session_types = g_strsplit (g_getenv ("GDM_SUPPORTED_SESSION_TYPES"), ":", -1);
It looks like this environment variable is intended to be optional anyway, so should only require a simple NULL check.