Rstudio crashs on macOS with the X11 cairo type window


#1

Hello, I met a fatel error with the latest Rstudio v1.1.423 with R 3.4.4 on macOS High Sierra. It came out a fatal error with the following X11 command and crashed.

X11(width=7 , height=7, type="cairo")

It works fine with

X11(width=7 , height=7)

I am not sure what is wrong here.


#2

Welcome to rstudio community.

Could you rewrite your post (how to edit a post) so it's a reproducible example reprex? It'd be great to see the full error.

Did you have a look at the documentation for grDevices::X11? It says "This can only be done on machines/accounts that have access to an X server." Not my area of expertise, but I think macOS uses a different windowing system.

Though, it sounds like your issue has something to the documentation under type,

type - character string, one of "Xlib", "cairo", "nbcairo" or "dbcairo". Only the first will be available if the system was compiled without support for cairographics. The default is "cairo" where available except on macOS, otherwise "Xlib"."


#4

I'm pretty sure Cairo is an external dependency on Mac—I had to install it a while ago in order to run some functions in grid that require it. I installed it using Homebrew (brew install cairo). I didn't have any problem running X11() with type = 'cairo', so I'm guessing that's your problem :slight_smile:


#5

I know that cairo is a external software. I have installed it on Mac. I checked the capabilities() output. Both X11 and Cairo are True. I have no idea what else I can do.


#6

I read that part of document. The reason I think it may relate to the Rstudio IDE is that the command crashed the Rstudio session rather than a simple warning or error message. Anyway, I changed the category from Rstudio IDE to General.


#7

Ah! Sorry for the presumption. Have you tried opening a Cairo X11 window from a straight R session (without RStudio)?


#8

Sorry, I did not try it before as I did not know how to open R without Rstudio. It seems it also crashed the straight R session.

 *** caught segfault ***
address 0xffffffffeac8ef0c, cause 'memory not mapped'

Traceback:
 1: X11(width = 7, height = 7, type = "cairo")

So it is not the problem of the Rstudio.


#9

Yeah, I'm not sure how much help I can be with this, sorry! :sweat_smile: Hopefully one of the RStudio staff or one of the more knowledgeable folks might be able to provide some insight :slight_smile:


#10

Actually, maybe this bug is the problem!

If I understand correctly (and I may not), parts of the R Cairo interface (or maybe the whole thing) are packaged with R, which is why you often don't need to actually install the Cairo R package just to use Cairo with plots.

That said, you could try running install.packages('Cairo') and seeing if that does the trick. (Or, if it doesn't, maybe install.packages('Cairo', type = 'source').