GNOME Bugzilla – Bug 754951
gnome-session-3.16.0 crashed
Last modified: 2016-03-07 22:27:05 UTC
warning: Could not load shared library symbols for linux-vdso.so.1. Do you need "set solib-search-path" or "set sysroot"? [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Core was generated by `gnome-session'. Program terminated with signal SIGSEGV, Segmentation fault.
+ Trace 235439
Thread 2 (Thread 0x7f014699c980 (LWP 22952))
Thread 1 (Thread 0x7f014699b700 (LWP 22997))
perhaps DBUS_SESSION_BUS_ADDRESS has invalid characters in it?
I will try to see the next time it occurs... I can only see that I didn't "manually" messed with that, but I have no idea if maybe something changed its value on its own or similar :/
This is just a typical "setenv is not threadsafe" crash - one thread is calling getenv (via gettext) while the other is calling setenv. Boom. We can't do that.
Some options we discussed: - keep a separate environ array in gnome-session and use that when launching apps - something else I forget now
- try putenv instead and see if that doesn't crash because it has some handywavy comment in its man page about being reentrant - try to convince gettext to stop calling getenv() every time it's run.
I sent a mail to Daiki, mentioning this bug
Why do you pin this on gettext? I don't see that in the backtrace. Isn't it better to not use setenv() after starting threads? Changing just gettext() doesn't really fix anything, that just papers over the problem....
The only case of setenv/genenv thread-safety crashes that I have ever seen is this one, where gettenv is called from gettext. Thats why I pin this is on gettext: it is simply the most common caller of getenv, and it is a bit insidious because gettext looks like it _should_ be threadsafe, in particular when it comes in the guise of _()
Created attachment 323327 [details] [review] main: don't use g_setenv after start up It's not threadsafe and gettext makes us crash, so maintain child environment separate from process environment.
Attachment 323327 [details] pushed as 759b2b5 - main: don't use g_setenv after start up
Nice to see it fixed properly, planning to cherry-pick to gnome-3-20?
yea, i'm going to cherry-pick the things over from master before release on monday. note there were a couple follow up fixes that I accidentally posted to bug 754941