glib2.0 2.13/2.14 ***MEMORY-WARNING*** GSlice and g_thread_init()
GLib 2.10 and later permit allocation of "Memory Slices" . But when
using GLib from multiple threads, you MUST initialize the GLib thread
system with g_thread_init(). If you don't, and your application uses
memory slices (even indirectly), you might see such warnings:
***MEMORY-WARNING***: gconftool-2: GSlice: g_thread_init() must
be called before all other GLib functions; memory corruption due to late
invocation of g_thread_init() has been detected; this program is likely
to crash, leak or unexpectedly abort soon...
To repeat here some important part of the GLib documentation  for
- Most of the time you will only have to call g_thread_init (NULL).
- g_thread_init() might only be called once. On the second call it will
abort with an error. If you want to make sure that the thread system
is initialized, you can do this:
if (!g_thread_supported ()) g_thread_init (NULL);
I witness plenty of applications now printing these warnings with the
new glib2.0 in experimental, and some now crashing. One quick way to
workaround or diagnose the problem is to set the following environment
This is also useful for valgrinding.
Please test and fix your packages against glib2.0 2.13.x series which
sit in experimental. These are fully compatible with 2.12.x (just not
API or ABI stable for the new 2.13.x API additions).
 Memory slices provide a space-efficient and multi-processing
scalable way to allocate equal-sized pieces of memory, just like the
original GMemChunks (from GLib <= 2.8), while avoiding their excessive
memory-waste, scalability and performance problems.