Exclude multithreaded main-main races by threadflag#1589
Exclude multithreaded main-main races by threadflag#1589
Conversation
|
Any reason this is still a draft? We should be able to merge to reduce the number of in-flight PRs, right? |
|
It's a draft because I think this simple thing also makes some cases less precise by not incorporating some query. The other interesting matter is regarding the |
In some random version of glibc I looked at, the thread ID argument is written before the thread actually starts executing. |
This is a bit silly but the threadflag analysis
may_racedid not excludemain-mainraces even though it has all the information to do so.It almost never makes a difference because threadflag answers the
MustBeUniqueThreadquery based on its flag still, and the threadid analysis uses that information in itsmay_race.The more notable thing is the unexpected cram test (change). Usually accesses while single-threaded aren't even added to
allglobs, but apparently the thread ID variable write inpthread_createis added although as if single-threaded. This is odd for two reasons:allglobs.This was always in the cram test but went unnoticed until I played around with this.
EDIT: The original implementatin in 03b737e used to exclude these directly by requiring at least one access to be non-main. However, it seems like it might have not excluded races between single-threaded and multi-threaded–non-main, at least directly.