-
Notifications
You must be signed in to change notification settings - Fork 6
terminate called without an active exception #61
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
Comments
I created a docker image with CentOS 7 and gcc 11.1.0, but can neither reproduce the error locally nor with github actions. Is there any other (potentially) useful information about your machines? Does the error appear also with empty loop body or when manually setting up a |
Thanks for helping out. Something which I probably should have mentioned is that the user who reported this was running the code on an HPC, and I reproduced it in my institutions cluster. Perhaps that was not a coincidence. Here's some info about the cpu of the node I'm reproducing these crashes in:
Also, I did as you suggested and tried setting up a
Turning off optimization, the backtrace shows a little bit more info, but I'm not sure whether this will be helpful still:
Thanks again for helping. Please let me know what else I can provide/do. |
OK thanks! I have a suspicion, could you try with |
That did it! I can confirm both the |
OK so the issue that RcppThread now sets thread affinity on Linux by default. That means that each thread in the pool gets pinned to a logical core to avoid scheduling overhead. This seems to fail on the clusters that you're working on. I can of course disable this again, but I'm still thinking about better ways to do this. Just to rule out a very simple problem, could you report the results of Rcpp::cppFunction('void func() {
Rcpp::Rcout <<
"std::thread::hardware_concurrency(): " <<
std::thread::hardware_concurrency() <<
std::endl;
cpu_set_t cpuset;
Rcpp::Rcout << "sizeof(cpuset) / 32: " << sizeof(cpuset) / 32 << std::endl;
}', depends = "RcppThread", plugins = "cpp11")() |
Certainly.
|
OK there's a chance that we're trying to pin threads to cores that are not actually made available to us by the OS. If that's the case, I might have a workaround. Could you install the new version from remotes::install_github("tnagler/RcppThread", ref = "no-affinity") and try again? |
Everything seems to be working, no crashes! |
That's great, thanks for all the help! An updated version will go on CRAN some time this month. |
Fantastic, thanks a lot! And sorry for not mentioning that HPC/cluster information sooner, hopefully I didn't waste too much of your time chasing down a non-existent CentOS bug. |
No worries, I'm very happy that this turned out to be much easier to find/solve than I feared :) And now I also have a testing setup for CentOS, which can't hurt. |
fixed by #62 |
Updated version is on its way to CRAN. |
Hi,
Thanks for the great package. Recently someone trying out one of my packages (which makes use of RcppThread) had R crash whenever they invoked a function which made use of
RcppThread::parallelFor
, with only this message:terminate called without an active exception
. This error appears to be setup-specific, as I have been able to replicate the error on CentOS 7 (same as what the person who reported this me was using) with gcc 11.1.0, but not any other system I have access to. The following minimal example is enough to trigger the crash:Running R with gdb, I can see the following backtrace:
Unfortunately this is a bit beyond me. I'm not sure exactly what could be going wrong.
Walking back the commits, the last working one is 8725ca8; all future commits cause the crash (well except e6ab09d, as I get error during the compilation process).
If you don't have access to a similar system that can recreate the crash then please let me know if there is anything I do to provide more information. Here is my session info:
The text was updated successfully, but these errors were encountered: