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

Goswin von Brederlow goswin-v-b at web.de
Thu Jun 26 16:07:22 CEST 2014


On Thu, Jun 26, 2014 at 12:03:20PM +0200, Pieter Hintjens wrote:
> There are various false positives with different valgrind tools. You
> can maybe catch these in the suppression file?
> 
> On Thu, Jun 26, 2014 at 10:43 AM, Goswin von Brederlow
> <goswin-v-b at web.de> wrote:
> > 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.
> >
> > MfG
> >         Goswin

The supression file is what I ment with "annotate the code".

MfG
	Goswin



More information about the zeromq-dev mailing list