Glib is not helgrind-friendly
Submitted by Armin Burgmeier
Link to original bug (#739028)
Description
Helgrind is a debugger for threading problems which tries to find data races and other threading errors. However, it only works when POSIX threading primitives are used, which is no longer the case in recent glib versions for GMutex and GCond. Helgrind therefore reports many false positives in glib programs.
It seems to be possible to annotate custom primitives like mutices and condition variables, to make them known to helgrind.
A simpler option might be to allow falling back to using the POSIX primitives for debugging purposes, in a similar way as setting G_SLICE to always-malloc allows to skipping the slice allocator for debugging.
On a similar note, helgrind also cannot "see" atomic reference counters, and there also exist ways to annotate them (see the link above). But I expect the GMutex/GCond issue to be responsible for the majority of false positives.
Version: 2.42.x