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

InterruptException not triggered by SIGINT when blocking background thread on 1.10 #52771

Open
simonbyrne opened this issue Jan 5, 2024 · 1 comment

Comments

@simonbyrne
Copy link
Contributor

In Julia 1.9, a SIGINT would reliably still trigger an InterruptExcpetion when a non-interactive thread was blocked by a ccall.

# try_csleep.jl
Base.exit_on_sigint(false)

@show Threads.nthreads()
println(getpid())
try
    wait(Threads.@spawn begin
         @show Threads.threadid()
         ccall(:sleep, Cuint, (Cuint,), 60)
     end)
catch e
    println("error $e")
    exit()
end
println("success")

On Julia 1.9.4:

├ julia -t 2  try_csleep.jl
Threads.nthreads() = 2
1125258
Threads.threadid() = 2
^Cerror InterruptException()

(also able to trigger it via kill -INT <procid>)

On Julia 1.10.0

├ julia -t 2  try_csleep.jl
Threads.nthreads() = 2
1125350
Threads.threadid() = 2
^C^C^C^C^C^C^C^CWARNING: Force throwing a SIGINT
error InterruptException()

(kill -INT <procid> does nothing)

Possibly related to #52291 (cc @Keno @vtjnash)

@Keno
Copy link
Member

Keno commented Jan 6, 2024

Possibly related to #52291 (cc @Keno @vtjnash)

Related in the sense that it's the same problem, but not in the sense that this predates the additional complications that prompted that issue.

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

2 participants