JuliaLang / Pkg.jl

Pkg - Package manager for the Julia programming language
https://pkgdocs.julialang.org
Other
621 stars 261 forks source link

Unhandled InterruptException during precompilation #2648

Open Octogonapus opened 3 years ago

Octogonapus commented 3 years ago

I interrupted the automatic precompilation with ^C and the subsequent InterruptException was not handled, causing Julia to crash:

Precompiling project...
  Progress [========================>                ]  6/10
  ✓ PrettyTables
  ◒ Flux
^Cfatal: error thrown and no exception handler available.
InterruptException()
jl_mutex_unlock at /buildworker/worker/package_linux64/build/src/locks.h:134 [inlined]
jl_task_get_next at /buildworker/worker/package_linux64/build/src/partr.c:475
poptask at ./task.jl:760
wait at ./task.jl:768 [inlined]
task_done_hook at ./task.jl:494
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1703 [inlined]
jl_finish_task at /buildworker/worker/package_linux64/build/src/task.c:208
start_task at /buildworker/worker/package_linux64/build/src/task.c:850
unknown function (ip: (nil))
julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 16
  JULIA_EDITOR = /usr/bin/code
  JULIA_PKG_SERVER =
IanButterworth commented 3 years ago

@vtjnash i don't believe this is a Pkg issue. Any idea?

IanButterworth commented 2 years ago

Seen in 1.6.3

Precompiling project...
  Progress [========>                                ]  14/76
  ◓ ModernGL
  ◒ GPUArrays
  ◓ MutableArithmetics
  ✓ ChainRulesCore
...
^Cfatal: error thrown and no exception handler available.
InterruptException()
jl_task_get_next at /Applications/Julia-1.6.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.6.dylib (unknown line)
poptask at ./task.jl:760
wait at ./task.jl:769
task_done_hook at ./task.jl:494
jl_apply_generic at /Applications/Julia-1.6.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.6.dylib (unknown line)
jl_finish_task at /Applications/Julia-1.6.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.6.dylib (unknown line)
start_task at /Applications/Julia-1.6.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.6.dylib (unknown line)
KristofferC commented 2 years ago

I think that the interruption has to be disabled until a known safe point if this is supposed to work reliably.

IanButterworth commented 2 years ago

That sounds reasonable, but I don't know where to start. I don't really know how to tell what a non-safe point is.

vtjnash commented 2 years ago

You need to detect and handle it explicitly if you intend this to work. See how runtests.jl does it in the Base tests, for example.

ericphanson commented 1 year ago

just to say, this also happens on 1.8.3:

Precompiling project...
  Progress [==>                                      ]  3/70
  ◒ Parsers
  ◑ Colors
  ◐ Interpolations
  ◒ HTTP
  ✓ Glib_jll
  ◑ GeometryBasics
^Cfatal: error thrown and no exception handler available.
InterruptException()
jl_mutex_unlock at /cache/build/default-amdci5-6/julialang/julia-release-1-dot-8/src/julia_locks.h:129 [inlined]
ijl_task_get_next at /cache/build/default-amdci5-6/julialang/julia-release-1-dot-8/src/partr.c:569
poptask at ./task.jl:921
wait at ./task.jl:930
task_done_hook at ./task.jl:634
jfptr_task_done_hook_35125.clone_1 at /home/ubuntu/.julia/juliaup/julia-1.8.3+0.x64.linux.gnu/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/default-amdci5-6/julialang/julia-release-1-dot-8/src/gf.c:2365 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-6/julialang/julia-release-1-dot-8/src/gf.c:2547
jl_apply at /cache/build/default-amdci5-6/julialang/julia-release-1-dot-8/src/julia.h:1839 [inlined]
jl_finish_task at /cache/build/default-amdci5-6/julialang/julia-release-1-dot-8/src/task.c:254
start_task at /cache/build/default-amdci5-6/julialang/julia-release-1-dot-8/src/task.c:942
IanButterworth commented 11 months ago

One of the effects of this is creating orphaned pidfiles.

Cc. @oxinabox