Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up
After much investigation and the help of some R-Core members, it turns out that the seemingly-
random errors we've had on R-devel were caused by a race condition in the pool package.
Specifically, the NaiveScheduler's
executeTasksmethod could get invoked by a this finalizer when running the sameexecuteTasksmethod. The error can be triggered reliably by inserting agc()in the middle ofexecuteTasks().If a
gc()is inserted right after line 74, I reliably get this output, on R 3.3.3 and R-devel:The problem is that there's a window of time between when the counter used by
protectis decremented and when it enters anotherprotectblock. If the finalizer fires in that window (as we did explicitly with thegc()above), then bad things can happen.