-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Possible bug Errno: @message="SSL_shutdown: Operation now in progress" #3168
Comments
Seems like a bug in the interaction between the stdlib and openssl. |
I just got a stack trace, you'll appreciate how useful it is 😄
I'll try to build without --release this time 😄 |
The only thing it printed without the --release flag is this:
|
@jmoriau can you try running your process with |
@luislavena I used to use GDB cli back when I was still writing C (like 5 years ago), is it the same for crystal? Sorry for all these questions, never used a debugger with crystal before (didn't even know it could be done). Thanks! |
Crystal compiles to native code and can be somewhat debugged with any native debugger tool like gdb or lldb. Except for displaying variable (we don't genrerate the necessary data yet) you can set breakpoints, catch signals, show backtraces, use gdb -tui (with some line errors), ... File and line and symbols can be added with the |
@ysbaddaden ok thanks, then I should know how to use it. |
StackOverflow's I was able to easily reproduce the bug with this program (based on his): require "http/client"
require "json"
status = -1
10.times do
spawn do
while true
puts "Pinging..."
response = HTTP::Client.get "https://randomapi.com/api/6de6abfedb24f889e0b5f675edc50deb?fmt=raw&sole"
puts "Pong"
response_to_hash = JSON.parse response.body
status = response_to_hash[0]["first"].to_s.size
pp status
end
end
end
Fiber.yield
puts "Post yield"
sleep 20000.seconds # so the main thread doesn't exit yet Running
You can see the whole output (until I've interrupted the execution) at this gist. |
I can confirm that this also happens in |
I had the very same issue here:
|
Can confirm, I was trying Gangwolf/hncr and got this error too. |
I've hit the same bug today. Crystal 0.20.5 [ccf46c0] (2017-01-20) |
The bug has been acknownledged, further "me too" messages won't help resolve the issue. We need a lead to understand why and when OpenSSL fails with "operation in progress", if the behavior is expected, and what happens in the stdlib that generates this OpenSSL error. Further investigation, a reduced failing example or spec that always reproduces the bug (quickly) are more than welcomed. |
Minimal code to reproduce this issue: require "http/client"
require "json"
2.times do
spawn do
i = 1;
while i!=2
response = HTTP::Client.get "https://google.com"
i += 1;
end
end
end
sleep 10.seconds # so the main thread doesn't exit yet Tested with Output
|
Lucky me) Sorry, when I learn to write tests, I'll post the results. |
Bump. |
@ysbaddaden looks like we should retry on Just like EAGAIN. Pull request #4433 sent. |
@denysvitali Just FYI, your example contains require "http/client"
2.times do
spawn do
loop do
HTTP::Client.get "https://google.com"
end
end
end
sleep 2.seconds |
Thanks for the tip! require "http/client"
require "json"
2.times do
spawn do
i = 1
while i != 5
response = HTTP::Client.get "https://google.com"
i += 1
end
end
end
sleep 10.seconds # so the main thread doesn't exit yet
|
@denysvitali FYI #4433 fixes the bug. |
You're right, just tested #4433 , it works!
|
@denysvitali For future reference, compiling the compiler isn't neccesary because it's a stdlib fix. Using |
Just like EAGAIN handling behavior but due to another reason.
Hi,
I have a long running process which controls the lights in my apartment, a small endpoint to receive IFTTT outgoing calls, and a loop inside a fiber (so it can run concurrently with the endpoint) which polls the lights status and sometimes update some of them with a POST call to LIFX's servers.
Every once in a while (like every few days) I noticed the fiber which is supposed to run the polling loop stops and the rescued exceptions prints this for
e.inspect
:#<Errno:0xa59c40 @message="SSL_shutdown: Operation now in progress", @cause=nil, @callstack=CallStack(@callstack=[Pointer(Void)@0x414fbe, Pointer(Void)@0x449ac7, Pointer(Void)@0x48ddc5, Pointer(Void)@0x4f33b0, Pointer(Void)@0x505895, Pointer(Void)@0x417072, Pointer(Void).null], @backtrace=nil), @errno=115>"
Note the loop is supposed to always run since everything inside the loop is wrapped in the begin rescue block. But it seems this errors breaks out of the loop and then the fiber is done.
I'm sorry I don't have a proper backtrace yet (it usually takes a few days to reproduce this) I'll post one next time I get one.
The text was updated successfully, but these errors were encountered: