Preview build looses contact to rsession

I am using RStudio preview builds (currently 1.2.1330) on Debian stable. It happens regularly that the IDE "looses contact" to its rsession, even though it is still running:


ralf@pc-ralf:~$ ps aux | grep rstudio
ralf      1617  2.6  1.3 2981200 209972 ?      Sl   10:56   0:23 /usr/lib/rstudio/bin/rstudio
ralf      1659  0.7  0.8 880456 140944 ?       Sl   10:56   0:06 /usr/lib/rstudio/bin/rsession --config-file none --program-mode desktop --www-port 37041 --launcher-token F7219E78 --show-help-home 1
ralf      1667  0.0  0.2 355488 39008 ?        S    10:56   0:00 /usr/lib/rstudio/libexec/QtWebEngineProcess --type=zygote --webengine-schemes=qrc:sLV --lang=de
ralf      1683  4.4  1.1 1605600 177964 ?      Sl   10:56   0:38 /usr/lib/rstudio/libexec/QtWebEngineProcess --type=renderer --disable-gpu-memory-buffer-video-frames --enable-threaded-compositing --enable-viewport --use-gl=desktop --enable-features=AllowContentInitiatedDataUrlNavigations --disable-features=MojoVideoCapture,SurfaceSynchronization,UseVideoCaptureApiForDevToolsSnapshots --disable-databases --service-pipe-token=13950268544339367993 --lang=de --webengine-schemes=qrc:sLV --num-raster-threads=2 --enable-main-frame-before-activation --service-request-channel-token=13950268544339367993 --renderer-client-id=3 --shared-files
ralf      2551  0.0  0.0  12780   988 pts/0    S+   11:10   0:00 grep rstudio

In the IDE some panes no longer update. And when I try to quit the IDE, a never ending Quitting R session ... appears. Killing the rsession from the commandline helps.

Any idea what might be the reason and how to avoid this? Any way to debug this further?

This might imply that the underlying rsession process is freezing or hanging for some reason. Are you able to reliably reproduce the issue?

Some diagnostics that might be helpful:


Can you provide us with the RStudio request log? You can try pressing:

Ctrl + `

within the IDE session. You should then see a log of the requests made by RStudio to the underyling R session. A screenshot of this could be helpful in diagnosing your issue.


Can you provide us with a GDB stack trace? You should be able to generate one with the following steps.

First, close any running instances of RStudio, and then launch a new lone RStudio instance.

Then, in a terminal, start GDB and have it attach to RStudio. You should be able to do this with:

sudo gdb -p `pidof rsession`

If you do not have the pidof utility installed, you can run Sys.getpid() in your R session to get the session's process ID.

After this, GDB should (hopefully) successfully attach to the process. Next, we'll instruct GDB to log to a file:

set logging file rstudio.log
set logging on

Finally, we'll tell GDB to let RStudio continue running:

continue

Now, return to your RStudio session and try running the code that triggers the hang. Once the R session is hanging, try pressing Ctrl + C in the GDB terminal to interrupt R, and then execute:

backtrace

You should now be able to quit GDB with

quit

and then make the file at 'rstudio.log' available to us for further inspection. With luck, we'll see something 'obvious' going on.


Can you provide us with an strace? This will print output on the various system calls made by RStudio. This can be done with:

sudo strace -fttT -p `pidof rsession` > rstudio.log

Note that the strace command will emit a very large amount of output to the file. If we're diagnosing a hang or a crash, we might be able to learn something from the last ~100 entries in the file. For more complicated behaviors, the whole trace may yet provide useful information.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

Unfortunately I have not discovered a way to trigger this reliably. But I will try to gather as much diagnostic information as possible. Interestingly, it has not happened since I posted this message ... :wink: