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

Continued R-Studio Crashing... suggestions? #8

Open
jlhanson5 opened this issue Jan 29, 2025 · 5 comments
Open

Continued R-Studio Crashing... suggestions? #8

jlhanson5 opened this issue Jan 29, 2025 · 5 comments

Comments

@jlhanson5
Copy link

jlhanson5 commented Jan 29, 2025

Hello VertexWiseR colleagues,

I keep trying to run the VertexWiseR_Example_1, but keep getting a fatal error crash.

Image

Here's my R sessionInfo()

> sessionInfo()
R version 4.4.2 (2024-10-31)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.1.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.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/Mexico_City
tzcode source: internal

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

other attached packages:
[1] VertexWiseR_1.2.0

loaded via a namespace (and not attached):
 [1] rappdirs_0.3.3           tidyr_1.3.1              plotly_4.10.4           
 [4] utf8_1.2.4               generics_0.1.3           bitops_1.0-9            
 [7] xml2_1.3.6               stringi_1.8.4            lattice_0.22-6          
[10] oro.nifti_0.11.4         digest_0.6.37            magrittr_2.0.3          
[13] grid_4.4.2               RColorBrewer_1.1-3       iterators_1.0.14        
[16] fastmap_1.2.0            Matrix_1.7-1             jsonlite_1.8.9          
[19] R.oo_1.26.0              foreach_1.5.2            doParallel_1.0.17       
[22] R.utils_2.12.3           doSNOW_1.0.20            httr_1.4.7              
[25] RNifti_1.7.0             purrr_1.0.2              fansi_1.0.6             
[28] viridisLite_0.4.2        scales_1.3.0             freesurferformats_0.1.18
[31] lazyeval_0.2.2           codetools_0.2-20         abind_1.4-8             
[34] cli_3.6.3                rlang_1.1.4              R.methodsS3_1.8.2       
[37] gifti_0.8.0              munsell_0.5.1            splines_4.4.2           
[40] base64enc_0.1-3          tools_4.4.2              parallel_4.4.2          
[43] dplyr_1.1.4              colorspace_2.1-1         ggplot2_3.5.1           
[46] reticulate_1.39.0        png_0.1-8                vctrs_0.6.5             
[49] R6_2.5.1                 lifecycle_1.0.4          stringr_1.5.1           
[52] htmlwidgets_1.6.4        fs_1.6.4                 pkgconfig_2.0.3         
[55] pillar_1.9.0             gtable_0.3.5             glue_1.8.0              
[58] data.table_1.16.2        Rcpp_1.0.13              tibble_3.2.1            
[61] tidyselect_1.2.1         rstudioapi_0.16.0        ciftiTools_0.16.1       
[64] htmltools_0.5.8.1        snow_0.4-4               igraph_2.0.3            
[67] pkgfilecache_0.1.5       compiler_4.4.2 

Has anyone run into this? I uninstalled VertexWiseR and then reinstalled it... but still the same issue. Other suggestions?

Many thanks in advance for advice,
Jamie.

@chabld
Copy link
Collaborator

chabld commented Jan 31, 2025

Hi @jlhanson5

I note that you are trying to apply a smoothing again in RFT_vertex_analysis() on top of your already smoothed surface data. The "smooth_FWHM" argument is optional in RFT_vertex_analysis(), since you can also smooth it separately, just like you did here. I could not reproduce the issue on windows or mac so I doubt that's the cause.

Maybe that will help if you could:

  • report your version of python and numpy? (You can do this with reticulate::py_config() or reticulate::py_discover_config() should print them out)
  • If using miniconda, report your version of it (printed by reticulate::conda_version())
  • report your version of packages "brainspace" and "brainstat" (printed by reticulate::py_list_packages() )

We had to define default versions for some of them as incompatibility issues arose (e.g., Python v3.13 not working with Brainstat).

Looking at your app log may also inform you about the latest crash but I am not sure.

@jlhanson5
Copy link
Author

Hello @chabld!

Thanks for these notes! Here's system info thus far:

> reticulate::py_config()
python:         /Users/jamielarshanson/Library/r-miniconda-arm64/envs/r-reticulate/bin/python
libpython:      /Users/jamielarshanson/Library/r-miniconda-arm64/envs/r-reticulate/lib/libpython3.10.dylib
pythonhome:     /Users/jamielarshanson/Library/r-miniconda-arm64/envs/r-reticulate:/Users/jamielarshanson/Library/r-miniconda-arm64/envs/r-reticulate
version:        3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:51:49) [Clang 16.0.6 ]
numpy:          /Users/jamielarshanson/Library/r-miniconda-arm64/envs/r-reticulate/lib/python3.10/site-packages/numpy
numpy_version:  1.26.4

> reticulate::conda_version()
[1] "conda 24.5.0"

> reticulate::py_list_packages()
8                 brainspace       0.1.16                   brainspace=0.1.16        pypi
9                  brainstat        0.4.2                     brainstat=0.4.2        pypi

My log hasn't added any content after the crash, so not sure about next steps there. But any ideas based on these versions of programs about how to troubleshoot?

Thanks much,
Jamie.

@chabld
Copy link
Collaborator

chabld commented Feb 5, 2025

I don't think any of these versions are causing the problem as I tried with lower and higher versions of both Python/Conda, and the rest of them are as they should be (also, the smoothing function calls Python already, which caused no difficulty for you).

You could try:

  • running debug(RFT_vertex_analysis) first and then running the model, which could give you a rough idea of the point at which RStudio crashes
  • running TFCE_vertex_analysis on the data instead (this one does not require Python which would rule out Python issues)
  • running the model in a subset of the dataset (e.g., 10) instead of the 238 participants. This would suggest it's a memory issue (as it seems to be a common explanation for these crashes)
  • running the script in R on its own (without the RStudio GUI), which would suggest the issue is with RStudio.

It is difficult to troubleshoot without a log of the issues. I read here that you could use crash report utilities from Mac OS (although this may be only applicable for a total RStudio crash and not for an aborted R session):
https://developer.apple.com/documentation/xcode/diagnosing-issues-using-crash-reports-and-device-logs
https://developer.apple.com/documentation/xcode/acquiring-crash-reports-and-diagnostic-logs

@jlhanson5
Copy link
Author

I will dig into that troubleshooting advice... I really appreciate it. Of note, students in our group reported to me some similar issues, and the only commonality is that we all are using Apple M1 chip. Do you know if that might be connected to things?

Many thanks again for all the help!

@chabld
Copy link
Collaborator

chabld commented Feb 13, 2025

I honestly do not know, but searching for relating issues does suggest some people have had crashes with Apple M1 chip in other R packages as well:
apache/arrow#32136
https://www.reddit.com/r/RStudio/comments/tupg3y/comment/i35j452/
This may or may not also conflict with miniconda/reticulate, although so far it does not seem to be the case:
rstudio/reticulate#1019

I can confirm the mac device I have been testing the package on has an intel chip, not M1, so I am unable to verify that. Do let us know about the various solutions!

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