SSL server hangs forever

Ran into this today, running a crystal “ssl socket” style server. Basically it hangs using 100% cpu, creating an exception over and over again…

Crystal 0.26.1 [391785249] (2018-08-27)
LLVM: 4.0.0
Default target: i686-unknown-linux-gnu

by far the most common backtrace is

Thread 1 (Thread 0xb722e700 (LWP 13964)):

#0 0xb740fe6c in _Unwind_Find_FDE () from /lib/i386-linux-gnu/libgcc_s.so.1

#1 0xb740cab3 in ?? () from /lib/i386-linux-gnu/libgcc_s.so.1

#2 0xb740e368 in _Unwind_Backtrace () from /lib/i386-linux-gnu/libgcc_s.so.1

#3 0x081cfa59 in unwind () at /home/rdp/me/src/callstack.cr:99

#4 0x081cf9cf in initialize () at /home/rdp/me/src/callstack.cr:48

#5 0x081cf995 in new () at /home/rdp/me/src/callstack.cr:47

#6 0x08139a75 in raise () at /home/rdp/me/src/raise.cr:202

#7 0x084992aa in unbuffered_close () at /home/rdp/me/src/openssl/ssl/socket.cr:142

#8 0x08498b7d in close () at /home/rdp/me/src/io/buffered.cr:203

#9 0x0844a77b in process () at /home/rdp/me/src/http/server/request_processor.cr:66

#10 0x08448984 in process () at /home/rdp/me/src/http/server/request_processor.cr:16

#11 0x08448841 in handle_client () at /home/rdp/me/src/http/server.cr:281

#12 0x081c8cad in -> () at /home/rdp/me/src/http/server.cr:244

#13 0x08211bca in run () at /home/rdp/me/src/fiber.cr:255

#14 0x081375ae in -> () at /home/rdp/me/src/fiber.cr:29

#15 0x00000000 in ?? ()

here’s a full report from the poor man’s profiler:

Wish it were more reproducible than “once in 3 months” but reporting it here … :| Will also upgrade to newer version of crystal and see if that helps…

current work around: hard kill and restart web server when it dies…
I can’t even find a raise on line 142 of that git commit and much more often run into https://github.com/crystal-lang/crystal/issues/8108 before I possibly get the chance to “run into” this issue anymore so hoping/assuming its fixed now :)