RStudio crashes when rendering plot using Cairo backend in Windows 10

I recently updated R to v 4.1.0. Since then RStudio crashes whenever trying to display a plot using the Cairo backend (ie in Tools > Global Options > General > Graphics). Plots work fine if I change the backend to default or Windows or AGG.

I have tried uninstalling all versions of R, rtools, and RStudio, deleting all packages, and reinstalling, but the issue remains.

I've very confused and the error message doesn't give me much to go on. Any advice would be much appreciated. Thanks.

# causes crash
ggplot(mtcars, aes(mpg, qsec)) +

# Crash message is:
# R Session Aborted
# R Encountered a fatal error
# The session was terminated
> version
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
major          4                           
minor          1.0                         
year           2021                        
month          05                          
day            18                          
svn rev        80317                       
language       R                           
version.string R version 4.1.0 (2021-05-18)
nickname       Camp Pontanezen 
> capabilities()
       jpeg         png        tiff       tcltk         X11        aqua    http/ftp     sockets      libxml        fifo 
       TRUE        TRUE        TRUE        TRUE       FALSE       FALSE        TRUE        TRUE        TRUE        TRUE 
     cledit       iconv         NLS       Rprof     profmem       cairo         ICU long.double     libcurl 
       TRUE        TRUE        TRUE        TRUE        TRUE        TRUE        TRUE        TRUE        TRUE 

Details from the RStudio logs, but there are loads of this error going back months and I don't think it's related:

ERROR system error 10053 (An established connection was aborted by the software in your host machine) [request-uri: /events/get_events]; OCCURRED AT void __cdecl rstudio::session::HttpConnectionImpl::sendResponse(const class rstudio::core::http::Response &) src/cpp/session/http/SessionWin32HttpConnectionListener.cpp:113; LOGGED FROM: void __cdecl rstudio::session::HttpConnectionImpl::sendResponse(const class rstudio::core::http::Response &) src/cpp/session/http/SessionWin32HttpConnectionListener.cpp:118

Updating to the preview of RStudio seems to have fixed the problem. I went into windows debugger and there was something about a null pointer exception trying to point to winCairo.dll, but I was a bit out of my depth.

This topic was automatically closed 7 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.