-
Notifications
You must be signed in to change notification settings - Fork 59
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
TBB memory bug #77
Comments
OK, I closed the issue earlier because the previous example did not illustrate my point. The memory error only occurs when the code is compiled as a shared library and linked to runtimes. As developers who extensively write and link C++ libraries to R and Python, we face an additional layer of complexity. I am now more certain that the problem lies with TBB. I have cleaned and reduced the example to the following:
I hope the authors can confirm and resolve this issue:) Our entire system is built on parlay and TBB. We prefer not to abandon TBB, as it serves as the backend for the C++ parallel STL, which includes parallelized algorithms not available in parlay Thank you! |
Hi parlay maintainers, there seems to be an evasive bug in the integration of parlay and TBB that took me a painful amount of time to catch. The following is a minimal reproducible example:
After compiling the code with the following command
g++ -std=c++20 -Ofast -DPARLAY_TBB -ltbb bug.cpp -o bug
and run
for i in {1..1000}; do ./bug 1 1 1 1 12 1 1 2 2 4 3; done
You should be able to see nondeterministic result varying around the true answer "77".
If we change
vec<int> parent;
tostd::vector<int> parent;
, everything works fine.If we switch to parlay's default thread scheduler, i.e.
g++ -std=c++20 -Ofast -pthread bug.cpp -o bug
, everything also works fine.I tested both the latest oneAPI/tbb and an older version. The problem remains the same.
When the code is compiled as a shared library and linked to runtimes, segmentation fault will pop.
Could you help check if the bug is reproducible and provide some assistance?
The text was updated successfully, but these errors were encountered: