|
From: Bart V. A. <bar...@gm...> - 2008-07-10 07:21:23
|
On Thu, Jul 10, 2008 at 8:25 AM, Julian Seward <js...@ac...> wrote: > > On Thursday 10 July 2008 08:25, Bart Van Assche wrote: >> By the way, I noticed that GLib library uses several global variables >> which are shared over threads and which are not protected by a mutex, >> e.g. g_threads_got_initialized and g_mem_initialized. While this is >> correct, it is annoying for tools like Helgrind or DRD. Suppression >> patterns have to be added for every call stack and every access to any >> of these global variables to prevent that these appear in race >> reports. > > Can you show an example of how they are used across multiple threads? > I would have thought that drd should not show any race in such a case, > if Glib is really correct. You should know that most but not all data races detected by the happens-before algorithm are dangerous. E.g. if you analyze the function g_mem_init_nomessage() in source file glib/gmem.c, you will see that it is possible that the last eight lines of this function are executed twice but that this is harmless. I have filed a bug report for this issue anyway -- see also http://bugzilla.gnome.org/show_bug.cgi?id=542316. Bart. |