Problems installing R 4.2.0 on macOS 12.3.1 Intel

After installing R 4.2.0, XQuartz, and all my packages, I got the following error message when I restarted RStudio:

R encountered a fatal error.
The session was terminated.

When I started the R.app, I got the following error message:

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

Traceback:
1: initMethodDispatch(where)
2: fun(libname, pkgname)
3: doTryCatch(return(expr), name, parentenv, handler)
4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
5: tryCatchList(expr, classes, parentenv, handlers)
6: tryCatch(fun(libname, pkgname), error = identity)
7: runHook(".onLoad", env, package.lib, package)
8: loadNamespace(package, lib.loc)
9: doTryCatch(return(expr), name, parentenv, handler)
10: tryCatchOne(expr, names, parentenv, handlers[[1L]])
11: tryCatchList(expr, classes, parentenv, handlers)
12: tryCatch({ attr(package, "LibPath") <- which.lib.loc pos = pos, deps, exclude, include.only)}, error = function(e) { deparse(cc)[1L]) else "" msg <- gettextf("package or namespace load failed for %s%s:\n %s", sQuote(package), P, ns <- loadNamespace(package, lib.loc) P <- if (!is.null(cc <- conditionCall(e))) paste(" in", conditionMessage(e)) = FALSE, domain = NA)})
13: library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, warn.conflicts = warn.conflicts, quietly = quietly, mask.ok = mask.ok, exclude = exclude, include.only = include.only, attach.required = attach.required)
14: doTryCatch(return(expr), name, parentenv, handler)
15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
16: tryCatchList(expr, classes, parentenv, handlers)
17: tryCatch(library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, warn.conflicts = warn.conflicts, quietly = quietly, mask.ok = mask.ok, exclude = exclude, include.only = include.only, attach.required = attach.required), error = function(e) e)
18: require(pkg, quietly = TRUE, warn.conflicts = FALSE, character.only = TRUE)
19: .OptRequireMethods()

I got no error message when I just started with the base and recommended packages included in the installation of a 'clean' R 4.2.0. It turned out that the packages tibbles and rmarkdown were generating my error messages. Copying these packages from my R 4.1.3 version did not work.

Could it be that there is something wrong with my version of XCode (13.3.1) or gfortran (GNU Fortran (GCC) 11.2.0)? The CRAN page says that R 4.2.0 "uses Xcode 12.4 and GNU Fortran 8.2".

Returning via RSwitch to my R version 4.1.3 works smoothly with RStudio and all packages. Starting the standalone R.app results in the reported error. Starting RStudio with R version 4.2.0 without tibbles and rmarkdown is also working.

Any idea what's wrong with my installation?

macOS Monterey 12.3.1, on an Intel MacBook Pro (13-inch, 2020)

After reinstalling everything from scratch, the new installation of R 4.2.0 worked! The difference to my previous (failed) attempt: I deleted the R.app manually. When macOS asked if I wanted to delete any associated files, I said yes.

I think your problem was that the new R installation was trying to use your old package library (maybe because a startup file you forgot you have) and packages have to be compiled for an specific major R version in order to work.

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.