Re: Threadsanitizer Detection on GM

Bob Friesenhahn <[email protected]> Tue, 5 Feb 2019 12:45:33 -0600 (CST)
Newsgroups gmane.comp.video.graphicsmagick.bugs
Message-ID <[email protected]>
On Wed, 6 Feb 2019, Hongxu Chen wrote:
> WARNING: ThreadSanitizer: data race (pid=29974)
>  Atomic write of size 8 at 0x7ffee84393b8 by thread T6:
>    #0 __tsan_atomic64_fetch_add <null> (gm+0x476040)
>    #1 .omp_outlined. /home/exp/work/gm/GM-tsan/magick/gradient.c:123:7

The 'row_count' stack variable is declared to be omp shared and 
updated under the apparent protection of a 'pragma omp atomic' so I am 
curious if there is an actual problem here.  Is there some code change 
(e.g. a 'pragma omp flush (row_count)') which makes the reported issue 
go away?

> I'm trying some concurrent detection techniques, so I can try GM versions
> prior to 1.3.31,
> so thanks for this tip!

It would be interesting to see the difference.

Ultimately, well-tested patches which solve problems are most useful.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt