r-hub / rhub

R-hub API client
https://r-hub.github.io/rhub/
Other
353 stars 52 forks source link

clang16-20 - testthat - unable to load shared object undefined symbol: __asan_register_elf_globals #645

Open shail-choksi opened 1 day ago

shail-choksi commented 1 day ago

I am facing an issue that I don't understand with rhub:

  Error in `FUN()`:
  ! In path: "/__w/ToxicR/ToxicR/check/ToxicR.Rcheck/tests/testthat/helper.R"
  Caused by error:
  ! package or namespace load failed for 'actuar' in dyn.load(file, DLLpath = DLLpath, ...):
   unable to load shared object '/github/home/R/x86_64-pc-linux-gnu-library/4.5/expint/libs/expint.so':
    /github/home/R/x86_64-pc-linux-gnu-library/4.5/expint/libs/expint.so: undefined symbol: __asan_register_elf_globals
  Backtrace:
       ▆
    1. ├─testthat::test_check("ToxicR", dir = tempdir())
    2. │ └─testthat::test_dir(...)
    3. │   └─testthat:::test_files(...)
    4. │     └─testthat:::test_files_serial(...)
    5. │       └─testthat:::test_files_setup_state(...)
    6. │         └─testthat::source_test_helpers(".", env)
    7. │           └─testthat::source_dir(path, "^helper.*\\.[rR]$", env = env, wrap = FALSE)
    8. │             └─base::lapply(...)
    9. │               └─testthat (local) FUN(X[[i]], ...)
   10. │                 └─testthat::source_file(path, env = env, chdir = chdir, wrap = wrap)
   11. │                   ├─base::withCallingHandlers(...)
   12. │                   └─base::eval(exprs, env)
   13. │                     └─base::eval(exprs, env)
   14. │                       └─base::library(actuar) at tests/testthat/helper.R:1:1
   15. │                         └─base::tryCatch(...)
   16. │                           └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   17. │                             └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   18. │                               └─value[[3L]](cond)
   19. │                                 └─base::stop(msg, call. = FALSE, domain = NA)
   20. └─base::.handleSimpleError(...)
   21.   └─testthat (local) h(simpleError(msg, call))
   22.     └─rlang::abort(...)
  Execution halted

Full logs here: https://github.com/SciomeLLC/ToxicR/actions/runs/11802401294/job/32878139449

but the rhub pipeline passes for clang-asan. See the same link above.

Has anyone seen this before?

gaborcsardi commented 1 day ago

Seems like a bug, an incompatible binary package. I'll try to fix it soon.

shail-choksi commented 1 day ago

Thank you!

In the same runs there's also this:

https://github.com/SciomeLLC/ToxicR/actions/runs/11802401294/job/32878144042

Is that another bug? Should I make another issue for it?

gaborcsardi commented 1 day ago

I am sorry, I don't know what you are referring to. Which line(s) specifically?

sciome-bot commented 1 day ago

I am referring to:

* DONE (ToxicR)
objdump: Warning: Unrecognized form: 0x23
objdump: Warning: Unrecognized form: 0x23
objdump: Warning: Unrecognized form: 0x23
...
==== rchk bcheck =========================================
ERROR: too many states (abstraction error?) in function strptime_internal
ERROR: too many states (abstraction error?) in function bcEval_loop
ERROR: too many states (abstraction error?) in function StringValue
ERROR: too many states (abstraction error?) in function RunGenCollect

Function Rcpp::Armor<SEXPREC*>::init(SEXPREC*)
  [PB] has possible protection stack imbalance /github/home/R/x86_64-pc-linux-gnu-library/4.5/Rcpp/include/Rcpp/protection/Armor.h:47

Function Rcpp::Armor<SEXPREC*>::~Armor()
  [PB] has negative depth /github/home/R/x86_64-pc-linux-gnu-library/4.5/Rcpp/include/Rcpp/protection/Armor.h:41
  [UP] attempt to unprotect more items (1) than protected (0), results will be incomplete /github/home/R/x86_64-pc-linux-gnu-library/4.5/Rcpp/include/Rcpp/protection/Armor.h:41
  [PB] has possible protection stack imbalance /github/home/R/x86_64-pc-linux-gnu-library/4.5/Rcpp/include/Rcpp/protection/Armor.h:42

@gaborcsardi

gaborcsardi commented 1 day ago

No, that's not a bug in R-hub.

gaborcsardi commented 1 day ago

This is a bug in the cache key, the GHA cache is shared between the clang-asan and the other clang containers, but some packages built from source in clang-asan are not compatible with the other clang containers. A workaround for now is to clear the cache, this one:

Cache restored from key: Ubuntu 22.04.5 LTS-R version 4.5.0 (ge:16; iid:2fdf6c18-697a-4ba7-b8ef-11c0d92f1327)-ubuntu-22.04/4.5/libc++-eddfd8cb31dcb45997399a16d4083e1cb8b21bca1123f96cbbde4a020d483db4

https://github.com/SciomeLLC/ToxicR/actions/runs/11802401294/job/32878139449#step:5:5202

I'll have to think what to do with the cache key, so this does not happen.