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

InChIKey functionality crashes with "Exception: java.lang.StackOverflowError thrown from the UncaughtExceptionHandler in thread "process reaper"" #139

Open
meowcat opened this issue Jan 13, 2023 · 6 comments

Comments

@meowcat
Copy link

meowcat commented Jan 13, 2023

I describe the issue here because rinchi is just a wrapper around this functionality, and nothing we can change in rinchi would make a difference to this issue:

library(rcdk)
library(rinchi)
mol <- parse.smiles("CCCC")
rinchi::get.inchi.key(mol[[1]])

results in:
Exception: java.lang.StackOverflowError thrown from the UncaughtExceptionHandler in thread "process reaper"

To reproduce:

docker run --rm -it bioconductor/bioconductor_docker:devel
# in the docker
apt-get update
apt-get install openjdk-17-jdk-headless
# same error with built-in jdk11 and with jdk18 and 19
R CMD javareconf
R

in R:

install.packages(c("rcdk", "rJava")) # alternatively from github
install.packages("remotes")
remotes::install_github("CDK-R/rinchi")

Digging into the haystack, I can trigger the error by doing:

jnainchi<- J("io.github.dan2097.jnainchi.JnaInchi")
which is used called in CDK here:
https://github.com/cdk/cdk/blob/d60aaa15c9c4edb3a0103e6d5a1d8ffacc235435/storage/inchi/src/main/java/org/openscience/cdk/inchi/InChIGenerator.java#L537

System (please complete the following information):

  • OS: The docker is based on Ubuntu 22.04.1, the host is running Debian 10.
  • Java Version: tested 11, 17, 18, 19
  • R Version: R-devel as of today
    Tested from both commandline R and Rstudio.

Interestingly, I do not have the error on R 4.2.0, rJava 1.0-6, rcdk 3.7.0, rcdklibs 2.8 on Windows.


 setting  value
 version  R Under development (unstable) (2023-01-10 r83596)
 os       Ubuntu 22.04.1 LTS
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Etc/UTC
 date     2023-01-13
 pandoc   2.19.2 @ /usr/local/bin/pandoc


 package     * version date (UTC) lib source
 cli           3.6.0   2023-01-09 [1] CRAN (R 4.3.0)
 fingerprint   3.5.7   2018-01-07 [1] CRAN (R 4.3.0)
 iterators     1.0.14  2022-02-05 [1] CRAN (R 4.3.0)
 itertools     0.1-3   2014-03-12 [1] CRAN (R 4.3.0)
 png           0.1-8   2022-11-29 [1] CRAN (R 4.3.0)
 rcdk        * 3.7.0   2023-01-13 [1] Github (CDK-R/cdkr@95f7e23)
 rcdklibs    * 2.8     2023-01-13 [1] Github (CDK-R/rcdklibs@55dbd00)
 rinchi      * 0.5     2023-01-13 [1] Github (CDK-R/rinchi@f1a61f5)
 rJava       * 1.0-6   2021-12-10 [1] CRAN (R 4.3.0)
 sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.3.0)

 [1] /usr/local/lib/R/site-library
 [2] /usr/local/lib/R/library

Additional context
Add any other context about the problem here.

@meowcat
Copy link
Author

meowcat commented Jan 13, 2023

Same problem with R 4.2.2 from bioconductor/bioconductor_docker:RELEASE_3_16

@meowcat
Copy link
Author

meowcat commented Jan 13, 2023

Tested on two completely different machines

@meowcat
Copy link
Author

meowcat commented Jan 13, 2023

Same problem with R 4.2.1 from bioconductor/bioconductor_docker:RELEASE_3_15

@meowcat
Copy link
Author

meowcat commented Jan 13, 2023

Note: this issue arose with rcdklibs 2.8
Provisional workaround:

remotes::install_github("CDK-R/rcdklibs@c1f2d125cb00e09c8aac815107b54fe1ef8ebe8f")
remotes::install_github("CDK-R/cdkr/rcdk@cef1eed1555947ed82e8303cb6d79c77fd89b3c1")

@zachcp
Copy link
Contributor

zachcp commented Feb 12, 2023

Hmmm. Works fine for me. Not sure whats happening.

library(rcdk)
library(rinchi)

mol <- parse.smiles("CCCC")
rinchi::get.inchi.key(mol[[1]])
[1] "IJDNQMDRQITEOD-UHFFFAOYSA-N"

> .jcall("java/lang/System", "S", "getProperty", "java.runtime.version")
[1] "17.0.6+10-jvmci-22.3-b13"

@meowcat
Copy link
Author

meowcat commented Feb 23, 2023

Are you on Windows? Linux?
For me this happens on Linux, as shown above.

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

2 participants