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

*** caught illegal operation *** with arrow 9.0.0 #2019

Closed
LukeLR opened this issue Oct 18, 2022 · 1 comment
Closed

*** caught illegal operation *** with arrow 9.0.0 #2019

LukeLR opened this issue Oct 18, 2022 · 1 comment

Comments

@LukeLR
Copy link

LukeLR commented Oct 18, 2022

Describe the bug
When loading the sf library using library(sf) with Apache Arrow v9.0.0 installed, loading fails with

 *** caught illegal operation ***
address 0x55885d9492f8, cause 'unknown'

causing the entire R session to crash. The address pointer of course changes every time, as the virtual memory gets randomly assigned. The full traceback is included in the details.

To Reproduce

  1. Install current Apache Arrow version 9.0.0 and current R version 4.2.1
  2. Install sf from CRAN (e.g. using install.packages('sf'))
  3. Execute Rscript -e 'library(sf)'.

Additional context
Add any other context about the problem here.

:~$ uname -a
Linux Arch 5.15.74-1-lts #1 SMP Sat, 15 Oct 2022 06:43:47 +0000 x86_64 GNU/Linux
Paste the output of your `sessionInfo()` and `sf::sf_extSoftVersion()`
> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Arch Linux

Matrix products: default
BLAS:   /usr/lib/libblas.so.3.10.1
LAPACK: /usr/lib/liblapack.so.3.10.1

locale:
[1] C

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

loaded via a namespace (and not attached):
[1] compiler_4.2.1
> sf::sf_extSoftVersion()
          GEOS           GDAL         proj.4 GDAL_with_GEOS     USE_PROJ_H 
      "3.11.0"        "3.5.1"        "9.0.1"         "true"         "true" 
          PROJ 
       "9.0.1" 
There were 12 warnings (use warnings() to see them)

Of course, sf::sf_extSoftVersion() only works without arrow 9.0.0 installed, as otherwise it will also crash the R session. Full traceback of the crash when loading the library:

> library(sf)

 *** caught illegal operation ***
address 0x55ffea656380, cause 'unknown'

Traceback:
 1: CPL_gdal_init()
 2: load_gdal()
 3: fun(libname, pkgname)
 4: doTryCatch(return(expr), name, parentenv, handler)
 5: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 6: tryCatchList(expr, classes, parentenv, handlers)
 7: tryCatch(fun(libname, pkgname), error = identity)
 8: runHook(".onLoad", env, package.lib, package)
 9: loadNamespace(package, lib.loc)
10: doTryCatch(return(expr), name, parentenv, handler)
11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
12: tryCatchList(expr, classes, parentenv, handlers)
13: 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 && !quietly)         message(paste("Error:", msg), domain = NA)    else stop(msg, call. = FALSE, domain = NA)})
14: library(sf)
@LukeLR
Copy link
Author

LukeLR commented Oct 18, 2022

Apparently, this bug is caused by the way Apache Arrow is packaged in Arch Linux. The PKGBUILD contains the -DARROW_SIMD_LEVEL=AVX2 flag, which makes the package require AVX2 extensions. This of course fails on CPUs not supporting AVX2 as in my case. Removing this flag from the PKGBUILD fixes the issue. A bug report in the Arch Linux Bugtracker is already opened: https://bugs.archlinux.org/task/75747 This issue is also discussed in apache/arrow#12681 as well as in OSGeo/gdal#6150. I nevertheless opened this issue here, so other users stumbling across a similar error might find this solution.

@LukeLR LukeLR closed this as completed Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant