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

Installation problems on Ubuntu 18.04.5 #117

Closed
mbojan opened this issue Jan 26, 2021 · 41 comments
Closed

Installation problems on Ubuntu 18.04.5 #117

mbojan opened this issue Jan 26, 2021 · 41 comments

Comments

@mbojan
Copy link

mbojan commented Jan 26, 2021

I'm getting:

Installing package gert using 3 cores
Installing package into ‘/home/mbojan/R/library/x86_64-pc-linux-gnu/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/gert_1.1.0.tar.gz'
Content type 'application/x-gzip' length 67224 bytes (65 KB)
==================================================
downloaded 65 KB

* installing *source* package ‘gert’ ...
** package ‘gert’ successfully unpacked and MD5 sums checked
** using staged installation
> curl::curl_download("http://r-lib.github.io/gert/get-libgit2-linux.sh","get-libgit2-linux.sh")
> 
> 
> curl::curl_download('http://r-lib.github.io/gert/libgit2-1.1.0.x86_64_linux.tar.gz','bundle.tar.gz')
> 
> 
Using static libgit2-1.1.0 for Linux x86_64
Using PKG_CFLAGS=-DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include
Using PKG_LIBS=-L/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/lib -lgit2 -lrt -lpthread -lssh2 -lssl -lcrypto -ldl -lpcre -lz
Configuration OK!
** libs
rm -f gert.so branch.o clone.o commit.o config.o conflicts.o files.o init.o merge.o rebase.o stash.o submodules.o tag.o utils.o version.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c branch.c -o branch.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c clone.c -o clone.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c commit.c -o commit.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c config.c -o config.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c conflicts.c -o conflicts.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c files.c -o files.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c merge.c -o merge.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c rebase.c -o rebase.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c stash.c -o stash.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c submodules.c -o submodules.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c tag.c -o tag.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utils.c -o utils.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c version.c -o version.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o gert.so branch.o clone.o commit.o config.o conflicts.o files.o init.o merge.o rebase.o stash.o submodules.o tag.o utils.o version.o -L/tmp/RtmpmI60IP/R.INSTALL7f10a9ed10a/gert/libgit2/lib -lgit2 -lrt -lpthread -lssh2 -lssl -lcrypto -ldl -lpcre -lz -L/usr/lib/R/lib -lR
installing to /home/mbojan/R/library/x86_64-pc-linux-gnu/4.0/00LOCK-gert/00new/gert/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location

 *** caught illegal operation ***
address 0x7f776c72145d, cause 'illegal operand'

Traceback:
 1: git_config_global()
 2: doTryCatch(return(expr), name, parentenv, handler)
 3: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 4: tryCatchList(expr, classes, parentenv, handlers)
 5: 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))})
 6: try({    settings <- git_config_global()    name <- subset(settings, name == "user.name")$value    email <- subset(settings, name == "user.email")$value    if (length(name) || length(email)) {        packageStartupInform("Default user: %s <%s>", as_string(name),             as_string(email))    }    else {        packageStartupInform("No default user configured")    }})
 7: fun(libname, pkgname)
 8: doTryCatch(return(expr), name, parentenv, handler)
 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
10: tryCatchList(expr, classes, parentenv, handlers)
11: tryCatch(fun(libname, pkgname), error = identity)
12: runHook(".onAttach", ns, dirname(nspath), nsname)
13: attachNamespace(ns, pos = pos, deps, exclude, include.only)
14: doTryCatch(return(expr), name, parentenv, handler)
15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
16: tryCatchList(expr, classes, parentenv, handlers)
17: tryCatch({    attr(package, "LibPath") <- which.lib.loc    ns <- loadNamespace(package, lib.loc)    env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)}, error = function(e) {    P <- if (!is.null(cc <- conditionCall(e)))         paste(" in", deparse(cc)[1L])    else ""    msg <- gettextf("package or namespace load failed for %s%s:\n %s",         sQuote(package), P, conditionMessage(e))    if (logical.return)         message(paste("Error:", msg), domain = NA)    else stop(msg, call. = FALSE, domain = NA)})
18: library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE)
19: withCallingHandlers(expr, packageStartupMessage = function(c) tryInvokeRestart("muffleMessage"))
20: suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,     character.only = TRUE, logical.return = TRUE))
21: doTryCatch(return(expr), name, parentenv, handler)
22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
23: tryCatchList(expr, classes, parentenv, handlers)
24: 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))})
25: try(suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,     character.only = TRUE, logical.return = TRUE)))
26: tools:::.test_load_package("gert", "/home/mbojan/R/library/x86_64-pc-linux-gnu/4.0/00LOCK-gert/00new")
An irrecoverable exception occurred. R is aborting now ...
Illegal instruction (core dumped)
ERROR: loading failed
* removing ‘/home/mbojan/R/library/x86_64-pc-linux-gnu/4.0/gert’
* restoring previous ‘/home/mbojan/R/library/x86_64-pc-linux-gnu/4.0/gert’

The downloaded source packages are in
	‘/tmp/RtmpqI6U8v/downloaded_packages’
Warning message:
In install.packages("gert") :
  installation of package ‘gert’ had non-zero exit status

while

apt-cache policy libgit2-dev
libgit2-dev:
  Installed: 0.27.7+dfsg.1-bionic0
  Candidate: 0.27.7+dfsg.1-bionic0
  Version table:
 *** 0.27.7+dfsg.1-bionic0 500
        500 http://ppa.launchpad.net/cran/libgit2/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status
     0.26.0+dfsg.1-1.1ubuntu0.2 500
        500 http://pl.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages
     0.26.0+dfsg.1-1.1build1 500
        500 http://pl.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
@mbojan mbojan changed the title Installation problems under 18.04.5 Installation problems under Ubuntu 18.04.5 Jan 26, 2021
@mbojan mbojan changed the title Installation problems under Ubuntu 18.04.5 Installation problems on Ubuntu 18.04.5 Jan 26, 2021
@jeroen
Copy link
Member

jeroen commented Jan 26, 2021

Yikes. Are you using the default gcc compiler? I'm not seeing this on my ubuntu 18.04 docker images.

@mbojan
Copy link
Author

mbojan commented Jan 26, 2021

I think so:

gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@jeroen
Copy link
Member

jeroen commented Jan 26, 2021

Are you running on any unusual hardware? Anything else that may give me a hint on what is different between your environment and my testing boxes?

@mbojan
Copy link
Author

mbojan commented Jan 26, 2021

It is HP 6450b laptop, nothing unusual. How can I debug this further?

@jeroen
Copy link
Member

jeroen commented Jan 26, 2021

So in the new version we are using a custom build of libgit2 instead of the system one. But that doesn't seem to work in your case. A workaround is to use this:

Sys.setenv(USE_SYSTEM_LIBGIT2=1)
install.packages("gert")

But I still want to understand why our binaries don't work on your system.

@mbojan
Copy link
Author

mbojan commented Jan 26, 2021

So in the new version we are using a custom build of libgit2 instead of the system one. But that doesn't seem to work in your case. A workaround is to use this:

Sys.setenv(USE_SYSTEM_LIBGIT2=1)
install.packages("gert")

Thanks for the workaround.

But I still want to understand why our binaries don't work on your system.

Sure. Let me know what do you need.

@jeroen
Copy link
Member

jeroen commented Jan 26, 2021

I've added some debug statements, could you maybe run this to see where it crashes:

remotes::install_github("r-lib/gert@debug")

@mbojan
Copy link
Author

mbojan commented Jan 26, 2021

I did the above installation with make -j3 but meanwhile tried without it and the results are the same. I'll try installing from the debug branch in a couple of hours.

@jeroen
Copy link
Member

jeroen commented Jan 26, 2021

Thanks. I don't think the make process is the culprit; it seems your build succeeds, but it crashes when trying to read the global config options on startup.

@sideburnie
Copy link

sideburnie commented Jan 26, 2021

Same issue on Ubuntu 20.04 and Debian 10, both about 8 year old X86 boxes. Tried installing r-cran-git2r, libgit2-dev, neither helped. The above Sys.setenv() did the trick. gcc (Debian 8.3.0-6) 8.3.0, and gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0.

@sideburnie
Copy link

sideburnie commented Jan 26, 2021

> remotes::install_github("r-lib/gert@debug")
Downloading GitHub repo r-lib/gert@debug
✔  checking for file ‘/tmp/RtmpYvIrJl/remotes3f71733b8fdb/r-lib-gert-99577ca/DESCRIPTION’ ...
─  preparing ‘gert’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  running ‘cleanup’
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘gert_1.1.0.tar.gz’
   
Installing package into ‘/home/user/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
Loading custom .Rprofile* installing *source* package ‘gert’ ...
Loading custom .Rprofile> curl::curl_download("http://r-lib.github.io/gert/get-libgit2-linux.sh","get-libgit2-linux.sh")
> 
> 
Loading custom .Rprofile> curl::curl_download('http://r-lib.github.io/gert/libgit2-1.1.0.x86_64_linux.tar.gz','bundle.tar.gz')
> 
> 
Using static libgit2-1.1.0 for Linux x86_64
Using PKG_CFLAGS=-DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include
Using PKG_LIBS=-L/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/lib -lgit2 -lrt -lpthread -lssh2 -lssl -lcrypto -ldl -lpcre -lz
Configuration OK!
** libs
rm -f gert.so branch.o clone.o commit.o config.o conflicts.o files.o init.o merge.o rebase.o stash.o submodules.o tag.o utils.o version.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c branch.c -o branch.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c clone.c -o clone.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c commit.c -o commit.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c config.c -o config.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c conflicts.c -o conflicts.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c files.c -o files.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c merge.c -o merge.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c rebase.c -o rebase.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c stash.c -o stash.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c submodules.c -o submodules.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c tag.c -o tag.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utils.c -o utils.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c version.c -o version.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-z,relro -o gert.so branch.o clone.o commit.o config.o conflicts.o files.o init.o merge.o rebase.o stash.o submodules.o tag.o utils.o version.o -L/tmp/RtmpX1OnHR/R.INSTALL41364503c42/gert/libgit2/lib -lgit2 -lrt -lpthread -lssh2 -lssl -lcrypto -ldl -lpcre -lz -L/usr/lib/R/lib -lR
installing to /home/user/R/x86_64-pc-linux-gnu-library/3.5/gert/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Loading custom .RprofileUSING certpath: /usr/lib/ssl/certs 
Running R_git_config_list...
Running git_config_open_default...

 *** caught illegal operation ***
address 0x7f0841df970d, cause 'illegal operand'

Traceback:
 1: git_config_global()
 2: doTryCatch(return(expr), name, parentenv, handler)
 3: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 4: tryCatchList(expr, classes, parentenv, handlers)
 5: tryCatch(expr, error = function(e) {    call <- conditionCall(e)  ...
 6: try({    settings <- git_config_global()  ...
 7: fun(libname, pkgname)
 8: doTryCatch(return(expr), name, parentenv, handler)
 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
10: tryCatchList(expr, classes, parentenv, handlers)
11: tryCatch(fun(libname, pkgname), error = identity)
12: runHook(".onAttach", ns, dirname(nspath), nsname)
13: attachNamespace(ns, pos = pos, deps)
14: doTryCatch(return(expr), name, parentenv, handler)
15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
16: tryCatchList(expr, classes, parentenv, handlers)
17: tryCatch({    attr(package, "LibPath") <- which.lib.loc  ...
18: library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE)
19: withCallingHandlers(expr, packageStartupMessage = function(c) invokeRestart("muffleMessage"))
20: suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,     character.only = TRUE, logical.return = TRUE))
21: doTryCatch(return(expr), name, parentenv, handler)
22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
23: tryCatchList(expr, classes, parentenv, handlers)
24: tryCatch(expr, error = function(e) {    call <- conditionCall(e)  ...
25: try(suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,     character.only = TRUE, logical.return = TRUE)))
26: tools:::.test_load_package("gert", "/home/user/R/x86_64-pc-linux-gnu-library/3.5")
An irrecoverable exception occurred. R is aborting now ...
Illegal instruction
ERROR: loading failed
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/3.5/gert’
* restoring previous ‘/home/user/R/x86_64-pc-linux-gnu-library/3.5/gert’
Error: Failed to install 'gert' from GitHub:
  (converted from warning) installation of package ‘/tmp/RtmpYvIrJl/file3f7113f01b48/gert_1.1.0.tar.gz’ had non-zero exit status

@mbojan
Copy link
Author

mbojan commented Jan 26, 2021

Here is my output:

> install_github("r-lib/gert@debug")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo r-lib/gert@debug
✔  checking for file ‘/tmp/RtmpRSBTcl/remotes107165bfc2cd/r-lib-gert-99577ca/DESCRIPTION’ ...
─  preparing ‘gert’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  running ‘cleanup’
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘gert_1.1.0.tar.gz’
   
Installing package into ‘/home/mbojan/R/library/x86_64-pc-linux-gnu/4.0’
(as ‘lib’ is unspecified)
* installing *source* package ‘gert’ ...
** using staged installation
> curl::curl_download("http://r-lib.github.io/gert/get-libgit2-linux.sh","get-libgit2-linux.sh")
> 
> 
> curl::curl_download('http://r-lib.github.io/gert/libgit2-1.1.0.x86_64_linux.tar.gz','bundle.tar.gz')
> 
> 
Using static libgit2-1.1.0 for Linux x86_64
Using PKG_CFLAGS=-DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include
Using PKG_LIBS=-L/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/lib -lgit2 -lrt -lpthread -lssh2 -lssl -lcrypto -ldl -lpcre -lz
Configuration OK!
** libs
rm -f gert.so branch.o clone.o commit.o config.o conflicts.o files.o init.o merge.o rebase.o stash.o submodules.o tag.o utils.o version.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c branch.c -o branch.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c clone.c -o clone.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c commit.c -o commit.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c config.c -o config.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c conflicts.c -o conflicts.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c files.c -o files.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c merge.c -o merge.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c rebase.c -o rebase.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c stash.c -o stash.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c submodules.c -o submodules.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c tag.c -o tag.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utils.c -o utils.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c version.c -o version.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o gert.so branch.o clone.o commit.o config.o conflicts.o files.o init.o merge.o rebase.o stash.o submodules.o tag.o utils.o version.o -L/tmp/RtmpZ8C9zS/R.INSTALL10cf49700dd7/gert/libgit2/lib -lgit2 -lrt -lpthread -lssh2 -lssl -lcrypto -ldl -lpcre -lz -L/usr/lib/R/lib -lR
installing to /home/mbojan/R/library/x86_64-pc-linux-gnu/4.0/00LOCK-gert/00new/gert/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
USING certpath: /usr/lib/ssl/certs 
Running R_git_config_list...
Running git_config_open_default...

 *** caught illegal operation ***
address 0x7f8df8b854fd, cause 'illegal operand'

Traceback:
 1: git_config_global()
 2: doTryCatch(return(expr), name, parentenv, handler)
 3: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 4: tryCatchList(expr, classes, parentenv, handlers)
 5: 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))})
 6: try({    settings <- git_config_global()    name <- subset(settings, name == "user.name")$value    email <- subset(settings, name == "user.email")$value    if (length(name) || length(email)) {        packageStartupInform("Default user: %s <%s>", as_string(name),             as_string(email))    }    else {        packageStartupInform("No default user configured")    }})
 7: fun(libname, pkgname)
 8: doTryCatch(return(expr), name, parentenv, handler)
 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
10: tryCatchList(expr, classes, parentenv, handlers)
11: tryCatch(fun(libname, pkgname), error = identity)
12: runHook(".onAttach", ns, dirname(nspath), nsname)
13: attachNamespace(ns, pos = pos, deps, exclude, include.only)
14: doTryCatch(return(expr), name, parentenv, handler)
15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
16: tryCatchList(expr, classes, parentenv, handlers)
17: tryCatch({    attr(package, "LibPath") <- which.lib.loc    ns <- loadNamespace(package, lib.loc)    env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)}, error = function(e) {    P <- if (!is.null(cc <- conditionCall(e)))         paste(" in", deparse(cc)[1L])    else ""    msg <- gettextf("package or namespace load failed for %s%s:\n %s",         sQuote(package), P, conditionMessage(e))    if (logical.return)         message(paste("Error:", msg), domain = NA)    else stop(msg, call. = FALSE, domain = NA)})
18: library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE)
19: withCallingHandlers(expr, packageStartupMessage = function(c) tryInvokeRestart("muffleMessage"))
20: suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,     character.only = TRUE, logical.return = TRUE))
21: doTryCatch(return(expr), name, parentenv, handler)
22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
23: tryCatchList(expr, classes, parentenv, handlers)
24: 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))})
25: try(suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,     character.only = TRUE, logical.return = TRUE)))
26: tools:::.test_load_package("gert", "/home/mbojan/R/library/x86_64-pc-linux-gnu/4.0/00LOCK-gert/00new")
An irrecoverable exception occurred. R is aborting now ...
Illegal instruction (core dumped)
ERROR: loading failed
* removing ‘/home/mbojan/R/library/x86_64-pc-linux-gnu/4.0/gert’
* restoring previous ‘/home/mbojan/R/library/x86_64-pc-linux-gnu/4.0/gert’
Error: Failed to install 'gert' from GitHub:
  (converted from warning) installation of package ‘/tmp/RtmpRSBTcl/file107152171625/gert_1.1.0.tar.gz’ had non-zero exit status

@jeroen
Copy link
Member

jeroen commented Jan 26, 2021

That's so strange, you all seems to be crashing in git_config_open_default which simply reads your global git config files. I can't reproduce this on any of my machines, there must be something related to the local setup.

Do you folks have a config file in ~/.gitconfig or ~/.config/git/config with anything particular in it? Do you have an XDG_CONFIG_HOME environment variable set?
If so could you maybe test if the problem goes away if you temporarily rename that file?

cc @ethomson

@dpastoor
Copy link

dpastoor commented Jan 26, 2021

FWIW here is my (successful) output on an Ubuntu 18 AMI

> install.packages("gert", repos = "https://cran.rstudio.com")
Installing package into ‘/data/home/devinp/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/gert_1.1.0.tar.gz'
Content type 'application/x-gzip' length 67224 bytes (65 KB)
==================================================
downloaded 65 KB

* installing *source* package ‘gert’ ...
** package ‘gert’ successfully unpacked and MD5 sums checked
** using staged installation
> curl::curl_download("http://r-lib.github.io/gert/get-libgit2-linux.sh","get-libgit2-linux.sh")
> 
> 
> curl::curl_download('http://r-lib.github.io/gert/libgit2-1.1.0.x86_64_linux.tar.gz','bundle.tar.gz')
> 
> 
Using static libgit2-1.1.0 for Linux x86_64
Using PKG_CFLAGS=-DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include
Using PKG_LIBS=-L/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/lib -lgit2 -lrt -lpthread -lssh2 -lssl -lcrypto -ldl -lpcre -lz
Configuration OK!
** libs
rm -f gert.so branch.o clone.o commit.o config.o conflicts.o files.o init.o merge.o rebase.o stash.o submodules.o tag.o utils.o version.o
gcc -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c branch.c -o branch.o
gcc -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c clone.c -o clone.o
gcc -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c commit.c -o commit.o
gcc -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c config.c -o config.o
gcc -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c conflicts.c -o conflicts.o
gcc -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c files.c -o files.o
gcc -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c init.c -o init.o
gcc -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c merge.c -o merge.o
gcc -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c rebase.c -o rebase.o
gcc -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c stash.c -o stash.o
gcc -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c submodules.c -o submodules.o
gcc -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c tag.c -o tag.o
gcc -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c utils.c -o utils.o
gcc -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c version.c -o version.o
gcc -shared -L/opt/R/4.0.3/lib/R/lib -L/usr/local/lib -o gert.so branch.o clone.o commit.o config.o conflicts.o files.o init.o merge.o rebase.o stash.o submodules.o tag.o utils.o version.o -L/tmp/RtmpH9XXbM/R.INSTALL377f44e869c1/gert/libgit2/lib -lgit2 -lrt -lpthread -lssh2 -lssl -lcrypto -ldl -lpcre -lz -L/opt/R/4.0.3/lib/R/lib -lR
installing to /data/home/devinp/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-gert/00new/gert/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (gert)

The downloaded source packages are in
	‘/tmp/Rtmpi0ntLF/downloaded_packages’
devinp@ip-172-31-51-137:~/tmp$ gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@sideburnie
Copy link

sideburnie commented Jan 26, 2021

➜  ~ ll /home/user/.gitconfig
17952 1.0K lrwxrwxrwx 1 user user 29 May 31  2020 /home/user/.gitconfig -> /home/user/dotfiles/gitconfig
➜  ~ cat .gitconfig 
[user]
    email = [email protected]
    name = user
[core]
    editor = vim
[push]
	default = matching
[credential]
	helper = cache

nothing set for XDG_CONFIG_HOME

@sideburnie
Copy link

Thanks a lot for the quick workaround earlier, BTW. I was really banging my head against the wall.

@jeroen
Copy link
Member

jeroen commented Jan 26, 2021

Well this really shouldn't be happening in the first place. Are you using a desktop linux, or server? Also you say 8 year old X86 boxes, these are 64-bit, right?

@jan-glx
Copy link

jan-glx commented Jan 27, 2021

I got a similar error in the setup specified below. The workaround works well.

gcc -std=gnu99 -shared -L/software/r/4.0.0/lib64/R/lib -L/usr/local/lib64 -o gert.so branch.o clone.o commit.o config.o conflicts.o files.o init.o merge.o rebase.o stash.o submodules.o tag.o utils.o version.o -L/tmp/Rtmpl3JNZd/R.INSTALL2abd1134ad51/gert/libgit2/lib -lgit2 -lrt -lpthread -lssh2 -lssl -lcrypto -ldl -lpcre -lz -L/software/r/4.0.0/lib64/R/lib -lR
/usr/bin/ld: /tmp/Rtmpl3JNZd/R.INSTALL2abd1134ad51/gert/libgit2/lib/libgit2.a(annotated_commit.c.o): unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [gert.so] Error 1
ERROR: compilation failed for package ‘gert’
* removing ‘/home/gleixner/R/x86_64-pc-linux-gnu-library/4.0.0/gert’
 > sessioninfo::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.0.0 (2020-04-24)
 os       CentOS Linux 7 (Core)
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  en_GB.UTF-8
 ctype    en_GB.UTF-8
 tz       Europe/Berlin
 date     2021-01-27

─ Packages ───────────────────────────────────────────────────────────────────
 package     * version date       lib source
 assertthat    0.2.1   2019-03-21 [1] CRAN (R 4.0.0)
 cli           2.2.0   2020-11-20 [1] CRAN (R 4.0.0)
 crayon        1.3.4   2017-09-16 [1] CRAN (R 4.0.0)
 fansi         0.4.1   2020-01-08 [1] CRAN (R 4.0.0)
 glue          1.4.2   2020-08-27 [1] CRAN (R 4.0.0)
 sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 4.0.0)
 withr         2.4.1   2021-01-26 [1] CRAN (R 4.0.0)

[1] /home/gleixner/R/x86_64-pc-linux-gnu-library/4.0.0
[2] /software/r/4.0.0/lib64/R/library
processor       : 55
vendor_id       : GenuineIntel
cpu family      : 6
model           : 79
model name      : Intel(R) Xeon(R) CPU E5-2660 v4 @ 2.00GHz
stepping        : 1
microcode       : 0xb000021
cpu MHz         : 1243.593
cache size      : 35840 KB
physical id     : 1
siblings        : 28
core id         : 14
cpu cores       : 14
apicid          : 61
initial apicid  : 61
fpu             : yes
fpu_exception   : yes
cpuid level     : 20
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 cdp_l3 invpcid_single intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a rdseed adx smap xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts
bogomips        : 4014.04
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/software/gcc/7.2.0/libexec/gcc/x86_64-pc-linux-gnu/7.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/software/gcc/7.2.0
Thread model: posix
gcc version 7.2.0 (GCC)

EDIT: corrected error message & add further info

@jeroen
Copy link
Member

jeroen commented Jan 27, 2021

Thanks. It seems your CPU seems pretty recent, which makes me doubt if this is hardware related...

Does git config --list --show-origin show any unusual config files?

@sideburnie
Copy link

Ubuntu desktop, Debian (bare net-install)

processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2630L v2 @ 2.40GHz
stepping	: 4
microcode	: 0x42d
cpu MHz		: 1639.601
cache size	: 15360 KB
physical id	: 0
siblings	: 12
core id		: 0
cpu cores	: 6
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm cpuid_fault epb pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts flush_l1d
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips	: 4800.14
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 45
model name	: Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
stepping	: 7
microcode	: 0x71a
cpu MHz		: 3310.003
cache size	: 12288 KB
physical id	: 0
siblings	: 12
core id		: 0
cpu cores	: 6
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
vmx flags	: vnmi preemption_timer invvpid ept_x_only ept_1gb flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest ple
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips	: 6419.35
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

file:/home/usergitconfig      [email protected]
file:/home/user/.gitconfig      user.name=user
file:/home/user/.gitconfig      core.editor=vim
file:/home/user/.gitconfig      push.default=matching
file:/home/user/.gitconfig      credential.helper=cache

@hsbadr
Copy link

hsbadr commented Jan 27, 2021

I run into similar issues with old Linux distros. After debugging, I found that it's due to the static version of libgit2 installed by the configure script:

gert/configure

Lines 24 to 30 in 6585a65

# On Linux distros with old libgit2, try downloading our static build.
if [ -z "$USE_SYSTEM_LIBGIT2" ] && [ `uname` = "Linux" ] && [ `arch` = "x86_64" ]; then
${R_HOME}/bin/R -q -e 'curl::curl_download("http://r-lib.github.io/gert/get-libgit2-linux.sh","get-libgit2-linux.sh")' || true
if [ -f "get-libgit2-linux.sh" ]; then
. ./get-libgit2-linux.sh
fi
fi

which results in:

** using staged installation
> curl::curl_download("http://r-lib.github.io/gert/get-libgit2-linux.sh","get-libgit2-linux.sh")
> curl::curl_download('http://r-lib.github.io/gert/libgit2-1.1.0.x86_64_linux.tar.gz','bundle.tar.gz')
Using static libgit2-1.1.0 for Linux x86_64

The solution, for me, was to use the system version of libgit2:

  • Install the latest version of libgit2/libgit2-dev for the system. For Ubuntu 16.04 Xenial:
sudo add-apt-repository ppa:cran/libgit2
sudo apt-get update
sudo apt-get install libgit2-dev
  • Set USE_SYSTEM_LIBGIT2 environment variable:
export USE_SYSTEM_LIBGIT2=1
  • install gert normally from CRAN or GitHub:
install.packages("gert")

OR

remotes::install_github("r-lib/gert")

@hsbadr
Copy link

hsbadr commented Jan 27, 2021

So in the new version we are using a custom build of libgit2 instead of the system one. But that doesn't seem to work in your case. A workaround is to use this:

Sys.setenv(USE_SYSTEM_LIBGIT2=1)
install.packages("gert")

But I still want to understand why our binaries don't work on your system.

@jeroen My bad! I've just seen your comment. The binaries were working for me before upgrading the kernel and other system libraries. So, it's a combination of CPU and compiler optimizations (CPU-specific instructions) as well as the kernel version and system dependencies that causes Illegal instruction issues.

I think the system version of libgit2 should be used by default unless it's unavailable or its version is old/unsupported. Also, you may want to check if the static version does work before using it; if not, just stop and ask the users to install the required system libraries (libgit2). I'd disable all optimizations too, not to let the compiler use specific instructions.

@HenrikBengtsson
Copy link

HenrikBengtsson commented Jan 27, 2021

Works on some CPUs but not on others

I also get the Illegal instruction (see below) when installing gert 1.1.0 on CentOS 7 with gcc 4.8.5 in R 4.0.3 (built from source). This is on an HPC cluster where all machines have identical CentOS 7 but their CPUs might differ as some machines are from different eras - some go all the way back to 2013(?) and some are brand new from 2021. By trying on different machines, it looks like the error is associated with older CPU types (see below).

Hopefully, this info helps narrow in on which CPU instruction we're talking about.

CPUs where it works

Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz

[c4-n16]$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                64
On-line CPU(s) list:   0-63
Thread(s) per core:    2
Core(s) per socket:    16
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 85
Model name:            Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz
Stepping:              4
CPU MHz:               3369.561
CPU max MHz:           3700.0000
CPU min MHz:           1000.0000
BogoMIPS:              4200.00
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              1024K
L3 cache:              22528K
NUMA node0 CPU(s):     0-15,32-47
NUMA node1 CPU(s):     16-31,48-63
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 cdp_l3 invpcid_single intel_ppin intel_pt ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke md_clear spec_ctrl intel_stibp flush_l1d

Intel(R) Xeon(R) Gold 6238R CPU @ 2.20GHz

[c4-n6]$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                112
On-line CPU(s) list:   0-111
Thread(s) per core:    2
Core(s) per socket:    28
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 85
Model name:            Intel(R) Xeon(R) Gold 6238R CPU @ 2.20GHz
Stepping:              7
CPU MHz:               999.963
CPU max MHz:           4000.0000
CPU min MHz:           1000.0000
BogoMIPS:              4400.00
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              1024K
L3 cache:              39424K
NUMA node0 CPU(s):     0-27,56-83
NUMA node1 CPU(s):     28-55,84-111
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 cdp_l3 invpcid_single intel_ppin intel_pt ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke avx512_vnni md_clear spec_ctrl intel_stibp flush_l1d arch_capabilities

CPUs where it fails

AMD Opteron(tm) Processor 6176

[c4-dev2]$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                48
On-line CPU(s) list:   0-47
Thread(s) per core:    1
Core(s) per socket:    12
Socket(s):             4
NUMA node(s):          8
Vendor ID:             AuthenticAMD
CPU family:            16
Model:                 9
Model name:            AMD Opteron(tm) Processor 6176
Stepping:              1
CPU MHz:               800.000
CPU max MHz:           2300.0000
CPU min MHz:           800.0000
BogoMIPS:              4600.27
Virtualization:        AMD-V
L1d cache:             64K
L1i cache:             64K
L2 cache:              512K
L3 cache:              5118K
NUMA node0 CPU(s):     0-5
NUMA node1 CPU(s):     6-11
NUMA node2 CPU(s):     12-17
NUMA node3 CPU(s):     18-23
NUMA node4 CPU(s):     24-29
NUMA node5 CPU(s):     30-35
NUMA node6 CPU(s):     36-41
NUMA node7 CPU(s):     42-47
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc art rep_good nopl nonstop_tsc extd_apicid amd_dcm pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate retpoline_amd ibp_disable vmmcall npt lbrv svm_lock nrip_save pausefilter

Six-Core AMD Opteron(tm) Processor 2431

[c4-dev3]$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                12
On-line CPU(s) list:   0-11
Thread(s) per core:    1
Core(s) per socket:    6
Socket(s):             2
NUMA node(s):          2
Vendor ID:             AuthenticAMD
CPU family:            16
Model:                 8
Model name:            Six-Core AMD Opteron(tm) Processor 2431
Stepping:              0
CPU MHz:               2412.234
BogoMIPS:              4824.46
Virtualization:        AMD-V
L1d cache:             64K
L1i cache:             64K
L2 cache:              512K
L3 cache:              6144K
NUMA node0 CPU(s):     0-5
NUMA node1 CPU(s):     6-11
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc art rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate retpoline_amd ibp_disable vmmcall npt lbrv svm_lock nrip_save pausefilter

AMD Opteron(tm) Processor 6282 SE

[c4-n12]$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                64
On-line CPU(s) list:   0-63
Thread(s) per core:    2
Core(s) per socket:    8
Socket(s):             4
NUMA node(s):          8
Vendor ID:             AuthenticAMD
CPU family:            21
Model:                 1
Model name:            AMD Opteron(tm) Processor 6282 SE
Stepping:              2
CPU MHz:               1400.000
CPU max MHz:           2600.0000
CPU min MHz:           1400.0000
BogoMIPS:              5199.94
Virtualization:        AMD-V
L1d cache:             16K
L1i cache:             64K
L2 cache:              2048K
L3 cache:              6144K
NUMA node0 CPU(s):     0-7
NUMA node1 CPU(s):     8-15
NUMA node2 CPU(s):     16-23
NUMA node3 CPU(s):     24-31
NUMA node4 CPU(s):     32-39
NUMA node5 CPU(s):     40-47
NUMA node6 CPU(s):     48-55
NUMA node7 CPU(s):     56-63
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc art rep_good nopl nonstop_tsc extd_apicid amd_dcm aperfmperf pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt fma4 nodeid_msr topoext perfctr_core perfctr_nb cpb hw_pstate retpoline_amd ssbd ibpb vmmcall arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold

Intel(R) Xeon(R) CPU X5690 @ 3.47GHz

c4-n14 ~]$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                24
On-line CPU(s) list:   0-23
Thread(s) per core:    2
Core(s) per socket:    6
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 44
Model name:            Intel(R) Xeon(R) CPU           X5690  @ 3.47GHz
Stepping:              2
CPU MHz:               1600.000
CPU max MHz:           3468.0000
CPU min MHz:           1600.0000
BogoMIPS:              6933.67
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              12288K
NUMA node0 CPU(s):     0-5,12-17
NUMA node1 CPU(s):     6-11,18-23
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 popcnt aes lahf_lm epb ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid dtherm ida arat spec_ctrl intel_stibp flush_l1d

Intel(R) Xeon(R) CPU E5430 @ 2.66GHz

[dev1] $ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             2
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 23
Model name:            Intel(R) Xeon(R) CPU           E5430  @ 2.66GHz
Stepping:              10
CPU MHz:               2003.000
CPU max MHz:           2670.0000
CPU min MHz:           2003.0000
BogoMIPS:              5320.42
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              6144K
NUMA node0 CPU(s):     0-7
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf eagerfpu pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 xsave lahf_lm tpr_shadow vnmi flexpriority dtherm
$ R --vanilla

R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages("gert", repos="https://cloud.r-project.org")
Installing package into/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.0-CBI’
(aslibis unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/gert_1.1.0.tar.gz'
Content type 'application/x-gzip' length 67224 bytes (65 KB)
==================================================
downloaded 65 KB

* installing *source* packagegert...
** packagegertsuccessfully unpacked and MD5 sums checked
** using staged installation
> curl::curl_download("http://r-lib.github.io/gert/get-libgit2-linux.sh","get-libgit2-linux.sh")
> 
> 
> curl::curl_download('http://r-lib.github.io/gert/libgit2-1.1.0.x86_64_linux.tar.gz','bundle.tar.gz')
> 
> 
Using static libgit2-1.1.0 for Linux x86_64
Using PKG_CFLAGS=-DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include
Using PKG_LIBS=-L/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/lib -lgit2 -lrt -lpthread -lssh2 -lssl -lcrypto -ldl -lpcre -lz
Configuration OK!
** libs
rm -f gert.so branch.o clone.o commit.o config.o conflicts.o files.o init.o merge.o rebase.o stash.o submodules.o tag.o utils.o version.o
gcc -std=gnu99 -I"/software/c4/cbi/software/R-4.0.3/lib64/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c branch.c -o branch.o
gcc -std=gnu99 -I"/software/c4/cbi/software/R-4.0.3/lib64/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c clone.c -o clone.o
gcc -std=gnu99 -I"/software/c4/cbi/software/R-4.0.3/lib64/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c commit.c -o commit.o
gcc -std=gnu99 -I"/software/c4/cbi/software/R-4.0.3/lib64/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c config.c -o config.o
gcc -std=gnu99 -I"/software/c4/cbi/software/R-4.0.3/lib64/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c conflicts.c -o conflicts.o
gcc -std=gnu99 -I"/software/c4/cbi/software/R-4.0.3/lib64/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c files.c -o files.o
gcc -std=gnu99 -I"/software/c4/cbi/software/R-4.0.3/lib64/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c init.c -o init.o
gcc -std=gnu99 -I"/software/c4/cbi/software/R-4.0.3/lib64/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c merge.c -o merge.o
gcc -std=gnu99 -I"/software/c4/cbi/software/R-4.0.3/lib64/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c rebase.c -o rebase.o
gcc -std=gnu99 -I"/software/c4/cbi/software/R-4.0.3/lib64/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c stash.c -o stash.o
gcc -std=gnu99 -I"/software/c4/cbi/software/R-4.0.3/lib64/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c submodules.c -o submodules.o
gcc -std=gnu99 -I"/software/c4/cbi/software/R-4.0.3/lib64/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c tag.c -o tag.o
gcc -std=gnu99 -I"/software/c4/cbi/software/R-4.0.3/lib64/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c utils.c -o utils.o
gcc -std=gnu99 -I"/software/c4/cbi/software/R-4.0.3/lib64/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include  -fvisibility=hidden -fpic  -g -O2  -c version.c -o version.o
gcc -std=gnu99 -shared -L/software/c4/cbi/software/R-4.0.3/lib64/R/lib -L/usr/local/lib64 -o gert.so branch.o clone.o commit.o config.o conflicts.o files.o init.o merge.o rebase.o stash.o submodules.o tag.o utils.o version.o -L/scratch/henrik/RtmpZJmUfH/R.INSTALL19cff5b29b5/gert/libgit2/lib -lgit2 -lrt -lpthread -lssh2 -lssl -lcrypto -ldl -lpcre -lz -L/software/c4/cbi/software/R-4.0.3/lib64/R/lib -lR
installing to /c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.0-CBI/00LOCK-gert/00new/gert/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
sh: line 1:  6815 Illegal instruction     R_TESTS= '/software/c4/cbi/software/R-4.0.3/lib64/R/bin/R' --no-save --no-restore --no-echo 2>&1 < '/scratch/henrik/RtmpZJmUfH/file19cf41d51c2b'

 *** caught illegal operation ***
address 0x2b3a8b234ccd, cause 'illegal operand'

Traceback:
 1: git_config_global()
 2: doTryCatch(return(expr), name, parentenv, handler)
 3: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 4: tryCatchList(expr, classes, parentenv, handlers)
 5: 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))})
 6: try({    settings <- git_config_global()    name <- subset(settings, name == "user.name")$value    email <- subset(settings, name == "user.email")$value    if (length(name) || length(email)) {        packageStartupInform("Default user: %s <%s>", as_string(name),             as_string(email))    }    else {        packageStartupInform("No default user configured")    }})
 7: fun(libname, pkgname)
 8: doTryCatch(return(expr), name, parentenv, handler)
 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
10: tryCatchList(expr, classes, parentenv, handlers)
11: tryCatch(fun(libname, pkgname), error = identity)
12: runHook(".onAttach", ns, dirname(nspath), nsname)
13: attachNamespace(ns, pos = pos, deps, exclude, include.only)
14: doTryCatch(return(expr), name, parentenv, handler)
15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
16: tryCatchList(expr, classes, parentenv, handlers)
17: tryCatch({    attr(package, "LibPath") <- which.lib.loc    ns <- loadNamespace(package, lib.loc)    env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)}, error = function(e) {    P <- if (!is.null(cc <- conditionCall(e)))         paste(" in", deparse(cc)[1L])    else ""    msg <- gettextf("package or namespace load failed for %s%s:\n %s",         sQuote(package), P, conditionMessage(e))    if (logical.return)         message(paste("Error:", msg), domain = NA)    else stop(msg, call. = FALSE, domain = NA)})
18: library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE)
19: withCallingHandlers(expr, packageStartupMessage = function(c) tryInvokeRestart("muffleMessage"))
20: suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,     character.only = TRUE, logical.return = TRUE))
21: doTryCatch(return(expr), name, parentenv, handler)
22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
23: tryCatchList(expr, classes, parentenv, handlers)
24: 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))})
25: try(suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,     character.only = TRUE, logical.return = TRUE)))
26: tools:::.test_load_package("gert", "/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.0-CBI/00LOCK-gert/00new")
An irrecoverable exception occurred. R is aborting now ...
ERROR: loading failed
* removing/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.0-CBI/gert* restoring previous/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.0-CBI/gertThe downloaded source packages are in/scratch/henrik/Rtmps4SVaO/downloaded_packagesWarning message:
In install.packages("gert", repos = "https://cloud.r-project.org") :
  installation of packagegerthad non-zero exit status
> 

Session info

> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS:   /software/c4/cbi/software/R-4.0.3/lib64/R/lib/libRblas.so
LAPACK: /software/c4/cbi/software/R-4.0.3/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8    LC_NUMERIC=C            LC_TIME=C              
 [4] LC_COLLATE=en_US.UTF-8  LC_MONETARY=C           LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=C              LC_NAME=C               LC_ADDRESS=C           
[10] LC_TELEPHONE=C          LC_MEASUREMENT=C        LC_IDENTIFICATION=C    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.0.3 tools_4.0.3   

and

$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

EDIT: Added another failing CPU (Intel(R) Xeon(R) CPU E5430 @ 2.66GHz).

@HenrikBengtsson
Copy link

Troubleshooting

BTW, for troubleshooting purposes one can force install gert 1.1.0 using:

> install.packages("gert", repos = "https://cloud.r-project.org", INSTALL_opts="--no-test-load")

With this, I can load the package but as we already know, it fails with gert::git_config_global(), e.g.

[c4-n14]$ Rscript --vanilla -e "loadNamespace('gert')" -e "message('*******')" -e ''
<environment: namespace:gert>
*******

 *** caught illegal operation ***
address 0x2ae97ccbfccd, cause 'illegal operand'

Traceback:
 1: gert::git_config_global()
An irrecoverable exception occurred. R is aborting now ...
Illegal instruction

Strace

Here's the end of the strace output:

[c4-n14]$ strace Rscript --quiet --vanilla -e 'gert::git_config_global()'
...
read(5, "", 4096)                       = 0
close(5)                                = 0
munmap(0x2ad428e9b000, 4096)            = 0
access("/c4/home/henrik/.gitconfig", F_OK) = 0
stat("/c4/home/henrik/.gitconfig", {st_mode=S_IFREG|0644, st_size=116, ...}) = 0
access("/c4/home/henrik/.gitconfig", F_OK) = 0
access("/c4/home/henrik/.gitconfig", R_OK) = 0
stat("/c4/home/henrik/.gitconfig", {st_mode=S_IFREG|0644, st_size=116, ...}) = 0
stat("/c4/home/henrik/.gitconfig", {st_mode=S_IFREG|0644, st_size=116, ...}) = 0
open("/c4/home/henrik/.gitconfig", O_RDONLY|O_CLOEXEC) = 5
read(5, "[user]\n\temail = hb@aroma-project"..., 116) = 116
close(5)                                = 0
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPN, si_addr=0x2ad4385a6ccd} ---
write(2, "\n *** caught illegal operation *"..., 35
 *** caught illegal operation ***
) = 35
write(2, "address 0x2ad4385a6ccd, cause 'i"..., 48address 0x2ad4385a6ccd, cause 'illegal operand'
) = 48
write(2, "\nTraceback:\n", 12
Traceback:
)          = 12
write(2, " 1: ", 4 1: )                     = 4
write(2, "gert::git_config_global()", 25gert::git_config_global()) = 25
write(2, "\n", 1
)                       = 1
write(2, "An irrecoverable exception occur"..., 59An irrecoverable exception occurred. R is aborting now ...
) = 59
rt_sigaction(SIGINT, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x2ad429dd9400}, {sa_handler=0x2ad42921a510, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x2ad429dd9400}, 8) = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x2ad429dd9400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [ILL], 8) = 0
clone(child_stack=NULL, flags=CLONE_PARENT_SETTID|SIGCHLD, parent_tidptr=0x16da450) = 17840
wait4(17840, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 17840
rt_sigaction(SIGINT, {sa_handler=0x2ad42921a510, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x2ad429dd9400}, NULL, 8) = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x2ad429dd9400}, NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, [ILL], NULL, 8) = 0
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17840, si_uid=581, si_status=0, si_utime=0, si_stime=0} ---
rt_sigaction(SIGILL, {sa_handler=SIG_DFL, sa_mask=[ILL], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x2ad429dd9400}, {sa_handler=0x2ad42921a570, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_SIGINFO, sa_restorer=0x2ad429b96630}, 8) = 0
tgkill(17822, 17822, SIGILL)            = 0
rt_sigreturn({mask=[]})                 = 2562383102
--- SIGILL {si_signo=SIGILL, si_code=SI_TKILL, si_pid=17822, si_uid=581} ---
+++ killed by SIGILL +++
Illegal instruction

Without ~/.gitconfig

[c4-n14 ~]$ mv ~/.gitconfig ~/.gitconfig.HIDE
[c4-n14 ~]$ Rscript --quiet --vanilla -e 'gert::git_config_global()'
[1] name  value level
<0 rows> (or 0-length row.names)

With empty ~/.gitconfig

[c4-n14]$ touch ~/.gitconfig
[c4-n14]$ cat ~/.gitconfig
[c4-n14]$ ls -l ~/.gitconfig
-rw-r--r-- 1 henrik cbc 0 Jan 26 18:37 /c4/home/henrik/.gitconfig
[c4-n14]$ Rscript --quiet --vanilla -e 'gert::git_config_global()'

 *** caught illegal operation ***
address 0x2b2b19c4accd, cause 'illegal operand'

Traceback:
 1: gert::git_config_global()
An irrecoverable exception occurred. R is aborting now ...
Illegal instruction

The same with strace gives:

...
open("/c4/home/henrik/.gitconfig", O_RDONLY|O_CLOEXEC) = 5
close(5)                                = 0
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPN, si_addr=0x2b4c71ca0ccd} ---
write(2, "\n *** caught illegal operation *"..., 35
 *** caught illegal operation ***
) = 35
write(2, "address 0x2b4c71ca0ccd, cause 'i"..., 48address 0x2b4c71ca0ccd, cause 'illegal operand'
) = 48
write(2, "\nTraceback:\n", 12
Traceback:
)          = 12
write(2, " 1: ", 4 1: )                     = 4
write(2, "gert::git_config_global()", 25gert::git_config_global()) = 25
write(2, "\n", 1
)                       = 1
write(2, "An irrecoverable exception occur"..., 59An irrecoverable exception occurred. R is aborting now ...
) = 59
rt_sigaction(SIGINT, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x2b4c634d3400}, {sa_handler=0x2b4c62914510, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x2b4c634d3400}, 8) = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x2b4c634d3400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [ILL], 8) = 0
clone(child_stack=NULL, flags=CLONE_PARENT_SETTID|SIGCHLD, parent_tidptr=0x1dbe450) = 17933
wait4(17933, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 17933
rt_sigaction(SIGINT, {sa_handler=0x2b4c62914510, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x2b4c634d3400}, NULL, 8) = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x2b4c634d3400}, NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, [ILL], NULL, 8) = 0
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17933, si_uid=581, si_status=0, si_utime=0, si_stime=0} ---
rt_sigaction(SIGILL, {sa_handler=SIG_DFL, sa_mask=[ILL], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x2b4c634d3400}, {sa_handler=0x2b4c62914570, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_SIGINFO, sa_restorer=0x2b4c63290630}, 8) = 0
tgkill(17914, 17914, SIGILL)            = 0
rt_sigreturn({mask=[]})                 = 2562383102
--- SIGILL {si_signo=SIGILL, si_code=SI_TKILL, si_pid=17914, si_uid=581} ---
+++ killed by SIGILL +++
Illegal instruction

Hopefully this adds some more clues.

@kevinushey
Copy link

Looking at objump -d, I see some entries like:

Screen Shot 2021-01-26 at 6 41 49 PM

vextracti128 is an AVX2 instruction, and those won't be available for older processors (older than 2012-ish I guess?)

@kevinushey
Copy link

@HenrikBengtsson's older CPU reports avx but not avx2 instructions being available so I think that lends a bit more evidence to that theory as well.

@hsbadr
Copy link

hsbadr commented Jan 27, 2021

@kevinushey I think that CPU-specific instructions are enabled by the compiler with optimization flags, which will cause similar issues when compiling on newer CPUs. Intel compilers explicitly print the used instructions if not supported by the machine at runtime. For example, using -xHOST compiler flag will optimize the binaries for the current CPU instructions that will likely fail on older/different CPUs.

That's why I think if a static version should be shipped, it will have to use safe optimizations only or be built for old CPUs.

HenrikBengtsson added a commit to HenrikBengtsson/CBI-software that referenced this issue Jan 27, 2021
@ethomson
Copy link

I think the system version of libgit2 should be used by default unless it's unavailable or its version is old/unsupported. Also, you may want to check if the static version does work before using it; if not, just stop and ask the users to install the required system libraries (libgit2). I'd disable all optimizations too, not to let the compiler use specific instructions.

Personally, I wouldn't bother with the system libgit2 - at least not without a very explicit opt-in. System libgit2 will fall into one of two categories:

  1. Installed by the distribution. These are almost always ancient, so you have to either be very careful about the FFI calls you're making or reject a handful of versions. My Ubuntu focal box appears to have libgit2 v0.28.4 which is not super new.

But they're also built for a wide variety of architectures / processors, and are optimized for a general amd64. Which means that they're no faster than what you could produce on your own (with the same targets and optimization settings). So the upside of using the system libgit2 is pretty limited.

  1. Installed by the user. Maybe they really want a custom zlib that is hyper-optimized for their processor or something. That's awesome but it's like sub-1% of users.

That's why I think if a static version should be shipped, it will have to use safe optimizations only or be built for old CPUs.

👍

It could certainly also be vendored (which is what the rugged ruby bindings do) and built optimized for each target. This will bring certainly longer compile times but might be an interesting option. But, personally, I would ship a static library that is optimized for amd64 but has no special other optimizations.

Where can I see the build for this static library?

This feels like a place that libgit2 could improve - given that so many of our users come via language bindings like these, we should either default-to or have an easy opt-in to the right optimizations.

@jeroen
Copy link
Member

jeroen commented Jan 27, 2021

Thanks all for the input. I had built the binaries using linuxbrew, which maybe buils with -mtune=native by default. I am going to rebuild them te be sure, give me an hour...

@ethomson
Copy link

Aha - I think that Clang and GCC started adding more variants of x86-64 optimization recently. I think that dropping that back to -march=x86-64 would be the Very Safest option, but you might be safe with x86-64-v2.

In particular, avx2 is enabled by x86-64-v3 or newer, and I suspect that your build machine is v3 or v4 and -mtune=native will add avx2 instructions.

@ethomson
Copy link

Oh sorry, I misread what you said - I thought that you said that you were building with -mtune=native, you said that linuxbrew may be adding that. I suspect that you already came to the same conclusions that I did, just earlier.

Anyway, I'm fascinated to find out what's happening. 🍿

@jeroen
Copy link
Member

jeroen commented Jan 27, 2021

Hi all, I have rebuilt and redeployed the static library. Could you try again to see if the problem has disappeared?

@jan-glx
Copy link

jan-glx commented Jan 27, 2021

No. I was not aware gert is sideloading binaries. Does CRAN even allow this?

@jeroen
Copy link
Member

jeroen commented Jan 27, 2021

@jan-glx are you still getting the crash? I just tested this with Intel's Software Development Emulator on sandybridge and mtm-core2 and that seems to work. I don't have any old hardware myself to debug this 😢

@mbojan
Copy link
Author

mbojan commented Jan 27, 2021

Seem to work for me, @jeroen :

Install log $ MAKE='make -j3' Rscript -e 'devtools::install_github("r-lib/gert@debug")' Using github PAT from envvar GITHUB_PAT Downloading GitHub repo r-lib/gert@debug
✔  checking for file ‘/tmp/RtmpK6UTYv/remotes1d46fb4ce0/r-lib-gert-99577ca/DESCRIPTION’ ...
─  preparing ‘gert’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  running ‘cleanup’
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘gert_1.1.0.tar.gz’
   
Installing package into ‘/home/mbojan/R/library/x86_64-pc-linux-gnu/4.0’
(as ‘lib’ is unspecified)
* installing *source* package ‘gert’ ...
** using staged installation
> curl::curl_download("http://r-lib.github.io/gert/get-libgit2-linux.sh","get-libgit2-linux.sh")
> 
> 
> curl::curl_download('http://r-lib.github.io/gert/libgit2-1.1.0.x86_64_linux.tar.gz','bundle.tar.gz')
> 
> 
Using static libgit2-1.1.0 for Linux x86_64
Using PKG_CFLAGS=-DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include
Using PKG_LIBS=-L/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/lib -lgit2 -lrt -lpthread -lssh2 -lssl -lcrypto -ldl -lpcre -lz
Configuration OK!
** libs
rm -f gert.so branch.o clone.o commit.o config.o conflicts.o files.o init.o merge.o rebase.o stash.o submodules.o tag.o utils.o version.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c branch.c -o branch.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c clone.c -o clone.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c commit.c -o commit.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c config.c -o config.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c conflicts.c -o conflicts.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c files.c -o files.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c merge.c -o merge.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c rebase.c -o rebase.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c stash.c -o stash.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c submodules.c -o submodules.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c tag.c -o tag.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utils.c -o utils.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -DSTATIC_LIBGIT2 -I/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/include -DR_NO_REMAP -DSTRICT_R_HEADERS    -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-7BvS0x/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c version.c -o version.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o gert.so branch.o clone.o commit.o config.o conflicts.o files.o init.o merge.o rebase.o stash.o submodules.o tag.o utils.o version.o -L/tmp/RtmpEqmtCB/R.INSTALL1da1406a7e3f/gert/libgit2/lib -lgit2 -lrt -lpthread -lssh2 -lssl -lcrypto -ldl -lpcre -lz -L/usr/lib/R/lib -lR
installing to /home/mbojan/R/library/x86_64-pc-linux-gnu/4.0/00LOCK-gert/00new/gert/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
USING certpath: /usr/lib/ssl/certs 
Running R_git_config_list...
Running git_config_open_default...
Running count_config_iter...
Count: 56...
Running git_config_iterator_new...
Running git_config_next...
Setting item 0
...Setting item 1
...Setting item 2
...Setting item 3
...Setting item 4
...Setting item 5
...Setting item 6
...Setting item 7
...Setting item 8
...Setting item 9
...Setting item 10
...Setting item 11
...Setting item 12
...Setting item 13
...Setting item 14
...Setting item 15
...Setting item 16
...Setting item 17
...Setting item 18
...Setting item 19
...Setting item 20
...Setting item 21
...Setting item 22
...Setting item 23
...Setting item 24
...Setting item 25
...Setting item 26
...Setting item 27
...Setting item 28
...Setting item 29
...Setting item 30
...Setting item 31
...Setting item 32
...Setting item 33
...Setting item 34
...Setting item 35
...Setting item 36
...Setting item 37
...Setting item 38
...Setting item 39
...Setting item 40
...Setting item 41
...Setting item 42
...Setting item 43
...Setting item 44
...Setting item 45
...Setting item 46
...Setting item 47
...Setting item 48
...Setting item 49
...Setting item 50
...Setting item 51
...Setting item 52
...Setting item 53
...Setting item 54
...Setting item 55
...Running git_config_iterator_free...
Running git_config_free...
Running build_tibble...
All done! Returning.....
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
USING certpath: /usr/lib/ssl/certs 
Running R_git_config_list...
Running git_config_open_default...
Running count_config_iter...
Count: 56...
Running git_config_iterator_new...
Running git_config_next...
Setting item 0
...Setting item 1
...Setting item 2
...Setting item 3
...Setting item 4
...Setting item 5
...Setting item 6
...Setting item 7
...Setting item 8
...Setting item 9
...Setting item 10
...Setting item 11
...Setting item 12
...Setting item 13
...Setting item 14
...Setting item 15
...Setting item 16
...Setting item 17
...Setting item 18
...Setting item 19
...Setting item 20
...Setting item 21
...Setting item 22
...Setting item 23
...Setting item 24
...Setting item 25
...Setting item 26
...Setting item 27
...Setting item 28
...Setting item 29
...Setting item 30
...Setting item 31
...Setting item 32
...Setting item 33
...Setting item 34
...Setting item 35
...Setting item 36
...Setting item 37
...Setting item 38
...Setting item 39
...Setting item 40
...Setting item 41
...Setting item 42
...Setting item 43
...Setting item 44
...Setting item 45
...Setting item 46
...Setting item 47
...Setting item 48
...Setting item 49
...Setting item 50
...Setting item 51
...Setting item 52
...Setting item 53
...Setting item 54
...Setting item 55
...Running git_config_iterator_free...
Running git_config_free...
Running build_tibble...
All done! Returning.....
** testing if installed package keeps a record of temporary installation path
* DONE (gert)

@jeroen
Copy link
Member

jeroen commented Jan 27, 2021

@mbojan and can you please try if the regular install works as well?

install.packages("gert")

And can you also test if connecting to SSH/HTTPS remotes works for you?

library(gert)
git_clone("https://github.com/jeroen/curl")

# Only works if you have a registered ssh key with github
git_clone("[email protected]:jeroen/jsonlite")

And if you really want to help me, can you test if gert passed all checks on your machine?

curl -OL https://cran.r-project.org/src/contrib/gert_1.1.0.tar.gz
R CMD check gert_1.1.0.tar.gz

@jan-glx
Copy link

jan-glx commented Jan 27, 2021

My error is still there, but it wasn't about the avx instruction (unrecognized relocation (0x2a) in section .text'`) but is possibly due to on old linker being used on my system.

Anyway, (despite being a regular windows user 😅 ) I feel uncomfortable executing unsigned binaries downloaded from some (despite official) github repo on that machine. Wouldn't it be better to get explicit consent (e.g. by changing the default) and to put the static compilation into CI at least. I mean I trust you, but I doubt my sysadmins like that...
(Also aren't you currently theoretically breaching libgit2's LGPLv2 license by not providing it's source code along with the static build?)

@jeroen
Copy link
Member

jeroen commented Jan 27, 2021

@jan-glx your linker error is probably related to your use of LTO.

Some people were complaining they found gert annoying to install because it requires them to install libgit2 which is outdated on many distros or users simply don't have permission to install libraries. So this is the compromise: if libgit2 0.28 or newer is available (the latest versions of Debian, Ubuntu, Fedora, etc), we use this. On old Linux x86_64 systems we try the static build, unless you opt-out by setting USE_SYSTEM_LIBGIT2=1.

I think this will make the installation seamless for almost everyone (given that the binaries work 😅 ). Everyone always wants the default to match his personal preference and situation, and that's just not possible.

(Also aren't you currently theoretically breaching libgit2's LGPLv2 license by not providing it's source code along with the static build?)

I think we're fine, as you may be aware the libgit2 lead maintainer is above you in this same topic. There are enough mirrors of the libgit2 code already but we can always add another one, if that would be required.

@jan-glx
Copy link

jan-glx commented Jan 27, 2021

@jan-glx your linker error is probably related to your use of LTO.

I guess LTO refers to link time optimization? I don't know anything about that and didn't change anything there (tried unsetting the FLAGS in my Makevars but that did not change anything). Should I try anything else or open a separate issue?

Some people were complaining they found gert annoying to install because it requires them to install libgit2 which is outdated on many distros or users simply don't have permission to install libraries. So this is the compromise: if libgit2 0.28 or newer is available (the latest versions of Debian, Ubuntu, Fedora, etc), we use this. On old Linux x86_64 systems we try the static build, unless you opt-out by setting USE_SYSTEM_LIBGIT2=1.
I think this will make the installation seamless for almost everyone (given that the binaries work 😅 ). Everyone always wants the default to match his personal preference and situation, and that's just not possible.

I don't see anyone complaining about having to set an environment variable (or confirming a dialogue) to allow download and use of some binary lib.
I know this frustration but if no-one ever has to ask the sys admins to update they will never do...
Feel free to ignore my concern, you are in a better position to judge this.

(yes, did see ethomson (and quite a few other familiar handles) above, sorry for the noise everyone)

@HenrikBengtsson
Copy link

Success - I can verify that the new static library is compatible with all the nodes, including the ones that previously failed.

Test details

To avoid avoid to re-install all dependencies on each test host, I prepoluate a temporary site package library:

cd ~/test-gert
mkdir R-libs

USE_SYSTEM_LIBGIT2= R_LIBS_USER="~/test-gert/R-libs" Rscript --vanilla -e "install.packages('gert', repos='https://cloud.r-project.org')"

Installing package into/c4/home/henrik/test-gert/R-libs’
(aslibis unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/gert_1.1.0.tar.gz'
Content type 'application/x-gzip' length 67224 bytes (65 KB)
==================================================
downloaded 65 KB

* installing *source* packagegert...
** packagegertsuccessfully unpacked and MD5 sums checked
** using staged installation
> curl::curl_download("http://r-lib.github.io/gert/get-libgit2-linux.sh","get-libgit2-linux.sh")
> 
> 
Using static libgit2-1.1.0 for Linux x86_64
Using PKG_CFLAGS=-DSTATIC_LIBGIT2 -I/scratch/henrik/Rtmp63BAwf/R.INSTALL5a825fe58c55/gert/libgit2/include
Using PKG_LIBS=-L/scratch/henrik/Rtmp63BAwf/R.INSTALL5a825fe58c55/gert/libgit2/lib -lgit2 -lrt -lpthread -lssh2 -lssl -lcrypto -ldl -lpcre -lz
...
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (gert)

The downloaded source packages are in/scratch/henrik/RtmpL8PxRp/downloaded_packages

Then, I test load this centrally installed 'gert' on each test host:

cd 
R_LIBS_USER="~/test-gert/R-libs" Rscript --vanilla -e "find.package(\"gert\")" -e "library(gert)"

Practically, I use clush to test across multiple hosts concurrently, e.g.

$ clush -b -w 'c4-dev[1-3],c4-n[1-16]' 'R_LIBS_USER="~/test-gert/R-libs" Rscript --vanilla -e "find.package(\"gert\")" -e "library(gert)" 2>&1'
---------------
c4-dev[1-3],c4-n[1-16] (19)
---------------
[1] "/c4/home/henrik/test-gert/R-libs/gert"
Linking to libgit2 v1.1.0, ssh support: YES
Global config: /c4/home/henrik/.gitconfig
Default user: Henrik <[email protected]>

@jeroen
Copy link
Member

jeroen commented Jan 27, 2021

Thanks for the feedback everyone. I am closing this issue to prevent the discussion from getting conflated with other matters. If you run into any additional problems, please open a new issue.

A short post-mortem of what happened:

As described in the NEWS file on CRAN: on x86_64 Linux systems where libgit2 is too old or unavailable, we automatically try to download a precompiled static version of libgit2. This is mainly for users on CentOS-7 and Ubuntu 16/18 which complained that the system version of libgit2 is old, or they don't have permission to install system libraries, or they don't want to bother. Note that the current versions of Ubuntu, Fedora or Debian, etc (i.e. all cran plaforms) include a recent enough system version of libgit2 which will be used. The static library is just a fallback to make gert work seamlessly legacy linux systems.

The bug: I had used linuxbrew to build the static libraries, which is a great platform to do exactly this. However, I made a small mistake: linuxbrew by default compiles with -march=native for local source installations. One has to use --build-bottle to build portable binaries, which will get compiled with -march=core2 to run in any hardware. Hence the binaries that I had built initially only worked on somewhat recent processors.

The solution: I have rebuilt and deployed new static libraries, and now install.packages('gert') should "just work" on any hardware. You can reproduce the binaries using these instructions: https://github.com/autobrew/homebrew-linux

@jeroen jeroen closed this as completed Jan 27, 2021
@r-lib r-lib locked as resolved and limited conversation to collaborators Jan 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants