You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RStudio hangs indefinitely when background .rs.getPackageInformation() process stalls (rsession waiting in __wait4) #19835
RStudio Edition : Desktop
RStudio Version : Version 2026.11.0+203 (2026.11.0+203)
OS Version : macOS 27.2.1 (Apple Silicon, arm64)
R Version : 4.6.2
(The RStudio log warns that R 4.6.2 is newer than the maximum tested version, 4.6.1; this warning appeared all day while everything worked normally, so I don't think it is the cause.)
Steps to reproduce the problem
I can't give a reliable recipe. It started during a normal working day on a bookdown project:
Building a bookdown book (Build Book, bookdown::pdf_book) many times during the day with no problems.
Stopped one build part-way through. Around then, the rsession log began repeating, every 10 seconds:
"WARNING File monitor events were dropped or coalesced; rescanning /Users/pdunn2/GitProjects/DistTheory"
From then on, RStudio's R session became unresponsive: the Console accepted no input (even 1+1), Session > Terminate R did nothing, and the Build Book button did nothing.
Restarting RStudio did not help. After a restart the project and files opened, but an "R Markdown..." spinner never finished, and the Console stayed unresponsive.
Running the same build from Terminal with Rscript worked fine throughout.
Describe the problem in detail
Sampling the hung rsession (sample <pid> 5, attached) shows the main thread blocked in __wait4, i.e. waiting for a child process. The only child process was a background R started by RStudio:
This child sat at 0% CPU and never finished. rsession waited for it indefinitely, so the whole IDE (Console, Build pane, R Markdown check) was blocked with no message to the user. Once that child process ended, RStudio immediately recovered and Build Book worked again.
I don't yet know which package caused the child process to stall (rgl is a possibility on macOS).
Describe the behavior you expected
If the background package-information process stalls, rsession should time out (or run it asynchronously) rather than blocking the whole session, and ideally show a message. At present the IDE simply freezes with no indication of the cause, and the only fix is finding and killing the child process from a terminal.
(The RStudio log warns that R 4.6.2 is newer than the maximum tested version, 4.6.1; this warning appeared all day while everything worked normally, so I don't think it is the cause.)
Correct, this can be ignored. It goes away in the 2026.12 RStudio release via #19581.
Thanks for the sample -- it shows where the session is stuck. The main thread is waiting on pandoc, not on the package-information process: RStudio's bookdown cross-reference indexer runs pandoc over each changed chapter, and the session was blocked waiting for one of those runs. The .rs.getPackageInformation() process runs in the background; it sat at 0% CPU because nothing was reading its output while the main thread was blocked.
What I can't explain yet is why that wait never finished, and why ending the R process released it. I can reproduce exactly that only when something in the R session has set child-exit notifications (SIGCHLD) to be ignored, which neither RStudio nor base R does. Could you check:
In the RStudio console, in that project after a fresh start, run system("true"). It should return 0 silently. A warning like "system call failed: No child processes" would confirm the condition.
What does loadedNamespaces() print right after startup, and do you have a ~/.Rprofile or a project .Rprofile?
Could you attach the rsession log from around the time of the hang (Help > Diagnostics > Show Log Files)?
If it hangs again, before ending anything, please run in Terminal: ps -axo pid,ppid,stat,%cpu,etime,command | grep -E "rsession|pandoc|exec/R"
and, for each child of rsession-arm64, lsof -p <pid> and sample <pid> 5.
Your chapters index in well under a second each with the same pandoc filter here, so the book's content doesn't look like the trigger.
Activity
gtritchie commentedon Nov 30, 2026
Correct, this can be ignored. It goes away in the 2026.12 RStudio release via #19581.
kevinushey commentedon Nov 30, 2026
Thanks for the sample -- it shows where the session is stuck. The main thread is waiting on pandoc, not on the package-information process: RStudio's bookdown cross-reference indexer runs pandoc over each changed chapter, and the session was blocked waiting for one of those runs. The
.rs.getPackageInformation()process runs in the background; it sat at 0% CPU because nothing was reading its output while the main thread was blocked.What I can't explain yet is why that wait never finished, and why ending the R process released it. I can reproduce exactly that only when something in the R session has set child-exit notifications (SIGCHLD) to be ignored, which neither RStudio nor base R does. Could you check:
system("true"). It should return 0 silently. A warning like "system call failed: No child processes" would confirm the condition.loadedNamespaces()print right after startup, and do you have a~/.Rprofileor a project.Rprofile?ps -axo pid,ppid,stat,%cpu,etime,command | grep -E "rsession|pandoc|exec/R"and, for each child of
rsession-arm64,lsof -p <pid>andsample <pid> 5.Your chapters index in well under a second each with the same pandoc filter here, so the book's content doesn't look like the trigger.