[R] R's unfortunate treatment of X11 failures

Adam D. I. Kramer adik at ilovebacon.org
Mon Apr 19 09:38:47 CEST 2010


Hi,

 	I use R in a terminal environment on a linux box, using X11 for
graphics, often tunnelled to the terminal I'm using.  When an internet
connection dies (say, if the ssh connection dies when forwarding), R usually
gives a scary warning like "Error: X11 fatal IO error: please save work and
shut down R." That's all well and good.

 	Then, if I ignore it and try to plot() something, R dies quite
ungracefully, producing (e.g.) something like this:

R: ../../src/xcb_io.c:385: _XAllocID: Assertion `ret != inval_id' failed.
Aborted

...and returning me to the shell. If I have not saved, I have lost my work.

Clearly, this is my fault--I ignored the warning. However, I just had the
above happen to me without my being warned...I lost some data, but not a
lot.  I am working on creating a reproducible case currently.

That said, in the meantime, I would suggest a broader fix. I'm sure we can
agree that R aborting due to failed assertions like this are pretty
unfortunate.  In the case of X11 failures like this, however, there is an
alternative: Print an error message and take a preventative action.

"Error: X11 fatal IO error: X11 device disabled." ...and then call dev.off().

Indeed, if I just run dev.off() when I see this error, nothing about R seems
corrupt at all.  I can start a new X11 window with, X11("localhost:10") and
things (such as plotting) function fine.

Cordially,
Adam



More information about the R-help mailing list