Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault during installation of gWidgets2tcltk extension in R 4.0.x easyconfigs when fonts are missing on system #11917

Open
zao opened this issue Dec 21, 2020 · 6 comments

Comments

@zao
Copy link
Contributor

zao commented Dec 21, 2020

The installation for gWidgets2tcltk is run via xvfb-run and crashes with a segmentation fault like this if run standalone:

* installing *source* package ‘gWidgets2tcltk’ ...
** package ‘gWidgets2tcltk’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** demo
** inst
** byte-compile and prepare package for lazy loading

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

Traceback:
 1: structure(.External(.C_dotTclObjv, objv), class = "tclObj")
 2: .Tcl.objv(.Tcl.args.objv(...))
 3: tcl("font", "measure", "TkTextFont", "0")
 4: tclvalue(tcl("font", "measure", "TkTextFont", "0"))
 5: eval(exprs[i], envir)
 6: eval(exprs[i], envir)
 7: sys.source(codeFile, env, keep.source = keep.source, keep.parse.data = keep.parse.data)
 8: doTryCatch(return(expr), name, parentenv, handler)
 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
10: tryCatchList(expr, classes, parentenv, handlers)
11: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {        if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)        dcall <- deparse(call)[1L]        prefix <- paste("Error in", dcall, ": ")        LONG <- 75L        sm <- strsplit(conditionMessage(e), "\n")[[1L]]        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")        if (is.na(w))             w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],                 type = "b")        if (w > LONG)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "Error : "    msg <- paste0(prefix, conditionMessage(e), "\n")    .Internal(seterrmessage(msg[1L]))    if (!silent && isTRUE(getOption("show.error.messages"))) {        cat(msg, file = outFile)        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))})
12: try(sys.source(codeFile, env, keep.source = keep.source, keep.parse.data = keep.parse.data))
13: loadNamespace(package = package, lib.loc = lib.loc, keep.source = keep.source,     keep.parse.data = keep.parse.data, partial = TRUE)
14: withCallingHandlers(expr, packageStartupMessage = function(c) tryInvokeRestart("muffleMessage"))
15: suppressPackageStartupMessages(loadNamespace(package = package,     lib.loc = lib.loc, keep.source = keep.source, keep.parse.data = keep.parse.data,     partial = TRUE))
16: code2LazyLoadDB(package, lib.loc = lib.loc, keep.source = keep.source,     keep.parse.data = keep.parse.data, compress = compress, set.install.dir = set.install.dir)
17: tools:::makeLazyLoading("gWidgets2tcltk", "/import/easybuild/amd64_ubuntu1604_cfl/software/R/4.0.3-foss-2020b/lib/R/library/00LOCK-gWidgets2tcltk/00new",     keep.source = FALSE, keep.parse.data = FALSE, set.install.dir = "/import/easybuild/amd64_ubuntu1604_cfl/software/R/4.0.3-foss-2020b/lib/R/library/gWidgets2tcltk")
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault (core dumped)
ERROR: lazy loading failed for package ‘gWidgets2tcltk’

See #11663 (comment) for the error when run as part of an EB build of R/4.0.3.

If I installed xterm on the system (with a fair number of dependencies) the installation of gWidgets2tcltk suddenly succeeds. The package that tipped the scales into working was fonts-dejavu-core, implying that something in the build hard-requires some sort of font presence.

@boegel boegel added this to the next release (4.3.3?) milestone Dec 21, 2020
@boegel boegel changed the title gWidgets2tcltk of R/4.0.3 cannot install without fonts on system segfault during installation of gWidgets2tcltk extension in R 4.0.x easyconfigs when fonts are missing on system Dec 21, 2020
@zao
Copy link
Contributor Author

zao commented Dec 21, 2020

Additionally, on my system xvfb-run requires use of the -a argument to start at all.

@akesandgren
Copy link
Contributor

fonts-dejavu-core installed solved the problem, no need for any other X-package.

@robert-mijakovic
Copy link
Contributor

robert-mijakovic commented Mar 6, 2021

While working on a new R release, R-4.0.4, I have experienced probably a related issue that didn't result in the seg fault.

* installing *source* package gWidgets2tcltk ...
** package gWidgets2tcltk successfully unpacked and MD5 sums checked
** using staged installation
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") :
  [tcl] failed to allocate font due to internal system font engine problem.

Error: unable to load R code in package gWidgets2tcltk
Execution halted
ERROR: lazy loading failed for package gWidgets2tcltk

I will try to install the missing package. Let's see does this fixes the issue.
EDIT:
I have found that a similar issue happens in other packages, for PDE it is reported under section "Error when starting interactive user interface on Mac (failed to allocate tcl font)". However, the issue in my case happens on CentOS 8.3.
https://cran.r-project.org/web/packages/PDE/readme/README.html

@MohammadAliAmir
Copy link

This error indeed gets solved by installing the dejavu font packages. Note: it is better to install more of them to ensure you have the correct packages. For CentOS 7, I installed the following packages:
yum install bpg-dejavu-sans-fonts dejavu-fonts-common dejavu-lgc-sans-fonts dejavu-lgc-sans-mono-fonts dejavu-lgc-serif-fonts dejavu-sans-fonts dejavu-sans-mono-fonts dejavu-serif-fonts -y

@asadstat
Copy link

no DISPLAY variable so Tk is not available
Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") :
[tcl] invalid command name "font".
Error: unable to load R code in package ‘gWidgets2tcltk’
Execution halted

  • installing to library ‘/opt/R/4.3.1/lib/R/library’
  • installing source package ‘gWidgets2tcltk’ ...
    ** package ‘gWidgets2tcltk’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** demo
    ** inst
    ** byte-compile and prepare package for lazy loading
    ERROR: lazy loading failed for package ‘gWidgets2tcltk’
  • removing ‘/opt/R/4.3.1/lib/R/library/gWidgets2tcltk’## End Task Log ################################################################
    Error: Unhandled Exception: Child Task 1344071821 failed: Error building image: Error building gWidgets2tcltk (1.0-8). Build exited with non-zero status: 1
    Execution halted

@asadstat
Copy link

how can i solve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants