Closed phallot closed 1 year ago
Weird, I tried with clang-16 and clang-17 which I have installed on my system (ubuntu) and I don't get any errors. Just installed clang-15 and no error or warning either when building the examples. What are you building that triggers these warnings?
Also, there are fewer than 5046 lines in phmap_base.h
. Did you add something?
I am using v1.3.11 which has more lines. https://github.com/greg7mdp/parallel-hashmap/blob/v1.3.11/parallel_hashmap/phmap.h
I'll try to create a repro.
Oh yes I see, sorry. Are you using these mutexes directly in your code, or is it always from phmap?
We are using phmap::node_hash_map
and phmap::HashState().combine
, so not directly, no.
I'm a little bit surprised, phmap::node_hash_map
doesn't do any locking, maybe you mean phmap::parallel_node_hash_map
?
In any case, thanks for reporting this issue. if you can create a small example reproducing the issue, I'll be happy to look into it.
I am not entirely sure how "thread-safety-analysis" works to be honest, but if it's like other warnings, the whole .h file is checked, not just the code used.
Thanks for the quick answers, I'll try to create a small example.
Just wondering, are you on a mac? Because I can't get the warnings on ubuntu.
This is in a debian VM running on an ARM mac.
Oh I see these warnings come from the Abseil mutex code which is included only when the Abseil
headers are found.
Clearly the warnings are false positives.
No need for a repro. I'll address this when I have some time. Thanks again!
Issue is fixed - thank you for reporting it @phallot
Hello,
When building 1.3.11 (and below) with Clang-15's "thread-safety-analysis" option, there are some warnings reported.
At a quick glance, they look like false positives to me, but it might be worth a look? Also maybe there is a way to satisfy/silence them?
Thanks.