Rdatatable / Rdatatable/data.table
Multiple threads error in MAC: protect(): protection stack overflow
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 3.9k
- Forks
- 1.1k
- Avg merge
- 14h 4m
- Merged PRs (30d)
- 4
Description
Following the installation guide for Mac users, I've installed data.table package to support multiple threads computing.
When I run the following code:
data[, lag.lct := shift(mark, n = 1, type = "lag"), by = h.id]
an error like this occurs Error: protect(): protection stack overflow.
The data above has over 5m rows. If I split the data into a subset with about 1m rows, the error will not be reported.
But when I remove data.table and reinstall it without OpenMP enabled compiler setting which means data.table can only run in single thread mode, the code above can work well even for the full data with 5m rows. I've no idea if this error has to do with the multiple thread setting.
# Output of sessionInfo()
R version 4.1.2 (2021-11-01) -- "Bird Hippie"
System Version: macOS 12.0.1
Platform: x86_64-apple-darwin17.0 (64-bit)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by reproducing the shift operation on the reported macOS and R versions with OpenMP enabled, then compare it with the single-threaded build. Done means identifying whether multithreading causes the protection-stack overflow and adding an appropriate regression test or documented resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100