Helgrind

To try and help in debugging, I’ve been playing with some of the extra tools that come with Valgrind.

Everybody knows that if you aren’t using Valgrind you are living in sin.

I’ve recently tried to have a go at using Helgrind. It’s suppossed to be able to help you in finding race conditions in multithreaded applications.

Well, mysql is multithreaded, and so is NDB (cluster), so, this could be rather useful (especially since, with some new work being done, i’ve found race conditions, i just need to find out where).

From the manual:

Basically what Helgrind does is to look for memory locations which are accessed by more than one thread. For each such location, Helgrind records which of the program’s (pthread_mutex_)locks were held by the accessing thread at the time of the access. The hope is to discover that there is indeed at least one lock which is used by all threads to protect that location. If no such lock can be found, then there is (apparently) no consistent locking strategy being applied for that location, and so a possible data race might result.

sounds reasonable enough.
Now I’m actually chasing up one of it’s possible data races and seeing if it is, in fact, a race.

Has anybody else had any experience with Helgrind? Thoughts?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.