JuliaInterop / JuliaInterop/JavaCall.jl
Compatibility with Threads?
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 125
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
Trying to run jcall in a separate thread kills the julia session:
PS > julia -i -t 8 --project -e "using JavaCall; JavaCall.init()"
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.5.1 (2020-08-25)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> versioninfo()
Julia Version 1.5.1
Commit 697e782ab8 (2020-08-25 20:08 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
julia> Threads.@spawn begin
jlm = @jimport java.lang.Math
jcall(jlm, "sin", jdouble, (jdouble,), pi/2)
end
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x708e3523 -- JVM_ResolveClass at C:\Program Files\Java\jre1.8.0_181\bin\server\jvm.dll (unknown line)
in expression starting at none:0
JVM_ResolveClass at C:\Program Files\Java\jre1.8.0_181\bin\server\jvm.dll (unknown line)
unknown function (ip: AA0000000006F755)
Allocations: 14080219 (Pool: 14076404; Big: 3815); GC: 14
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Julia 1.5.1 Windows command with JavaCall.init() and the shown Threads.@spawn block. Trace the interaction among @jimport, jcall, and the JVM when called from a spawned thread. Done means the session no longer crashes and the Java method call completes successfully from that thread.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, julia
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100