[Rd] Segfault in setMask in R 4.1

Mike Lee Williams m|ke @end|ng |rom m|ke@p|@ce
Tue Sep 21 06:35:29 CEST 2021


I have inherited a build of R. We compile R from source and then use a custom
web application to allow users to enter R statements and render the output (it's
kind of like RStudio although the UX is quite different).

Things were going fine until I tried to upgrade to R 4.1.x. The build succeeds,
but I get the following segfault when I make qplot (ggplot2) calls:

     *** caught segfault ***
    address (nil), cause 'memory not mapped'

    Traceback:
     1: .setMask(NULL, NULL)
     2: resolveMask.NULL(NULL)
     3: (function (path) {    UseMethod("resolveMask")})(NULL)
     4: grid.newpage()
     5: print.ggplot(x)
     6: (function (x, ...) UseMethod("print"))(x)

I am not an R developer, so I don't really know how to read this. I am wondering
if this is a known issue or if anyone has any suggestions. Here's some things
I've tested:

- I get the same segfault in R 4.1.0 and R 4.1.1. I do not get this error in R
  4.0.4 or R 4.0.5.

- The problem appears to be specific to the (graphics?) features of R that
  ggplot2 uses. I do not get a segfault if I do a generic `plot(c(1,2,3))`.

- I have tried versions of ggplot2 3.3.3 and 3.3.5.

- The traceback points to files that were introduced in this commit
  https://github.com/wch/r-source/commit/16755bcddffe0cb4238d8a4979387d92b93a8324#diff-5c63f74229830cdde7886a50bf06dafcdf1d5b3d42cfa06b26814876e58c5ab0

I am not an R user or R developer so I'm a bit stuck here. I would be happy to
give the output of any commands. If anyone has any suggestions then please let
me know!

Thanks!
Mike Lee Williams



More information about the R-devel mailing list