segfault in MacOS
Closed this issue · 4 comments
I am trying to start a spark session in MacOS but I get a segfault.
JavaCall seems to be working fine.
julia> using Spark
julia> Spark.init()
[ Info: JavaCall could not determine javapath from `which java`
signal (11): Segmentation fault: 11
in expression starting at REPL[2]:1
unknown function (ip: 0x13ac8162d)
Allocations: 9175285 (Pool: 9172289; Big: 2996); GC: 10
julia> using JavaCall
julia> JavaCall.init()
ERROR: JavaCall.JavaCallError("JVM already initialised")
Stacktrace:
[1] assertnotloaded at /Users/jdlara/.julia/packages/JavaCall/aVXyt/src/jvm.jl:242 [inlined]
[2] _init(::Array{String,1}) at /Users/jdlara/.julia/packages/JavaCall/aVXyt/src/jvm.jl:284
[3] init() at /Users/jdlara/.julia/packages/JavaCall/aVXyt/src/jvm.jl:277
[4] top-level scope at REPL[4]:1
In my terminal which java quickly determines the Java version and location
~/cache/blue_texas which java
/usr/bin/java
~/cache/blue_texas java --version
openjdk 15.0.1 2020-10-20
OpenJDK Runtime Environment AdoptOpenJDK (build 15.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 15.0.1+9, mixed mode, sharing)
Please take a look at JuliaInterop/JavaCall.jl#133 and let me know if it resolves the issue.
I set up the environmental variable export JAVA_HOME="/Library/Java/JavaVirtualMachines/openjdk-15.jdk/Contents/Home"
in my mac but it gives me the same issue.
Well, first of all it doesn't look like an issue in Spark, but rather in JavaCall. To confirm, try to run only:
using JavaCall
JavaCall.init()
Second, citing Avik's reply in that thread:
Ok, so this is expected. As I mentioned on slack, the segfault that you see on the Mac is expected. This segfault is thrown and caught inside the JVM, but since Julia also installs a signal handler, it is reported. Since it's caught inside the JVM, it is harmless. The JVM uses segfaults as a performance optimization.
So the first thing to check is whether you can get Julia prompt back after the segfault message. If you do, you can safely ignore it and continue the work.
Indeed, all of this is documented in our FAQ: https://juliainterop.github.io/JavaCall.jl/faq.html