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

Fatal Error #315

Closed
ECDelmelle opened this issue Feb 1, 2023 · 21 comments
Closed

Fatal Error #315

ECDelmelle opened this issue Feb 1, 2023 · 21 comments

Comments

@ECDelmelle
Copy link

ECDelmelle commented Feb 1, 2023

I am getting a 'fatal error' (with a scary picture of a bomb) that shuts down R studio when I try to run r5r -- either with the sample data or my own.

Here are the details:

r5r::r5r_sitrep()
$r5r_package_version
[1] ‘1.0.0’

$r5_jar_version
[1] "6.8"

$java_version
[1] "11.0.18"

$set_memory
[1] "-Xmx20G"

$session_info
R version 4.2.2 (2022-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.0

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

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

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

other attached packages:
[1] dplyr_1.0.10      interp_1.1-3      ggplot2_3.3.6     data.table_1.14.2 r5r_1.0.0        

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9         pillar_1.8.1       compiler_4.2.2     class_7.3-20       tools_4.2.2       
 [6] lifecycle_1.0.1    tibble_3.1.8       gtable_0.3.1       pkgconfig_2.0.3    rlang_1.0.5       
[11] DBI_1.1.3          cli_3.3.0          rstudioapi_0.14    rJava_1.0-6        e1071_1.7-11      
[16] withr_2.5.0        generics_0.1.3     vctrs_0.4.1        classInt_0.4-7     grid_4.2.2        
[21] tidyselect_1.1.2   glue_1.6.2         sf_1.0-9           R6_2.5.1           fansi_1.0.3       
[26] purrr_0.3.4        deldir_1.0-6       magrittr_2.0.3     scales_1.2.1       units_0.8-0       
[31] assertthat_0.2.1   colorspace_2.0-3   utf8_1.2.2         KernSmooth_2.23-20 proxy_0.4-27      
[36] munsell_0.5.0     
@rafapereirabr
Copy link
Member

Hi Elizabeth. Thanks for opening this issue. Everything looks fine with the installation from what I can see. Could you please restart your R session and run this code below?

options(java.parameters = '-Xmx4G')

library(r5r)

# build transport network
data_path <- system.file("extdata/poa", package = "r5r")
r5r_core <- setup_r5(data_path, overwrite = T)

# load origin/destination points
points <- read.csv(file.path(data_path, "poa_points_of_interest.csv"))

departure_datetime <- as.POSIXct(
  "13-05-2019 14:00:00",
  format = "%d-%m-%Y %H:%M:%S"
)

ttm <- travel_time_matrix(
  r5r_core,
  origins = points,
  destinations = points,
  mode = c("WALK", "TRANSIT"),
  departure_datetime = departure_datetime,
  max_trip_duration = 60, 
  progress = T
)

head(ttm)

This should give you this ouput:

#>          from_id               to_id travel_time_p50
#> 1: public_market       public_market               0
#> 2: public_market bus_central_station              13
#> 3: public_market    gasometer_museum              10
#> 4: public_market santa_casa_hospital              15
#> 5: public_market            townhall               3
#> 6: public_market     piratini_palace              17

Please, let me know if it works. If not, please paste the error message you get.

ps. I've never seen an error message with the picture of a bomb before, so now I'm really curious. If it happens again, could please share a printscreen of the picture ?

@ECDelmelle
Copy link
Author

ECDelmelle commented Feb 1, 2023

That caused the bomb!
Screenshot 2023-02-01 at 9 54 02 AM

It also left me a note (error log) in my project folder with some error details that points to Java being the culprit. I can do some further digging unless something comes to your mind in dealing with this!

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000000287af03d4, pid=54031, tid=259
#
# JRE version: Java(TM) SE Runtime Environment 18.9 (11.0.18+9) (build 11.0.18+9-LTS-195)
# Java VM: Java HotSpot(TM) 64-Bit Server VM 18.9 (11.0.18+9-LTS-195, mixed mode, tiered, compressed oops, g1 gc, bsd-aarch64)
# Problematic frame:
# J 535 c2 java.lang.StringLatin1.replace([BCC)Ljava/lang/String; java.base@11.0.18 (196 bytes) @ 0x0000000287af03d4 [0x0000000287af0300+0x00000000000000d4]
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

@rafapereirabr
Copy link
Member

Ah, that bomb! Did you install your jdk from here?

@ECDelmelle
Copy link
Author

yes, but version 11 right? I had 19 installed, then got a different error, so I installed 11 and then had both and finally, got rid of 19. Then the bombs began...

@rafapereirabr
Copy link
Member

Yes, it's version 11. I can only suspect that some important files must have been deleted when you unnistaled v. 19. Try reinstalling jdk 11 again and see it works

@ECDelmelle
Copy link
Author

nothin' but bombs. I uninstalled and re-installed Java. No luck. Had a friend try with a slightly older Mac - we followed the identical steps and her's ended up running. So its not you! Will keep searching for a solution.

@rafapereirabr
Copy link
Member

rafapereirabr commented Feb 3, 2023

Hey Elizabeth, any updates? I hope you've managed to disarm the bombs. I assume it is something to do with the Java installation

@ECDelmelle
Copy link
Author

ECDelmelle commented Feb 3, 2023 via email

@rafapereirabr
Copy link
Member

Gee.

Ok, try this.

  • Restart R
  • Open command prompt (I think it's called 'terminal' in MacOS) and run "ulimit -c unlimited"
  • Then try running the code of the example above

@ECDelmelle
Copy link
Author

ECDelmelle commented Feb 5, 2023 via email

@rafapereirabr
Copy link
Member

On a quick search, I came across this possible patch to the problem https://stackoverflow.com/questions/67849830/how-to-install-rjava-package-in-mac-with-m1-architecture

@rafapereirabr
Copy link
Member

Hi @ECDelmelle . Have you had any success with this problem?

@charperflow
Copy link

Hi Rafapereirabr. I know I'm not the original poster, but I am also having the same Issue. I followed thelink above, and I was able to install jdk version 11 and load the rjava library just fine, however, I am still getting the bomb! I have attached the error report generated by the session in case that is helpful. Let me know if you need anymore information!
rsession-arm64-2023-02-24-153614.txt

@rafapereirabr
Copy link
Member

Thanks for your message @charperflow. I see you also use MacBook with ARM cpu processor, so it serves as additional evidence this is a compatibility issue between jdk 11 and ARM cpu processors. I'm sorry there is nothing we can do from our side to help address this issue

@jleape
Copy link

jleape commented Aug 18, 2023

Had the same issue with my ARM mac. Would love to know if anyone figures out a work around!

@hphoebe
Copy link

hphoebe commented Oct 6, 2023

For any future users with mac ARM processors facing this issue, I followed the steps from https://stackoverflow.com/questions/67849830/how-to-install-rjava-package-in-mac-with-m1-architecture (installing a x86_64 build of Java SDK version 11 from AdoptOpenJDK to be compatible with a x86_64 build of R) and was able to bypass the fatal error and run the example in this thread (albeit with some warnings during setup_r5).
terminal.txt

@rafapereirabr
Copy link
Member

Thanks so much for sharing the solution you have found @hphoebe !

@higgicd
Copy link

higgicd commented Dec 4, 2023

I can confirm the sample code above now works fine with the dev version and Java SDK 21 on my M2 MacBook!

@rafapereirabr
Copy link
Member

This is great. Thanks @higgicd .

@ECDelmelle , @hphoebe, @jleape and @charperflow. Could any of you please check wether the issue persists in your computer? See code below:

Clean install of dev version

utils::remove.packages('r5r')
devtools::install_github("ipeaGIT/r5r", subdir = "r-package")

Test code

options(java.parameters = '-Xmx4G')

library(r5r)

# build transport network
data_path <- system.file("extdata/poa", package = "r5r")
r5r_core <- setup_r5(data_path, overwrite = T)

# load origin/destination points
points <- read.csv(file.path(data_path, "poa_points_of_interest.csv"))

departure_datetime <- as.POSIXct(
  "13-05-2019 14:00:00",
  format = "%d-%m-%Y %H:%M:%S"
)

ttm <- travel_time_matrix(
  r5r_core,
  origins = points,
  destinations = points,
  mode = c("WALK", "TRANSIT"),
  departure_datetime = departure_datetime,
  max_trip_duration = 60, 
  progress = T
)

head(ttm)

@ECDelmelle
Copy link
Author

ECDelmelle commented Dec 5, 2023 via email

@rafapereirabr
Copy link
Member

Wonderful. Thanks for the feedback, @ECDelmelle . Closing this issue for now. We're planning a new update of r5r v2.0.0 soon and this issue should be fixed for good. Closing it for now.

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

6 participants