[zeromq-dev] Running under valgrind shows a lot of possible data races

Goswin von Brederlow goswin-v-b at web.de
Thu Jun 26 10:43:57 CEST 2014

On Thu, Jun 26, 2014 at 08:03:08AM +0400, Dmitry Antipov wrote:
> I've tried to run hwserver and hwclient examples (taken unmodified from zguide)
> under 'valgrind --tool=helgrind' and see a lot of "Possible data race during
> read of size ..." errors (?). Can someone please explain them? Obviously hwclient
> and hwserver don't share sockets between threads, and all valgrind reports
> traces down to zeromq internals.
> Dmitry

I believe that is an implementation detail of the internal queues.
There is a race between the writer and reader of a queue. But no
matter what order the writer and reader run data is neither lost nor
duplicated. So yes, there is a race, but both possible orderings
produce correct behaviour.

Unless there is some bug there. You should trace down the race, verify
that the behaviour is actualy intended that way and then annotate the
code for helgrind to not show that specific race in the future. Repeat
till you get no more reports.


More information about the zeromq-dev mailing list