[LLVMdev] recognizing DTORs and vptr updates in LLVM.

Duncan Sands baldrick at free.fr
Tue Mar 20 00:51:25 PDT 2012


>> Using instruction level metadata for this would be appropriate.  However, I
>> also don't understand why a race on this is truly benign.
>
> It isn't, really; calling it "benign" is deceptive.  It's just that
> storing a pointer which is equal to the existing pointer stored at a
> given address almost always makes the optimizer/codegen generate code
> which can't trigger the race in a way which visibly misbehaves.
> Therefore, as a heuristic users apparently want ThreadSanitizer to
> ignore (or list separately) such races.

The gcc Ada front-end does this too, in quite a range of situations.  For
example multiple threads racily initialize a pointer variable, but they all
initialize to the same value.  The various valgrind based race detection
tools all complain about this, which makes them much less useful than they
might be for Ada.

Ciao, Duncan.



More information about the llvm-dev mailing list