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

Julia crashes with EXCEPTION_ACCESS_VIOLATION when loading RCall #381

Closed
EHBaozi opened this issue May 8, 2020 · 9 comments · Fixed by #382
Closed

Julia crashes with EXCEPTION_ACCESS_VIOLATION when loading RCall #381

EHBaozi opened this issue May 8, 2020 · 9 comments · Fixed by #382

Comments

@EHBaozi
Copy link

EHBaozi commented May 8, 2020

Full stacktrace:

Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ff9cf7dd501 -- strlen at C:\WINDOWS\System32\msvcrt.dll (unknown line)
in expression starting at REPL[1]:1
strlen at C:\WINDOWS\System32\msvcrt.dll (unknown line)
R_Suicide at C:\r\r-3.6.3\bin\x64\R.dll (unknown line)
initEmbeddedR at C:\Users\invis\.julia\packages\RCall\jOnwc\src\setup.jl:116
__init__ at C:\Users\invis\.julia\packages\RCall\jOnwc\src\setup.jl:189
unknown function (ip: 000000001B231A57)
jl_apply at /cygdrive/d/buildbot/worker/package_win64/build/src\julia.h:1700 [inlined]
jl_module_run_initializer at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:74
jl_init_restored_modules at /cygdrive/d/buildbot/worker/package_win64/build/src\dump.c:2519
_include_from_serialized at .\loading.jl:697
_require_search_from_serialized at .\loading.jl:781
_require at .\loading.jl:1006
require at .\loading.jl:927
require at .\loading.jl:922
jl_apply at /cygdrive/d/buildbot/worker/package_win64/build/src\julia.h:1700 [inlined]
call_require at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:399 [inlined]
eval_import_path at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:436
jl_toplevel_eval_flex at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:656
jl_toplevel_eval_flex at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:764
jl_toplevel_eval at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:823 [inlined]
jl_toplevel_eval_in at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:843
eval at .\boot.jl:331
eval_user_input at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\REPL\src\REPL.jl:86
run_backend at C:\Users\invis\.julia\packages\Revise\MgvIv\src\Revise.jl:1023
jl_apply at /cygdrive/d/buildbot/worker/package_win64/build/src\julia.h:1700 [inlined]
do_call at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:369
eval_value at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:458
eval_stmt_value at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:409 [inlined]
eval_body at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:799
jl_interpret_toplevel_thunk at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:911
jl_toplevel_eval_flex at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:814
jl_toplevel_eval at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:823 [inlined]
jl_toplevel_eval_in at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:843
eval at .\boot.jl:331
eval_user_input at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\REPL\src\REPL.jl:86
macro expansion at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\REPL\src\REPL.jl:118 [inlined]
#26 at .\task.jl:358
jl_apply at /cygdrive/d/buildbot/worker/package_win64/build/src\julia.h:1700 [inlined]
start_task at /cygdrive/d/buildbot/worker/package_win64/build/src\task.c:687
Allocations: 13539571 (Pool: 13536549; Big: 3022); GC: 13

Steps to reproduce: simply run using RCall in a Julia REPL.

versioninfo:

julia> versioninfo()
Julia Version 1.4.1
Commit 381693d3df* (2020-04-14 17:20 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 4
  JULIA_CUDA_USE_BINARYBUILDER = false

There is another issue #368 reporting EXCEPTION_ACCESS_VIOLATION but it seems to have a different cause. Not sure whether they are related.

@randy3k
Copy link
Member

randy3k commented May 8, 2020

Did you set R_USER or R_HOME?

@EHBaozi
Copy link
Author

EHBaozi commented May 8, 2020

Setting/unsetting R_HOME has no impact, the crash happens regardless.

Where should R_USER point to?

@randy3k
Copy link
Member

randy3k commented May 8, 2020

You shouldn't need to set R_USER. I was just guessing if it could be an invalid R_HOME because you have a non standard installation of R.

@randy3k
Copy link
Member

randy3k commented May 8, 2020

Could you check if #382 fix you case?

@EHBaozi
Copy link
Author

EHBaozi commented May 8, 2020

It does!

@randy3k
Copy link
Member

randy3k commented May 8, 2020

So it is indeed a R_HOME issue.

Your system somehow has multiple versions of R and RCall got confused when the R_HOME from different versions do not match.

@EHBaozi
Copy link
Author

EHBaozi commented May 8, 2020

How though? I only have one version of R installed.

@randy3k
Copy link
Member

randy3k commented May 8, 2020

Perhaps the previous installation has left some registry records.

@vlepori
Copy link

vlepori commented Sep 29, 2020

I have the same issue. If I just load RCall, Julia crashes with
EXCEPTION_ACCESS_VIOLATION at 0x7ffc0126d721 -- strlen at C:\Windows\System32\msvcrt.dll (unknown line)

If I run ENV["R_HOME"] = "C:\\Program Files\\R\\R-3.6.1" before loading RCall, then everything runs fine. But I have to do this upon starting each new Julia session, despite rebuilding the package.

  • R.home() or R RHOME in the terminal both return the path above, but as a short filename: "C:/PROGRA~1/R/R-36~1.1"
  • The only windows registry entry for R points to "C:\Program Files\R\R-3.6.1"
  • R is in my PATH

Windows 10, Julia 1.5.1. Could it be a path format problem?

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

Successfully merging a pull request may close this issue.

3 participants