report of false positive data race?

report of false positive data race?


I'm using Interl Inspector XE 2017. If I run 'Detect Deadlocks and Data Races' analysis I get a race condition dispalyed. If I run this analysis with option 'Enable debugger when problem detected', the threads mentioned by Inspecter XE are not at the dispayed code lines. I'm wondering what causes this behaviour (limitation by Inspector XE, false positive ...)

The code is compiled with gcc-6.3.1 (-std=c++14):

1   friend void intrusive_ptr_add_ref( context * ctx) noexcept {
2       ctx->use_count_.fetch_add( 1, std::memory_order_relaxed);
3    }

4    friend void intrusive_ptr_release( context * ctx) noexcept {
5        if ( 1 == ctx->use_count_.fetch_sub( 1, std::memory_order_release) ) {
6            std::atomic_thread_fence( std::memory_order_acquire);
7            deallocate_memory( ctx);
8        }
9    }

Inspector XE menitions a raced between line 2 and line 7.

thank you in advance,



Thread Topic: 

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Please submit this to our Online Service Center at so that we can properly track your support request.

Leave a Comment

Please sign in to add a comment. Not a member? Join today