R session crashes on running ggplot with popup message "Previous R session was abnormally terminated"

I have Rstudio Server running on Ubuntu 20 machine.
For last few days any ggplot command line execution crashes the R session with following alert:


Even after a fresh restart
and without sourcing any of my code, just running

ggplot2::ggplot(data = data.frame(x = 1:10,y=1:10))

will crash R.

Update: Got a long chain of bug reports in Rstudio and the solution I unserstand (from the rstudio community thread) is either downgrade R or use preview version of Rstudio.

Interestingly plot function works fine.
And also ggplot works fine inside rmarkdown.

I suspect something to do with Rmarkdown display clash.

Adding the session info:

>sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.8         coin_1.4-2         codetools_0.2-18   lattice_0.20-45   
 [5] matrixStats_0.61.0 mvtnorm_1.1-3      zoo_1.8-9          MASS_7.3-55       
 [9] plyr_1.8.6         grid_4.1.2         stats4_4.1.2       multcomp_1.4-18   
[13] strucchange_1.5-2  party_1.3-9        Matrix_1.4-0       sandwich_3.0-1    
[17] TH.data_1.1-0      splines_4.1.2      tools_4.1.2        yaml_2.3.5        
[21] survival_3.2-13    parallel_4.1.2     compiler_4.1.2     libcoin_1.0-9     
[25] modeltools_0.2-23 

ALso adding device info, if that helps.

plot(1:10, 1:10) # this shows a plot successfully
> dev.list()

RStudioGD png
2 3

What version of RStudio are you using, this would only be the case if you are using a very old RStudio version.

My Rstudio Server (open source edition) version is: 1.4.1106
How do we check what is the latest version? I actually always google it and land up at very complicated pages and then abandon the search. Current search gave me this version from here: v2022.02.0+443 and this does not resemble remotely the version I have.

Problem Solved.
Installed latest Rstudio Version by
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.02.0-443-amd64.deb
No need to downgrade R.

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.