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

"no exception handler available" when using async task in script #29369

Open
tkf opened this issue Sep 26, 2018 · 0 comments
Open

"no exception handler available" when using async task in script #29369

tkf opened this issue Sep 26, 2018 · 0 comments

Comments

@tkf
Copy link
Member

tkf commented Sep 26, 2018

InterruptException can be caught in "simple" script (like sleep.jl below) provided that it's started using include (julia sleep.jl does not work: #25308). However, including @async in the script makes it impossible to catch InterruptException:

$ cat sleep.jl
try
    println("sleeping")
    sleep(10)
catch err
    @show err
finally
    println("done")
end

$ julia --startup-file=no -e 'include("sleep.jl")'
sleeping
^Cerr = InterruptException()
done
julia --startup-file=no -e 'include("sleep.jl")'  0.61s user 0.66s system 67% cpu 1.877 total

$ cat async.jl
@async println("Hello!")

try
    println("Hit ctrl-c!")
    sleep(10)
catch err
    @show err
finally
    println("done")
end

$ julia --startup-file=no -e 'include("async.jl")'
Hit ctrl-c!
Hello!
^Cfatal: error thrown and no exception handler available.
InterruptException()
jl_run_once at /buildworker/worker/package_linux64/build/src/jl_uv.c:185
process_events at ./libuv.jl:98 [inlined]
wait at ./event.jl:246
task_done_hook at ./task.jl:309
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1536 [inlined]
finish_task at /buildworker/worker/package_linux64/build/src/task.c:233
start_task at /buildworker/worker/package_linux64/build/src/task.c:276
unknown function (ip: 0xffffffffffffffff)
julia --startup-file=no -e 'include("async.jl")'  0.55s user 0.66s system 64% cpu 1.867 total

$ julia --version
julia version 1.0.0
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

1 participant