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

Creating subprocess breaks signal handling #5240

Open
d1rewolf opened this issue Nov 3, 2017 · 0 comments
Open

Creating subprocess breaks signal handling #5240

d1rewolf opened this issue Nov 3, 2017 · 0 comments
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:concurrency topic:stdlib:system

Comments

@d1rewolf
Copy link

d1rewolf commented Nov 3, 2017

Crystal 0.23.1 [e2a1389] (2017-07-13) LLVM 3.8.1
Ubuntu 17.04

The following code will never make it to 'puts "3"':

chan = Channel(Int32).new

Signal::INT.trap {
    puts "Got INT signal..."
        puts "1"
        puts "2"
        `sleep 1`
        puts "3"
        `sleep 1`
        puts "4"
        `sleep 1`
        puts "Done..."
}
puts "Receiving"
chan.receive         

Removing the `` calls will allow it to finish the block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:concurrency topic:stdlib:system
Projects
None yet
Development

No branches or pull requests

2 participants