GNOME Bugzilla – Bug 748474
g_get_language_names() is not thread-safe
Last modified: 2016-03-26 12:57:45 UTC
Created attachment 302357 [details] Test program The alias_table static variable in glib/gcharset.c is initialized by unalias_lang()/read_aliases() without proper synchronization. As shown by the attached test program, this can cause segfaults and glibc heap corruption traps if g_get_language_names() is called in parallel from multiple threads, either directly or via g_key_file_new(). The attached patch fixes the issue.
Created attachment 302358 [details] [review] Fix
Two open-source libraries, VIPS and OpenSlide, are now calling g_get_language_names() from their shared library constructors to work around this bug. Any chance the patch could get a review?
Review of attachment 302358 [details] [review]: LGTM, sorry about the delay.
Thanks for the patch, committed! https://git.gnome.org/browse/glib/commit/?id=41888493f04bfcc42d5287267708edcc49d7b4ea Pings are OK. Another thing you can do to help is also jump in and look for *other* easy patches to review.