Problem loading HDF5Array in R 4.3.2
1
0
Entering edit mode
Sarah ▴ 10
@c3e29053
Last seen 10 months ago
United States

I recently updated R to 4.3.2 and reinstalled HDF5Array with no problem, but now running library(HDF5Array) crashes my R Studio session with the "R Session Aborted. R encountered a fatal error." popup.

I then tried running library(HDF5Array) in R on the terminal and got the following traceback:

 *** caught segfault ***
address 0x600000020, cause 'invalid permissions'

Traceback:
 1: H5Pcreate("H5P_FILE_ACCESS")
 2: H5Fcreate(file)
 3: h5createFile(filepath)
 4: .get_dump_autofile()
 5: setHDF5DumpDir()
 6: fun(libname, pkgname)
 7: doTryCatch(return(expr), name, parentenv, handler)
 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 9: tryCatchList(expr, classes, parentenv, handlers)
10: tryCatch(fun(libname, pkgname), error = identity)
11: runHook(".onLoad", env, package.lib, package)
12: loadNamespace(package, lib.loc)
13: doTryCatch(return(expr), name, parentenv, handler)
14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
15: tryCatchList(expr, classes, parentenv, handlers)
16: 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)})
17: library(HDF5Array)

I am not sure which permissions are invalid, as I can run commands like write.csv() to the current directory with no problems.

Here is my session info:

R version 4.3.2 (2023-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Big Sur 11.6

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/New_York
tzcode source: internal

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

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

Any help troubleshooting this would be greatly appreciated!

HDF5Array • 1.2k views
ADD COMMENT
0
Entering edit mode

Can you create an h5 file at all? Try:

library(rhdf5)
h5createFile("test.h5")
h5ls("test.h5")
# [1] group  name   otype  dclass dim   
# <0 rows> (or 0-length row.names)

If that crashes your session then try to reinstall Rhdf5lib and rhdf5 with:

BiocManager::install(c("Rhdf5lib", "rhdf5"), force=TRUE)

and run the above h5createFile() test again.

H.

sessionInfo():

R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 23.10

Matrix products: default
BLAS:   /home/hpages/R/R-4.3.0/lib/libRblas.so 
LAPACK: /home/hpages/R/R-4.3.0/lib/libRlapack.so;  LAPACK version 3.11.0

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

time zone: America/Los_Angeles
tzcode source: system (glibc)

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

other attached packages:
[1] rhdf5_2.46.0

loaded via a namespace (and not attached):
[1] compiler_4.3.0      rhdf5filters_1.14.1 Rhdf5lib_1.24.0
ADD REPLY
0
Entering edit mode

Thanks for the reply! I tried this and it is crashing at h5createFile("test.h5") even after reinstalling Rhdf5lib and rhdf5

It looks like the problem is specifically in the H5Pcreate("H5P_FILE_ACCESS") call, which is giving the error

 *** caught segfault ***
address 0x600000020, cause 'invalid permissions'

which is the only output to running

library(rhdf5)
H5Pcreate("H5P_FILE_ACCESS")

I just don't know how to find out what permissions it needs so I can update them.

Also-- in case it's helpful, here is the output of rhdf5::h5version()

This is Bioconductor rhdf5 2.46.0 linking to C-library HDF5 1.10.7 and rhdf5filters 1.14.1
ADD REPLY
2
Entering edit mode
Mike Smith ★ 6.6k
@mike-smith
Last seen 52 minutes ago
EMBL Heidelberg

Based on the error message this looks like the "invalid permissions" are referring to something in memory rather than your file system. If the only command you're running before the crash is H5Pcreate("H5P_FILE_ACCESS") then it doesn't even try to create any files. This is pretty mysterious as I've never seen this issue before, but HDF5Array is used by a lot of people so I'd have expected it to be reported before if there was a simple oversight in the rhdf5 package. I've tried to find the problem this morning, but drawn a blank so far.

Maybe you could try installing the packages from source, so they are compiled on your computer, rather than downloading the pre-built versions from Bioconductor. You can do that with the following command:

BiocManager::install(c("Rhdf5lib", "rhdf5"), force=TRUE, type = "source")

That might work straight away, or you might need to install some additional tools for doing the compiling. If that's the case I think you can follow the "Mandatory Tools" section of https://mac.r-project.org/tools/ to get the things you'll need.

ADD COMMENT
1
Entering edit mode

Thank you so much! This worked!

It installed from source with no problem and after restarting my R session, everything loads properly now.

Thanks again!

ADD REPLY
1
Entering edit mode

Great, I'm glad it worked. It's frustrating that the binary doesn't work for you; that shouldn't happen! However I'm not sure how to go about identifying the cause. If anyone else reports this issue I'll try looking deeper.

ADD REPLY
0
Entering edit mode

Hi Mike,

I encountered the exact same error, and your solution worked! Thank you!!

ADD REPLY

Login before adding your answer.

Traffic: 913 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6