Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThreadSanitizer issue in parallel_any_of #469

Open
jdumas opened this issue Dec 22, 2023 · 2 comments
Open

ThreadSanitizer issue in parallel_any_of #469

jdumas opened this issue Dec 22, 2023 · 2 comments

Comments

@jdumas
Copy link

jdumas commented Dec 22, 2023

The following line:
https://github.com/embree/embree/blob/be0accfd0b246e2b03355b8ee7710a22c1b49240/common/algorithms/parallel_any_of.h#L24
is causing ThreadSanitizer to be unhappy when I run some unit tests with Embree, due to a concurrent writes to the same local variable. Even though it won't change the result, I suggest changing this to an atomic bool or an atomic flag to make Thread Sanitizer happy.

If it's any help, here is the TSan stack trace I obtained when testing (I tried with Embree 3.13.5, but the latest version has the same issue): tsan_log.txt

@dopitz
Copy link
Contributor

dopitz commented Jan 10, 2024

Hi, this should be fixed with changing ret to an atomic_bool and is included in the next embree release.

Could you elaborate a bit what exactly you did in your testing? We might want to include that into our CI as well.

@jdumas
Copy link
Author

jdumas commented Jan 10, 2024

Sure. I don't have a MWE, but the code that produced the stack trace above is coming from this unit test. It seems that a call to rtcCommitScene() was enough to trigger TSan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants