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

Some OpenSSL connections will cause Other OpenSSL connections (hangs | waiting)? #8626

Closed
636f7374 opened this issue Dec 26, 2019 · 30 comments
Closed

Comments

@636f7374
Copy link

636f7374 commented Dec 26, 2019

Summary

  • I am implementing a MITM server and I encountered this problem.
  • When encountering some OpenSSL requests, it will cause subsequent requests to hang (Appear in small amounts).
  • When this request times out and disconnects, subsequent requests will return to normal (no hangs | waiting).
  • I didn't find a special reason, but I captured some data when the program hangs
  • This is an outstanding issue, I will update the follow-up progress.
  • This problem caused the server performance to be very poor.
  • I set the timeout to 240 seconds, which means that hangs 240 seconds.
  • Sorry, because there are some other things waiting to be processed, in a hurry, there may be some translation problems.
  • When the stuck request is disconnected, the server starts processing the remaining requests quickly.
  • I don't know how to simulate this problems quickly (slow: open a large number of pages with a browser).

Process

[Client] <=Decrypt=> [HTTP(S) Tunnel with MITM] <=Encrypt=> [HTTP(S) Relay] <=HTTP::Client=> [Remote Server]

HTTP(S) Tunnel with MITM: Decrypt client traffic data, encrypt transmission to Relay.

Guess?

Some Code?

  • Due to the large amount of code, I only capture a part.

  • OpenSSL::SSL::SuperSocket::{Client|Server}.new are just lightweight wrapped for OpenSSL::SSL::Socket::{Client|Server}.new.

  • HTTP(S) Tunnel with MITM

    def accept(server : Socket::Server)
      accept! server rescue nil
    end

    def accept!(server : Socket::Server)
      while socket = server.accept?
        socket.try do |client|
          _client = client.as TCPSocket
          spawn same_thread: true do
            handle_client _client
          end
        end
      end
    end

    def listen
      raise "Can't re-start closed server" if closed?
      raise "Can't start server with no sockets to listen to, use Http::Proxy#bind first" if servers.empty?
      raise "Can't start running server" if listening?

      @listening = true
      channel = Channel(Nil).new

      servers.each do |server|
        spawn same_thread: true do
          until closed?
            accept server
          end
        ensure
          channel.send nil
        end
      end

      servers.size.times { channel.receive }
    end

    def handle_client(client : TCPSocket)
      connector.perform request ...
    end

    def perform(request : HTTP::Request)
      client = upgrade_client _client, request

      unless client
        return ...
      end

      logger.try &.connect_to host, port
      upstream = connect_server

      unless upstream
        return ...
      end

      set_remote_socket_timeout upstream
      server = upgrade_server upstream, request

      unless server
        return ...
      end

      transport client, server, _extract
    end

    def connect_server
      return unless ...

      begin
        return TCPSocket.new host, port,
          ..._dns_timeout,
          ..._connect_timeout
      rescue
        ...
      end

      nil
    end

    {% for name in ["client", "server"] %}
    def upgrade_{{name.id}}({{name.id}}, request : HTTP::Request)
      return {{name.id}} unless https_stream?
      return if reject?
      return {{name.id}} if final_direct? || proxy?
      return {{name.id}} unless _context = context

      {% if name.id == "client" %}
        MITM::Server.upgrade {{name.id}}, request, _context
      {% elsif name.id == "server" %}
        hostname = request.host.try { |host| host unless host.empty? }
        MITM::Client.upgrade {{name.id}}, _context, hostname
      {% end %}
    end
    {% end %}


module MITM
  class Client
    def self.upgrade(io : TCPSocket, context : MITM::Context, hostname : String? = nil)
      return io unless client_context = context.create_client

      upgrade = OpenSSL::SSL::SuperSocket::Client.new io: io,
        context: client_context, sync_context_free: false, hostname: hostname rescue nil

      client_context.free unless upgrade
      upgrade.sync = true if upgrade

      upgrade || io
    end
  end
end


module MITM
  class Server
    def self.upgrade(socket, request, context : MITM::Context)
      return socket unless server_context = context.create_server request

      upgrade = OpenSSL::SSL::SuperSocket::Server.new io: socket,
        context: server_context, sync_context_free: false rescue nil

      server_context.free unless upgrade
      upgrade.sync = true if upgrade

      upgrade || socket
    end
  end
end
  • HTTP(S) Relay
    • just HTTP::Server, no different from normal Crystal HTTP::Server.

Lsof Verbose

HTTP(S) Tunnel with MITM:
toucan  96412 User   38u     IPv4 0xecdb8f01d298ae35       0t0      TCP localhost:53332->localhost:vat (ESTABLISHED)

HTTP(S) Relay:
toucan  96413 User   76u     IPv4 0xecdb8f01bfdfa215       0t0      TCP localhost:vat->localhost:53332 (ESTABLISHED)
  • HTTP(S) Tunnel with MITM
User$ lsof -p 96412
COMMAND   PID USER   FD      TYPE             DEVICE  SIZE/OFF     NODE NAME
toucan  96412 User  cwd       DIR                1,2      2482   443608 /Users/User
toucan  96412 User  txt       REG                1,2   7118556  4266838 /usr/local/bin/toucan
toucan  96412 User  txt       REG                1,2    114108  5487905 /usr/local/Cellar/libyaml/0.2.2/lib/libyaml-0.2.dylib
toucan  96412 User  txt       REG                1,2    381200 12005363 /usr/local/Cellar/openssl/1.0.2t/lib/libssl.1.0.0.dylib
toucan  96412 User  txt       REG                1,2   2004260 12005360 /usr/local/Cellar/openssl/1.0.2t/lib/libcrypto.1.0.0.dylib
toucan  96412 User  txt       REG                1,2    416976   422220 /usr/lib/libpcre.0.dylib
toucan  96412 User  txt       REG                1,2     14352  9630926 /usr/local/Cellar/libevent/2.1.11_1/lib/libevent_pthreads-2.1.7.dylib
toucan  96412 User  txt       REG                1,2    248404  9630914 /usr/local/Cellar/libevent/2.1.11_1/lib/libevent-2.1.7.dylib
toucan  96412 User  txt       REG                1,2    698896   422030 /usr/lib/dyld
toucan  96412 User  txt       REG                1,2 662274048  9591240 /private/var/db/dyld/dyld_shared_cache_x86_64h
toucan  96412 User    0u      CHR               16,2     0t175     1185 /dev/ttys002
toucan  96412 User    1u      CHR               16,2     0t175     1185 /dev/ttys002
toucan  96412 User    2u      CHR               16,2     0t175     1185 /dev/ttys002
toucan  96412 User    3      PIPE 0xecdb8f01c6e99bed     16384          ->0xecdb8f01c6e9b26d
toucan  96412 User    4      PIPE 0xecdb8f01c6e9b26d     16384          ->0xecdb8f01c6e99bed
toucan  96412 User    5r      CHR               14,1    0t8032      574 /dev/urandom
toucan  96412 User    6u      CHR               16,2       0t0     1185 /dev/ttys002
toucan  96412 User    7u      CHR               16,2  0t626337     1185 /dev/ttys002
toucan  96412 User    8u      CHR               16,2       0t0     1185 /dev/ttys002
toucan  96412 User    9      PIPE 0xecdb8f01c6e9b56d     16384          ->0xecdb8f01c6e996ad
toucan  96412 User   10      PIPE 0xecdb8f01c6e996ad     16384          ->0xecdb8f01c6e9b56d
toucan  96412 User   11      PIPE 0xecdb8f01c6e9a8ad     16384          ->0xecdb8f01c6e98f2d
toucan  96412 User   12      PIPE 0xecdb8f01c6e98f2d     16384          ->0xecdb8f01c6e9a8ad
toucan  96412 User   13u   KQUEUE                                       count=0, state=0xa
toucan  96412 User   14u   KQUEUE                                       count=0, state=0xa
toucan  96412 User   15      PIPE 0xecdb8f01c6e98b6d     16384          ->0xecdb8f01c6e9952d
toucan  96412 User   16      PIPE 0xecdb8f01c6e9952d     16384          ->0xecdb8f01c6e98b6d
toucan  96412 User   17      PIPE 0xecdb8f01c6e9abad     16384          ->0xecdb8f01c6e99e2d
toucan  96412 User   18      PIPE 0xecdb8f01c6e99e2d     16384          ->0xecdb8f01c6e9abad
toucan  96412 User   19u   KQUEUE                                       count=0, state=0xa
toucan  96412 User   20u   KQUEUE                                       count=0, state=0xa
toucan  96412 User   21w      REG                1,2    626337 14539372 /Users/User/Toucan/Logging/Tunnel/HTTP/2019.12.26/13_25_08/1B948E.log
toucan  96412 User   22u     IPv4 0xecdb8f01d25a9e35       0t0      TCP *:search-agent (LISTEN)
toucan  96412 User   23u     IPv4 0xecdb8f01d276a53d       0t0      TCP localhost:search-agent->localhost:53594 (ESTABLISHED)
toucan  96412 User   24   NPOLICY                                       
toucan  96412 User   25u     unix 0xecdb8f01c25c69b5       0t0          ->0xecdb8f01c25c5885
toucan  96412 User   26u    systm                          0t0          
toucan  96412 User   27u     IPv4 0xecdb8f01d363791d       0t0      TCP localhost:search-agent->localhost:53562 (CLOSE_WAIT)
toucan  96412 User   28u     IPv4 0xecdb8f01d2bc291d       0t0      TCP localhost:53563->localhost:vat (ESTABLISHED)
toucan  96412 User   29u     IPv4 0xecdb8f01d2ba053d       0t0      TCP localhost:search-agent->localhost:53564 (CLOSE_WAIT)
toucan  96412 User   30u     IPv4 0xecdb8f01d36da72d       0t0      TCP localhost:search-agent->localhost:53331 (CLOSE_WAIT)
toucan  96412 User   31u     IPv4 0xecdb8f01d2a2991d       0t0      TCP localhost:search-agent->localhost:53534 (CLOSE_WAIT)
toucan  96412 User   32u     IPv4 0xecdb8f01d20c053d       0t0      TCP localhost:53565->localhost:vat (ESTABLISHED)
toucan  96412 User   33u     IPv4 0xecdb8f01d2c3fe35       0t0      TCP localhost:search-agent->localhost:53599 (CLOSE_WAIT)
toucan  96412 User   34u     IPv4 0xecdb8f01d1ef853d       0t0      TCP localhost:search-agent->localhost:53529 (CLOSE_WAIT)
toucan  96412 User   35u     IPv4 0xecdb8f01d2c41025       0t0      TCP localhost:53600->localhost:vat (ESTABLISHED)
toucan  96412 User   36u     IPv4 0xecdb8f01d20b553d       0t0      TCP localhost:search-agent->localhost:53568 (CLOSE_WAIT)
toucan  96412 User   37u     IPv4 0xecdb8f01d1f6a215       0t0      TCP localhost:53569->localhost:vat (ESTABLISHED)
> toucan  96412 User   38u     IPv4 0xecdb8f01d298ae35       0t0      TCP localhost:53332->localhost:vat (ESTABLISHED)
toucan  96412 User   39u     IPv4 0xecdb8f01d2106e35       0t0      TCP localhost:search-agent->localhost:53601 (CLOSED)
toucan  96412 User   40u     IPv4 0xecdb8f01d2183c45       0t0      TCP localhost:53603->localhost:vat (ESTABLISHED)
toucan  96412 User   41u     IPv4 0xecdb8f01d3634c45       0t0      TCP localhost:search-agent->localhost:53602 (CLOSE_WAIT)
toucan  96412 User   42u     IPv4 0xecdb8f01b8ccb025       0t0      TCP localhost:search-agent->localhost:53333 (CLOSE_WAIT)
toucan  96412 User   43u     IPv4 0xecdb8f01d36efe35       0t0      TCP localhost:53604->localhost:vat (ESTABLISHED)
toucan  96412 User   44u     IPv4 0xecdb8f01d2ad153d       0t0      TCP localhost:search-agent->localhost:53605 (CLOSED)
toucan  96412 User   45u     IPv4 0xecdb8f01d1ef972d       0t0      TCP localhost:53530->localhost:vat (ESTABLISHED)
toucan  96412 User   46u     IPv4 0xecdb8f01d20c3215       0t0      TCP localhost:53612->localhost:vat (ESTABLISHED)
toucan  96412 User   47u     IPv4 0xecdb8f01d2c5b025       0t0      TCP localhost:53336->localhost:vat (ESTABLISHED)
toucan  96412 User   48u     IPv4 0xecdb8f01d2a36e35       0t0      TCP localhost:search-agent->localhost:53606 (CLOSE_WAIT)
toucan  96412 User   49u     IPv4 0xecdb8f01d204a53d       0t0      TCP localhost:search-agent->localhost:53607 (CLOSE_WAIT)
toucan  96412 User   50u     IPv4 0xecdb8f01d2c2772d       0t0      TCP localhost:search-agent->localhost:53608 (CLOSE_WAIT)
toucan  96412 User   51u     IPv4 0xecdb8f01d2b88c45       0t0      TCP localhost:search-agent->localhost:53319 (CLOSE_WAIT)
toucan  96412 User   52u     IPv4 0xecdb8f01d7119215       0t0      TCP localhost:search-agent->localhost:53609 (CLOSE_WAIT)
toucan  96412 User   53u     IPv4 0xecdb8f01d215e72d       0t0      TCP localhost:search-agent->localhost:53610 (CLOSED)
toucan  96412 User   54u     IPv4 0xecdb8f01d366191d       0t0      TCP localhost:search-agent->localhost:53611 (CLOSE_WAIT)
toucan  96412 User   55u     IPv4 0xecdb8f01d647953d       0t0      TCP localhost:search-agent->localhost:53597 (ESTABLISHED)
toucan  96412 User   56u     IPv4 0xecdb8f01d646691d       0t0      TCP localhost:53598->localhost:vat (ESTABLISHED)
toucan  96412 User   57u     IPv4 0xecdb8f01d6d7d72d       0t0      TCP localhost:search-agent->localhost:53613 (CLOSE_WAIT)
toucan  96412 User   58u     IPv4 0xecdb8f01d6d7f215       0t0      TCP localhost:53614->localhost:vat (ESTABLISHED)
toucan  96412 User   59u     IPv4 0xecdb8f01d634b72d       0t0      TCP localhost:search-agent->localhost:53422 (CLOSE_WAIT)
toucan  96412 User   60u     IPv4 0xecdb8f01d1f6872d       0t0      TCP localhost:53615->localhost:vat (ESTABLISHED)
toucan  96412 User   61u     IPv4 0xecdb8f01d2aed91d       0t0      TCP localhost:53537->localhost:vat (ESTABLISHED)
toucan  96412 User   62u     IPv4 0xecdb8f01d2c4653d       0t0      TCP localhost:53616->localhost:vat (ESTABLISHED)
toucan  96412 User   63u     IPv4 0xecdb8f01d6fb591d       0t0      TCP localhost:53617->localhost:vat (ESTABLISHED)
toucan  96412 User   64u     IPv4 0xecdb8f01d2a7fc45       0t0      TCP localhost:53618->localhost:vat (ESTABLISHED)
toucan  96412 User   65u     IPv4 0xecdb8f01d2adf72d       0t0      TCP localhost:53619->localhost:vat (ESTABLISHED)
toucan  96412 User   66u     IPv4 0xecdb8f01d634c91d       0t0      TCP localhost:53424->localhost:vat (ESTABLISHED)
toucan  96412 User   67u     IPv4 0xecdb8f01d2aae025       0t0      TCP localhost:search-agent->localhost:53538 (CLOSE_WAIT)
toucan  96412 User   68u     IPv4 0xecdb8f01d2aace35       0t0      TCP localhost:53539->localhost:vat (ESTABLISHED)
toucan  96412 User   69u     IPv4 0xecdb8f01d2708c45       0t0      TCP localhost:53337->localhost:vat (ESTABLISHED)
toucan  96412 User   70u     IPv4 0xecdb8f01d2a6972d       0t0      TCP localhost:53620->localhost:vat (ESTABLISHED)
toucan  96412 User   71u     IPv4 0xecdb8f01d213bc45       0t0      TCP localhost:search-agent->localhost:53621 (CLOSE_WAIT)
toucan  96412 User   72u     IPv4 0xecdb8f01d270b91d       0t0      TCP localhost:search-agent->localhost:53541 (CLOSE_WAIT)
toucan  96412 User   73u     IPv4 0xecdb8f01d2542e35       0t0      TCP localhost:53622->localhost:vat (ESTABLISHED)
toucan  96412 User   74u     IPv4 0xecdb8f01d2a56e35       0t0      TCP localhost:search-agent->localhost:53623 (ESTABLISHED)
toucan  96412 User   75u     IPv4 0xecdb8f01d2115c45       0t0      TCP localhost:53624->localhost:vat (ESTABLISHED)
toucan  96412 User   76u     IPv4 0xecdb8f01d06ba72d       0t0      TCP localhost:search-agent->localhost:53625 (ESTABLISHED)
toucan  96412 User   77u     IPv4 0xecdb8f01d276b72d       0t0      TCP localhost:53626->localhost:vat (ESTABLISHED)
toucan  96412 User   78u     IPv4 0xecdb8f01d216d025       0t0      TCP localhost:53542->localhost:vat (ESTABLISHED)
toucan  96412 User   79u     IPv4 0xecdb8f01d2a8172d       0t0      TCP localhost:search-agent->localhost:53627 (ESTABLISHED)
toucan  96412 User   80u     IPv4 0xecdb8f01d1f9791d       0t0      TCP localhost:search-agent->localhost:53546 (CLOSE_WAIT)
toucan  96412 User   81u     IPv4 0xecdb8f01d1f94c45       0t0      TCP localhost:53547->localhost:vat (ESTABLISHED)
toucan  96412 User   82u     IPv4 0xecdb8f01d2c7a72d       0t0      TCP localhost:53628->localhost:vat (ESTABLISHED)
toucan  96412 User  105u     IPv4 0xecdb8f01d632be35       0t0      TCP localhost:search-agent->localhost:53505 (CLOSE_WAIT)
toucan  96412 User  115u     IPv4 0xecdb8f01d632d025       0t0      TCP localhost:53506->localhost:vat (ESTABLISHED)
  • HTTP(S) Relay
User$ lsof -p 96413
COMMAND   PID USER   FD      TYPE             DEVICE  SIZE/OFF     NODE NAME
toucan  96413 User  cwd       DIR                1,2      2482   443608 /Users/User
toucan  96413 User  txt       REG                1,2   7118556  4266838 /usr/local/bin/toucan
toucan  96413 User  txt       REG                1,2    114108  5487905 /usr/local/Cellar/libyaml/0.2.2/lib/libyaml-0.2.dylib
toucan  96413 User  txt       REG                1,2    381200 12005363 /usr/local/Cellar/openssl/1.0.2t/lib/libssl.1.0.0.dylib
toucan  96413 User  txt       REG                1,2   2004260 12005360 /usr/local/Cellar/openssl/1.0.2t/lib/libcrypto.1.0.0.dylib
toucan  96413 User  txt       REG                1,2    416976   422220 /usr/lib/libpcre.0.dylib
toucan  96413 User  txt       REG                1,2     14352  9630926 /usr/local/Cellar/libevent/2.1.11_1/lib/libevent_pthreads-2.1.7.dylib
toucan  96413 User  txt       REG                1,2    248404  9630914 /usr/local/Cellar/libevent/2.1.11_1/lib/libevent-2.1.7.dylib
toucan  96413 User  txt       REG                1,2    698896   422030 /usr/lib/dyld
toucan  96413 User  txt       REG                1,2 662274048  9591240 /private/var/db/dyld/dyld_shared_cache_x86_64h
toucan  96413 User    0u      CHR              16,10     0t173     1187 /dev/ttys010
toucan  96413 User    1u      CHR              16,10     0t173     1187 /dev/ttys010
toucan  96413 User    2u      CHR              16,10     0t173     1187 /dev/ttys010
toucan  96413 User    3      PIPE 0xecdb8f01c6e99cad     16384          ->0xecdb8f01c6e98e6d
toucan  96413 User    4      PIPE 0xecdb8f01c6e98e6d     16384          ->0xecdb8f01c6e99cad
toucan  96413 User    5r      CHR               14,1    0t9488      574 /dev/urandom
toucan  96413 User    6u      CHR              16,10       0t0     1187 /dev/ttys010
toucan  96413 User    7u      CHR              16,10  0t597065     1187 /dev/ttys010
toucan  96413 User    8u      CHR              16,10       0t0     1187 /dev/ttys010
toucan  96413 User    9      PIPE 0xecdb8f01c6e9892d     16384          ->0xecdb8f01c6e9a96d
toucan  96413 User   10      PIPE 0xecdb8f01c6e9a96d     16384          ->0xecdb8f01c6e9892d
toucan  96413 User   11      PIPE 0xecdb8f01c6e98ced     16384          ->0xecdb8f01c6e9946d
toucan  96413 User   12      PIPE 0xecdb8f01c6e9946d     16384          ->0xecdb8f01c6e98ced
toucan  96413 User   13u   KQUEUE                                       count=0, state=0xa
toucan  96413 User   14u   KQUEUE                                       count=0, state=0xa
toucan  96413 User   15      PIPE 0xecdb8f01c6e9916d     16384          ->0xecdb8f01c6e9a42d
toucan  96413 User   16      PIPE 0xecdb8f01c6e9a42d     16384          ->0xecdb8f01c6e9916d
toucan  96413 User   17u   KQUEUE                                       count=0, state=0xa
toucan  96413 User   18u   KQUEUE                                       count=0, state=0xa
toucan  96413 User   19      PIPE 0xecdb8f01c6e9a72d     16384          ->0xecdb8f01c6e9b32d
toucan  96413 User   20      PIPE 0xecdb8f01c6e9b32d     16384          ->0xecdb8f01c6e9a72d
toucan  96413 User   21w      REG                1,2    190023 14539374 /Users/User/Toucan/Logging/Relay/_HTTP/2019.12.26/13_25_09/48FB63.log
toucan  96413 User   22u     IPv4 0xecdb8f01d36d8c45       0t0      TCP *:dbm (LISTEN)
toucan  96413 User   23w      REG                1,2    407042 14539376 /Users/User/Toucan/Logging/Relay/HTTPS/2019.12.26/13_25_09/875C89.log
toucan  96413 User   24u     IPv4 0xecdb8f01d2c5953d       0t0      TCP *:vat (LISTEN)
toucan  96413 User   28   NPOLICY                                       
toucan  96413 User   29u     unix 0xecdb8f01c25c82b5       0t0          ->0xecdb8f01c25c837d
toucan  96413 User   30u    systm                          0t0          
toucan  96413 User   63      PIPE 0xecdb8f01b8c413ed     65536          
> toucan  96413 User   76u     IPv4 0xecdb8f01bfdfa215       0t0      TCP localhost:vat->localhost:53332 (ESTABLISHED)

Logging (Some privacy data is involved, I am obscure some of it.)

  • HTTP(S) Tunnel with MITM
...
I, [13:30:39 #96412]  INFO -- : [FA193E] - 127.0.0.1:53319: Connect To Tunnel
I, [13:30:39 #96412]  INFO -- : [16F712] - Request Data: [#<HTTP::Request:0x11438b930 @method="CONNECT", @headers=HTTP::Headers{"Host" => "...", "User-Agent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8", "Connection" => "keep-alive", "Proxy-Connection" => "keep-alive"}, @body=nil, @version="HTTP/1.1", @cookies=nil, @query_params=nil, @uri=nil, @remote_address="127.0.0.1:53315", @expect_continue=false, @resource="...:443">]
I, [13:30:39 #96412]  INFO -- : [CB210B] - Request Data: [#<HTTP::Request:0x11438b850 @method="GET", @headers=HTTP::Headers{...}, @body=nil, @version="HTTP/1.1", @cookies=nil, @query_params=nil, @uri=nil, @remote_address="127.0.0.1:53316", @expect_continue=false, @resource="http://...">]
I, [13:30:39 #96412]  INFO -- : [A17D78] - Connect To: 0.0.0.0:2345
I, [13:30:39 #96412]  INFO -- : [FA193E] - Request Data: [#<HTTP::Request:0x11438b690 @method="CONNECT", @headers=HTTP::Headers{"Host" => "...com", "User-Agent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8", "Connection" => "keep-alive", "Proxy-Connection" => "keep-alive"}, @body=nil, @version="HTTP/1.1", @cookies=nil, @query_params=nil, @uri=nil, @remote_address="127.0.0.1:53319", @expect_continue=false, @resource="...:443">]
...
I, [13:34:07 #96412]  INFO -- : [61CF03] - 127.0.0.1:53636: Connect To Tunnel
I, [13:34:07 #96412]  INFO -- : [61CF03] - Request Data: [#<HTTP::Request:0x1142c6850 @method="CONNECT", @headers=HTTP::Headers{"Host" => "...", "User-Agent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8", "Connection" => "keep-alive", "Proxy-Connection" => "keep-alive"}, @body=nil, @version="HTTP/1.1", @cookies=nil, @query_params=nil, @uri=nil, @remote_address="127.0.0.1:53636", @expect_continue=false, @resource="...:443">]
...
I, [13:34:07 #96412]  INFO -- : [25612F] - Final Policy: Relay
I, [13:34:07 #96412]  INFO -- : [61CF03] - Final Policy: Relay
I, [13:34:07 #96412]  INFO -- : [25612F] - Connect To: 0.0.0.0:3456
I, [13:34:07 #96412]  INFO -- : [61CF03] - Connect To: 0.0.0.0:3456
I, [13:34:39 #96412]  INFO -- : [FA193E] - Transporting
I, [13:34:39 #96412]  INFO -- : [FA193E] - Finished: 240.31s
I, [13:34:39 #96412]  INFO -- : [2A98C4] - Transporting
I, [13:34:39 #96412]  INFO -- : [2A98C4] - Finished: 240.05s
I, [13:34:39 #96412]  INFO -- : [919E71] - Transporting
I, [13:34:39 #96412]  INFO -- : [919E71] - Finished: 240.2s
I, [13:34:40 #96412]  INFO -- : [ECB764] - Transporting
I, [13:34:40 #96412]  INFO -- : [ECB764] - Finished: 239.32s
I, [13:34:40 #96412]  INFO -- : [08E9B4] - Transporting
I, [13:34:40 #96412]  INFO -- : [08E9B4] - Finished: 238.61s
I, [13:34:40 #96412]  INFO -- : [DFF68B] - Transporting
I, [13:34:40 #96412]  INFO -- : [DFF68B] - Finished: 232.49s
I, [13:34:40 #96412]  INFO -- : [D27C91] - Transporting
I, [13:34:40 #96412]  INFO -- : [D27C91] - Finished: 228.15s
I, [13:34:41 #96412]  INFO -- : [C7246C] - Transporting
I, [13:34:41 #96412]  INFO -- : [C7246C] - Finished: 229.0s
I, [13:34:41 #96412]  INFO -- : [E090DA] - Transporting
I, [13:34:41 #96412]  INFO -- : [E090DA] - Finished: 223.42s
I, [13:34:41 #96412]  INFO -- : [D05653] - Transporting
I, [13:34:41 #96412]  INFO -- : [D05653] - Finished: 212.2s
I, [13:34:41 #96412]  INFO -- : [EA911F] - Transporting
I, [13:34:41 #96412]  INFO -- : [EA911F] - Finished: 181.06s
I, [13:34:41 #96412]  INFO -- : [1130F6] - Transporting
I, [13:34:41 #96412]  INFO -- : [1130F6] - Finished: 179.46s
I, [13:34:41 #96412]  INFO -- : [A5BCB9] - Transporting
I, [13:34:41 #96412]  INFO -- : [A5BCB9] - Finished: 178.38s
I, [13:34:42 #96412]  INFO -- : [41DF60] - Transporting
I, [13:34:42 #96412]  INFO -- : [89B3C6] - Transporting
I, [13:34:42 #96412]  INFO -- : [89B3C6] - Finished: 146.32s
I, [13:34:43 #96412]  INFO -- : [B766EE] - Transporting
I, [13:34:43 #96412]  INFO -- : [B766EE] - Finished: 147.32s
I, [13:34:43 #96412]  INFO -- : [0A506E] - Transporting
I, [13:34:43 #96412]  INFO -- : [0A506E] - Finished: 147.19s
I, [13:34:43 #96412]  INFO -- : [DE55D7] - Transporting
I, [13:34:43 #96412]  INFO -- : [DE55D7] - Finished: 147.08s
I, [13:34:43 #96412]  INFO -- : [7BC9BD] - Transporting
I, [13:34:43 #96412]  INFO -- : [7BC9BD] - Finished: 146.98s
I, [13:34:43 #96412]  INFO -- : [3B6134] - Transporting
I, [13:34:43 #96412]  INFO -- : [3B6134] - Finished: 147.03s
I, [13:34:43 #96412]  INFO -- : [3E593E] - Transporting
I, [13:34:43 #96412]  INFO -- : [3E593E] - Finished: 147.18s
I, [13:34:43 #96412]  INFO -- : [CDD952] - Transporting
I, [13:34:43 #96412]  INFO -- : [CDD952] - Finished: 147.24s
I, [13:34:43 #96412]  INFO -- : [969EE3] - Transporting
I, [13:34:43 #96412]  INFO -- : [969EE3] - Finished: 147.35s
I, [13:34:43 #96412]  INFO -- : [57F357] - Transporting
I, [13:34:43 #96412]  INFO -- : [57F357] - Finished: 147.4s
I, [13:34:43 #96412]  INFO -- : [0DF14D] - Transporting
I, [13:34:43 #96412]  INFO -- : [0DF14D] - Finished: 146.98s
I, [13:34:43 #96412]  INFO -- : [325866] - Transporting
I, [13:34:43 #96412]  INFO -- : [325866] - Finished: 144.28s
I, [13:34:43 #96412]  INFO -- : [BCA230] - Transporting
I, [13:34:44 #96412]  INFO -- : [B8ECE3] - Transporting
I, [13:34:44 #96412]  INFO -- : [B8ECE3] - Finished: 136.76s
I, [13:34:44 #96412]  INFO -- : [DCC47D] - Transporting
I, [13:34:44 #96412]  INFO -- : [787F64] - Transporting
I, [13:34:44 #96412]  INFO -- : [787F64] - Finished: 75.88s
I, [13:34:44 #96412]  INFO -- : [8B8B44] - Transporting
I, [13:34:44 #96412]  INFO -- : [8B8B44] - Finished: 41.85s
I, [13:34:44 #96412]  INFO -- : [50B39B] - Transporting
I, [13:34:44 #96412]  INFO -- : [25612F] - Transporting
I, [13:34:44 #96412]  INFO -- : [61CF03] - Transporting
I, [13:34:44 #96412]  INFO -- : [DCC47D] - Finished: 130.42s
...
  • HTTP(S) Relay
...
I, [13:31:44 #96413]  INFO -- : [C3677E] - 127.0.0.1:53577: Connect To Relay
I, [13:31:44 #96413]  INFO -- : [C3677E] - Connect To: ...
I, [13:31:44 #96413]  INFO -- : [C3677E] - Request Method: GET
I, [13:31:44 #96413]  INFO -- : [C3677E] - Request Data: [#<URI:0x11e300ea0 @scheme="http", @host="...", @port=nil, @path="...", @query="...", @user=nil, @password=nil, @fragment=nil>]
I, [13:31:44 #96413]  INFO -- : [E4D85E] - Status Code: 200
I, [13:31:44 #96413]  INFO -- : [E4D85E] - Finished: 152.55ms
I, [13:31:44 #96413]  INFO -- : [A32A55] - 127.0.0.1:53581: Connect To Relay
I, [13:31:44 #96413]  INFO -- : [A32A55] - Connect To: ...
I, [13:31:44 #96413]  INFO -- : [A32A55] - Request Method: GET
I, [13:31:44 #96413]  INFO -- : [A32A55] - Request Data: [#<URI:0x10a47a1e0 @scheme="http", @host="...", @port=nil, @path="...", @query="...", @user=nil, @password=nil, @fragment=nil>]
I, [13:31:44 #96413]  INFO -- : [2E0AE7] - Status Code: 200
I, [13:31:44 #96413]  INFO -- : [2E0AE7] - Finished: 154.94ms
I, [13:31:44 #96413]  INFO -- : [9524DD] - Status Code: 200
I, [13:31:44 #96413]  INFO -- : [9524DD] - Finished: 156.55ms
I, [13:31:45 #96413]  INFO -- : [A0FFB4] - Status Code: 200
I, [13:31:45 #96413]  INFO -- : [A0FFB4] - Received: 1.0 Bytes
I, [13:31:45 #96413]  INFO -- : [A0FFB4] - Finished: 187.23ms
I, [13:31:45 #96413]  INFO -- : [D6F692] - Status Code: 200
I, [13:31:45 #96413]  INFO -- : [AFEC71] - Status Code: 200
I, [13:31:45 #96413]  INFO -- : [D6F692] - Finished: 69.27ms
I, [13:31:45 #96413]  INFO -- : [AFEC71] - Finished: 70.81ms
I, [13:31:45 #96413]  INFO -- : [A32A55] - Status Code: 200
I, [13:31:45 #96413]  INFO -- : [A32A55] - Finished: 74.38ms
I, [13:31:45 #96413]  INFO -- : [C3677E] - Status Code: 200
I, [13:31:45 #96413]  INFO -- : [C3677E] - Finished: 80.68ms
I, [13:34:39 #96413]  INFO -- : [D9EC81] - 127.0.0.1:53336: Connect To Relay
I, [13:34:39 #96413]  INFO -- : [D9EC81] - Connect To: ...
I, [13:34:39 #96413]  INFO -- : [D9EC81] - Request Method: GET
I, [13:34:39 #96413]  INFO -- : [D9EC81] - Request Data: [#<URI:0x12ea48180 @scheme="https", @host="...", @port=nil, @path="...", @query="...", @user=nil, @password=nil, @fragment=nil>]
...

Call graph

  • HTTP(S) Tunnel with MITM
Sampling process 96412 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling toucan (pid 96412) every 1 millisecond
Process:         toucan [96412]
Path:            /usr/local/bin/toucan
Load Address:    0x108492000
Identifier:      toucan
Version:         0
Code Type:       X86-64
Parent Process:  bash [96258]

Date/Time:       2019-12-26 13:32:51.650 +0800
Launch Time:     2019-12-26 13:25:08.521 +0800
OS Version:      Mac OS X 10.12.6 (16G29)
Report Version:  7
Analysis Tool:   /usr/bin/sample
----

Call graph:
    2947 Thread_1019748   DispatchQueue_1: com.apple.main-thread  (serial)
    + 2947 ~procProc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal/0.31.0_1/src/fiber.cr:48  (in toucan) + 9  [0x1084a8ac9]  fiber.cr:48
    +   2947 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 94  [0x1085048de]  fiber.cr:255
    +     2947 ~procProc(Nil)@/usr/local/Cellar/crystal/0.31.0_1/src/kernel.cr:542  (in toucan) + 24  [0x1084a89a8]  kernel.cr:542
    +       2947 *sleep<Int32>:Nil  (in toucan) + 66  [0x1084a8a02]  concurrent.cr:15
    +         2947 *Crystal::Scheduler::sleep<Time::Span>:Nil  (in toucan) + 57  [0x10851ef59]  scheduler.cr:51
    +           2947 *Crystal::Scheduler#sleep<Time::Span>:Nil  (in toucan) + 84  [0x10851efb4]  scheduler.cr:157
    +             2947 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x10851e6a3]  scheduler.cr:146
    +               2947 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x10851d1c2]  event_loop.cr:16
    +                 2947 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x10851dcb1]  event.cr:62
    +                   2947 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10902d343]
    +                     2947 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x1090365ba]
    +                       2947 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffabe0ed96]
    2947 Thread_1019749
    + 2947 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffabef808d]
    +   2947 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffabef8887]
    +     2947 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffabef893b]
    +       2947 GC_mark_thread  (in toucan) + 132  [0x108846c98]
    +         2947 GC_help_marker  (in toucan) + 46  [0x108840fe6]
    +           2947 GC_wait_marker  (in toucan) + 23  [0x10884848d]
    +             2947 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffabef97fa]
    +               2947 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffabe0dbf2]
    2947 Thread_1019750
    + 2947 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffabef808d]
    +   2947 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffabef8887]
    +     2947 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffabef893b]
    +       2947 GC_mark_thread  (in toucan) + 132  [0x108846c98]
    +         2947 GC_help_marker  (in toucan) + 46  [0x108840fe6]
    +           2947 GC_wait_marker  (in toucan) + 23  [0x10884848d]
    +             2947 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffabef97fa]
    +               2947 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffabe0dbf2]
    2947 Thread_1019751
    + 2947 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffabef808d]
    +   2947 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffabef8887]
    +     2947 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffabef893b]
    +       2947 GC_mark_thread  (in toucan) + 132  [0x108846c98]
    +         2947 GC_help_marker  (in toucan) + 46  [0x108840fe6]
    +           2947 GC_wait_marker  (in toucan) + 23  [0x10884848d]
    +             2947 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffabef97fa]
    +               2947 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffabe0dbf2]
    2947 Thread_1019752
    + 2947 ~proc2Proc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal/0.31.0_1/src/fiber.cr:48  (in toucan) + 9  [0x1084a8da9]  fiber.cr:48
    +   2947 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 112  [0x1085048f0]  fiber.cr:255
    +     2947 ~procProc(Nil)@src/toucan/tunnel/http/proxy.cr:121  (in toucan) + 31  [0x1084b5c5f]  proxy.cr:122
    +       2947 *Toucan::Tunnel::Http::Proxy#handle_client<TCPSocket+>:(Fiber | IO+ | Int32 | Nil)  (in toucan) + 1915  [0x10880831b]  proxy.cr:243
    +         2947 *Toucan::Tunnel::Http::Connector#perform<HTTP::Request>:(Fiber | IO+ | Int32 | Nil)  (in toucan) + 2210  [0x10880cae2]  connector.cr:437
    +           2947 *Toucan::Tunnel::Http::Connector#upgrade_server<TCPSocket, HTTP::Request>:(IO+ | Nil)  (in toucan) + 247  [0x1088185c7]  connector.cr:280
    +             2947 *MITM::Client::upgrade<TCPSocket, MITM::Context, (String | Nil)>:IO+  (in toucan) + 73  [0x10881fbc9]  client.cr:6
    +               2947 *OpenSSL::SSL::SuperSocket::Client::new:io:context:sync_context_free:hostname<TCPSocket, OpenSSL::SSL::SuperContext::Client, Bool, (String | Nil)>:OpenSSL::SSL::SuperSocket::Client  (in toucan) + 196  [0x1087d0aa4]  super_socket.cr:5
    +                 2947 *OpenSSL::SSL::SuperSocket::Client#initialize<TCPSocket, OpenSSL::SSL::SuperContext::Client, Bool, (String | Nil)>:Nil  (in toucan) + 99  [0x1087d0b23]  super_socket.cr:10
    +                   2947 ssl23_connect  (in libssl.1.0.0.dylib) + 1799  [0x108da65ab]
    +                     2947 ssl23_read_bytes  (in libssl.1.0.0.dylib) + 54  [0x108da6e5f]
    +                       2947 BIO_read  (in libcrypto.1.0.0.dylib) + 100  [0x108e9fd0b]
    +                         2947 ~procProc(Pointer(LibCrypto::Bio), Pointer(UInt8), Int32, Int32)@/usr/local/Cellar/crystal/0.31.0_1/src/openssl/bio.cr:36  (in toucan) + 1149  [0x1084ac02d]  bio.cr:39
    +                           2947 *Socket+@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 190  [0x1085b1c5e]  buffered.cr:79
    +                             2947 *Socket+@Socket#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 338  [0x1085b1312]  socket.cr:59
    +                               2947 *Socket+@IO::Evented#wait_readable:Nil  (in toucan) + 57  [0x1085b18a9]  evented.cr:117
    +                                 2947 *Socket+@IO::Evented#wait_readable<(Time::Span | Nil)>:Nil  (in toucan) + 680  [0x1085b1b58]  evented.cr:125
    +                                   2947 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x10851e639]  scheduler.cr:43
    +                                     2947 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x10851e6a3]  scheduler.cr:146
    +                                       2947 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x10851d1c2]  event_loop.cr:16
    +                                         2947 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x10851dcb1]  event.cr:62
    +                                           2947 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10902d343]
    +                                             2947 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x1090365ba]
    +                                               2947 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffabe0ed96]
    2947 Thread_1019753
    + 2947 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffabef808d]
    +   2947 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffabef8887]
    +     2947 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffabef893b]
    +       2947 GC_call_with_stack_base  (in toucan) + 26  [0x108843b2e]
    +         2947 GC_inner_start_routine  (in toucan) + 101  [0x108846b5f]
    +           2947 ~procProc(Pointer(Void), Pointer(Void))@/usr/local/Cellar/crystal/0.31.0_1/src/thread.cr:32  (in toucan) + 13  [0x1084a912d]  thread.cr:33
    +             2947 *Thread#start:(Exception+ | Nil)  (in toucan) + 184  [0x108505878]  thread.cr:255
    +               2947 ~proc2Proc(Nil)@/usr/local/Cellar/crystal/0.31.0_1/src/crystal/scheduler.cr:169  (in toucan) + 55  [0x1084a9117]  scheduler.cr:169
    +                 2947 *Crystal::Scheduler#run_loop:NoReturn  (in toucan) + 155  [0x10851f45b]  scheduler.cr:169
    +                   2947 *Crystal::FiberChannel#receive:Fiber  (in toucan) + 30  [0x10851f9de]  fiber_channel.cr:20
    +                     2947 *IO::FileDescriptor+@IO#read_bytes<UInt64.class>:UInt64  (in toucan) + 34  [0x10852ae62]  io.cr:889
    +                       2947 *UInt64@Int::from_io<IO::FileDescriptor+, IO::ByteFormat::LittleEndian:Module>:UInt64  (in toucan) + 34  [0x1084e2f72]  int.cr:520
    +                         2947 *IO::ByteFormat::LittleEndian::decode<UInt64.class, IO::FileDescriptor+>:UInt64  (in toucan) + 59  [0x108537cdb]  byte_format.cr:131
    +                           2947 *IO::FileDescriptor+@IO#read_fully<Slice(UInt8)>:Int32  (in toucan) + 67  [0x1085283a3]  io.cr:513
    +                             2947 *IO::FileDescriptor+@IO#read_fully?<Slice(UInt8)>:(Int32 | Nil)  (in toucan) + 104  [0x108528458]  io.cr:530
    +                               2947 *IO::FileDescriptor+@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 231  [0x1085285c7]  buffered.cr:81
    +                                 2947 *IO::FileDescriptor+@IO::Buffered#fill_buffer:Slice(UInt8)  (in toucan) + 76  [0x10852912c]  buffered.cr:214
    +                                   2947 *IO::FileDescriptor+@Crystal::System::FileDescriptor#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 310  [0x108528826]  file_descriptor.cr:59
    +                                     2947 *IO::FileDescriptor+@IO::Evented#wait_readable:Nil  (in toucan) + 60  [0x108528ddc]  evented.cr:117
    +                                       2947 *IO::FileDescriptor+@IO::Evented#wait_readable<(Time::Span | Nil)>:Nil  (in toucan) + 680  [0x108529098]  evented.cr:125
    +                                         2947 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x10851e639]  scheduler.cr:43
    +                                           2947 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x10851e6a3]  scheduler.cr:146
    +                                             2947 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x10851d1c2]  event_loop.cr:16
    +                                               2947 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x10851dcb1]  event.cr:62
    +                                                 2947 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10902d343]
    +                                                   2947 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x1090365ba]
    +                                                     2947 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffabe0ed96]
    2947 Thread_1019754
      2947 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffabef808d]
        2947 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffabef8887]
          2947 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffabef893b]
            2947 GC_call_with_stack_base  (in toucan) + 26  [0x108843b2e]
              2947 GC_inner_start_routine  (in toucan) + 101  [0x108846b5f]
                2947 ~procProc(Pointer(Void), Pointer(Void))@/usr/local/Cellar/crystal/0.31.0_1/src/thread.cr:32  (in toucan) + 13  [0x1084a912d]  thread.cr:33
                  2947 *Thread#start:(Exception+ | Nil)  (in toucan) + 184  [0x108505878]  thread.cr:255
                    2947 ~proc2Proc(Nil)@/usr/local/Cellar/crystal/0.31.0_1/src/crystal/scheduler.cr:169  (in toucan) + 55  [0x1084a9117]  scheduler.cr:169
                      2947 *Crystal::Scheduler#run_loop:NoReturn  (in toucan) + 155  [0x10851f45b]  scheduler.cr:169
                        2947 *Crystal::FiberChannel#receive:Fiber  (in toucan) + 30  [0x10851f9de]  fiber_channel.cr:20
                          2947 *IO::FileDescriptor+@IO#read_bytes<UInt64.class>:UInt64  (in toucan) + 34  [0x10852ae62]  io.cr:889
                            2947 *UInt64@Int::from_io<IO::FileDescriptor+, IO::ByteFormat::LittleEndian:Module>:UInt64  (in toucan) + 34  [0x1084e2f72]  int.cr:520
                              2947 *IO::ByteFormat::LittleEndian::decode<UInt64.class, IO::FileDescriptor+>:UInt64  (in toucan) + 59  [0x108537cdb]  byte_format.cr:131
                                2947 *IO::FileDescriptor+@IO#read_fully<Slice(UInt8)>:Int32  (in toucan) + 67  [0x1085283a3]  io.cr:513
                                  2947 *IO::FileDescriptor+@IO#read_fully?<Slice(UInt8)>:(Int32 | Nil)  (in toucan) + 104  [0x108528458]  io.cr:530
                                    2947 *IO::FileDescriptor+@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 231  [0x1085285c7]  buffered.cr:81
                                      2947 *IO::FileDescriptor+@IO::Buffered#fill_buffer:Slice(UInt8)  (in toucan) + 76  [0x10852912c]  buffered.cr:214
                                        2947 *IO::FileDescriptor+@Crystal::System::FileDescriptor#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 310  [0x108528826]  file_descriptor.cr:59
                                          2947 *IO::FileDescriptor+@IO::Evented#wait_readable:Nil  (in toucan) + 60  [0x108528ddc]  evented.cr:117
                                            2947 *IO::FileDescriptor+@IO::Evented#wait_readable<(Time::Span | Nil)>:Nil  (in toucan) + 680  [0x108529098]  evented.cr:125
                                              2947 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x10851e639]  scheduler.cr:43
                                                2947 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x10851e6a3]  scheduler.cr:146
                                                  2947 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x10851d1c2]  event_loop.cr:16
                                                    2947 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x10851dcb1]  event.cr:62
                                                      2947 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10902d343]
                                                        2947 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x1090365ba]
                                                          2947 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffabe0ed96]

Total number in stack (recursive counted multiple, when >=5):
        5       _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffabef893b]
        5       _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffabef8887]
        5       thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffabef808d]

Sort by top of stack, same collapsed (when >= 5):
        kevent  (in libsystem_kernel.dylib)        11788
        __psynch_cvwait  (in libsystem_kernel.dylib)        8841

Binary Images:
       0x108492000 -        0x1088dcfff +toucan (0) <F7F85110-7101-3673-9911-E9864C781954> /usr/local/bin/toucan
       0x108d72000 -        0x108d8afff +libyaml-0.2.dylib (0) <D64BFABD-6330-3455-AEA3-A051EC3B4B3B> /usr/local/opt/libyaml/lib/libyaml-0.2.dylib
       0x108d90000 -        0x108dd0fff +libssl.1.0.0.dylib (0) <9BD9BD97-9105-3B6F-950E-C864E96B7C3C> /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
       0x108df4000 -        0x108f67cc7 +libcrypto.1.0.0.dylib (0) <B4F57263-6009-31D3-9027-6D114744EFB0> /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
       0x108fe7000 -        0x109014ff3  libpcre.0.dylib (8) <BCEA4851-21D3-3EFD-B66F-438CC1F96AF3> /usr/lib/libpcre.0.dylib
       0x10901a000 -        0x10901bfff +libevent_pthreads-2.1.7.dylib (0) <4B335AB9-9974-32C4-AA80-A3F649E4B819> /usr/local/opt/libevent/lib/libevent_pthreads-2.1.7.dylib
       0x10901f000 -        0x10904cff7 +libevent-2.1.7.dylib (0) <E8D7300E-8FE0-33C8-B9C5-DA74B3278FED> /usr/local/opt/libevent/lib/libevent-2.1.7.dylib
       0x112fa0000 -        0x112fdddc7  dyld (0.0 - ???) <322C06B7-8878-311D-888C-C8FD2CA96FF3> /usr/lib/dyld
    0x7fffaa735000 -     0x7fffaa736ffb  libSystem.B.dylib (1238.60.2) <F18AC1E7-C6F1-34B1-8069-BE571B3231D4> /usr/lib/libSystem.B.dylib
    0x7fffaa86f000 -     0x7fffaa8c5ff7  libc++.1.dylib (307.5) <0B43BB5D-E6EB-3464-8DE9-B41AC8ED9D1C> /usr/lib/libc++.1.dylib
    0x7fffaa8c6000 -     0x7fffaa8efff7  libc++abi.dylib (307.4) <BC271AD3-831B-362A-9DA7-E8C51F285FE4> /usr/lib/libc++abi.dylib
    0x7fffaad3d000 -     0x7fffaae2fff7  libiconv.2.dylib (50) <42125B35-81D7-3FC4-9475-A26DBE10884D> /usr/lib/libiconv.2.dylib
    0x7fffab3e4000 -     0x7fffab7b6047  libobjc.A.dylib (709.1) <70614861-0340-32E2-85ED-FE65759CDFFA> /usr/lib/libobjc.A.dylib
    0x7fffabbe3000 -     0x7fffabbf4ff3  libz.1.dylib (67) <46E3FFA2-4328-327A-8D34-A03E20BFFB8E> /usr/lib/libz.1.dylib
    0x7fffabc03000 -     0x7fffabc07ff7  libcache.dylib (79) <093A4DAB-8385-3D47-A350-E20CB7CCF7BF> /usr/lib/system/libcache.dylib
    0x7fffabc08000 -     0x7fffabc12fff  libcommonCrypto.dylib (60092.50.5) <8A64D1B0-C70E-385C-92F0-E669079FDA90> /usr/lib/system/libcommonCrypto.dylib
    0x7fffabc13000 -     0x7fffabc1afff  libcompiler_rt.dylib (62) <55D47421-772A-32AB-B529-1A46C2F43B4D> /usr/lib/system/libcompiler_rt.dylib
    0x7fffabc1b000 -     0x7fffabc23fff  libcopyfile.dylib (138) <819BEA3C-DF11-3E3D-A1A1-5A51C5BF1961> /usr/lib/system/libcopyfile.dylib
    0x7fffabc24000 -     0x7fffabca7fdf  libcorecrypto.dylib (442.50.19) <65D7165E-2E71-335D-A2D6-33F78E2DF0C1> /usr/lib/system/libcorecrypto.dylib
    0x7fffabca8000 -     0x7fffabcd9fff  libdispatch.dylib (703.50.37) <6582BAD6-ED27-3B30-B620-90B1C5A4AE3C> /usr/lib/system/libdispatch.dylib
    0x7fffabcda000 -     0x7fffabcdfffb  libdyld.dylib (433.5) <9B2AC56D-107C-3541-A127-9094A751F2C9> /usr/lib/system/libdyld.dylib
    0x7fffabce0000 -     0x7fffabce0ffb  libkeymgr.dylib (28) <7AA011A9-DC21-3488-BF73-3B5B14D1FDD6> /usr/lib/system/libkeymgr.dylib
    0x7fffabcee000 -     0x7fffabceefff  liblaunch.dylib (972.70.1) <B856ABD2-896E-3DE0-B2C8-146A6AF8E2A7> /usr/lib/system/liblaunch.dylib
    0x7fffabcef000 -     0x7fffabcf4ff3  libmacho.dylib (898) <17D5D855-F6C3-3B04-B680-E9BF02EF8AED> /usr/lib/system/libmacho.dylib
    0x7fffabcf5000 -     0x7fffabcf7ff3  libquarantine.dylib (85.50.1) <12448CC2-378E-35F3-BE33-9DC395A5B970> /usr/lib/system/libquarantine.dylib
    0x7fffabcf8000 -     0x7fffabcf9ffb  libremovefile.dylib (45) <38D4CB9C-10CD-30D3-8B7B-A515EC75FE85> /usr/lib/system/libremovefile.dylib
    0x7fffabcfa000 -     0x7fffabd12ff7  libsystem_asl.dylib (349.50.5) <096E4228-3B7C-30A6-8B13-EC909A64499A> /usr/lib/system/libsystem_asl.dylib
    0x7fffabd13000 -     0x7fffabd13ff7  libsystem_blocks.dylib (67) <10DC5404-73AB-35B3-A277-A8AFECB476EB> /usr/lib/system/libsystem_blocks.dylib
    0x7fffabd14000 -     0x7fffabda1fef  libsystem_c.dylib (1158.50.2) <E5AE5244-7D0C-36AC-8BB6-C7AE7EA52A4B> /usr/lib/system/libsystem_c.dylib
    0x7fffabda2000 -     0x7fffabda5ffb  libsystem_configuration.dylib (888.60.2) <BECC01A2-CA8D-31E6-BCDF-D452965FA976> /usr/lib/system/libsystem_configuration.dylib
    0x7fffabda6000 -     0x7fffabda9fff  libsystem_coreservices.dylib (41.4) <7D26DE79-B424-3450-85E1-F7FAB32714AB> /usr/lib/system/libsystem_coreservices.dylib
    0x7fffabdaa000 -     0x7fffabdc2fff  libsystem_coretls.dylib (121.50.4) <EC6FCF07-DCFB-3A03-9CC9-6DD3709974C6> /usr/lib/system/libsystem_coretls.dylib
    0x7fffabdc3000 -     0x7fffabdc9fff  libsystem_dnssd.dylib (765.50.9) <CC960215-0B1B-3822-A13A-3DDE96FA796F> /usr/lib/system/libsystem_dnssd.dylib
    0x7fffabdca000 -     0x7fffabdf3ff7  libsystem_info.dylib (503.50.4) <611DB84C-BF70-3F92-8702-B9F28A900920> /usr/lib/system/libsystem_info.dylib
    0x7fffabdf4000 -     0x7fffabe16ff7  libsystem_kernel.dylib (3789.70.16) <34B1F16C-BC9C-3C5F-9045-0CAE91CB5914> /usr/lib/system/libsystem_kernel.dylib
    0x7fffabe17000 -     0x7fffabe5efe7  libsystem_m.dylib (3121.6) <86D499B5-BBDC-3D3B-8A4E-97AE8E6672A4> /usr/lib/system/libsystem_m.dylib
    0x7fffabe5f000 -     0x7fffabe7dff7  libsystem_malloc.dylib (116.50.8) <A3D15F17-99A6-3367-8C7E-4280E8619C95> /usr/lib/system/libsystem_malloc.dylib
    0x7fffabe7e000 -     0x7fffabed7ffb  libsystem_network.dylib (856.60.1) <369D0221-56CA-3C3E-9EDE-94B41CAE77B7> /usr/lib/system/libsystem_network.dylib
    0x7fffabed8000 -     0x7fffabee1ff3  libsystem_networkextension.dylib (563.60.2) <B021F2B3-8A75-3633-ABB0-FC012B8E9B0C> /usr/lib/system/libsystem_networkextension.dylib
    0x7fffabee2000 -     0x7fffabeebff3  libsystem_notify.dylib (165.20.1) <B8160190-A069-3B3A-BDF6-2AA408221FAE> /usr/lib/system/libsystem_notify.dylib
    0x7fffabeec000 -     0x7fffabef4fe7  libsystem_platform.dylib (126.50.8) <897462FD-B318-321B-A554-E61982630F7E> /usr/lib/system/libsystem_platform.dylib
    0x7fffabef5000 -     0x7fffabeffff7  libsystem_pthread.dylib (218.60.3) <B8FB5E20-3295-39E2-B5EB-B464D1D4B104> /usr/lib/system/libsystem_pthread.dylib
    0x7fffabf00000 -     0x7fffabf03ff7  libsystem_sandbox.dylib (592.70.1) <4B92EC49-ACD0-36AE-B07A-A2B8152EAF9D> /usr/lib/system/libsystem_sandbox.dylib
    0x7fffabf04000 -     0x7fffabf05ff3  libsystem_secinit.dylib (24.50.4) <F78B847B-3565-3E4B-98A6-F7AD40392E2D> /usr/lib/system/libsystem_secinit.dylib
    0x7fffabf06000 -     0x7fffabf0dffb  libsystem_symptoms.dylib (532.50.47) <3390E07C-C1CE-348F-ADBD-2C5440B45EAA> /usr/lib/system/libsystem_symptoms.dylib
    0x7fffabf0e000 -     0x7fffabf21ff7  libsystem_trace.dylib (518.70.1) <AC63A7FE-50D9-3A30-96E6-F6B7FF16E465> /usr/lib/system/libsystem_trace.dylib
    0x7fffabf22000 -     0x7fffabf27ffb  libunwind.dylib (35.3) <3D50D8A8-C460-334D-A519-2DA841102C6B> /usr/lib/system/libunwind.dylib
    0x7fffabf28000 -     0x7fffabf51ff7  libxpc.dylib (972.70.1) <BF896DF0-D8E9-31A8-A4B3-01120BFEEE52> /usr/lib/system/libxpc.dylib
Sample analysis of process 96412 written to file /dev/stdout
  • HTTP(S) Relay
Oops! I did not save this sample, but it is idle, without any call graph being processed (only Crystal::Scheduler::sleep, event_base_loop, ...).
View through Lsof, there is only one connection (TCP localhost: vat-> localhost: 53332 (ESTABLISHED)).

Crystal Version

  • The latest version requires full Xcode installation, I have not upgraded Crystal 0.32.1 for the time being.
Crystal 0.31.0 (2019-09-24)

LLVM: 8.0.1
Default target: x86_64-apple-macosx

Finally

  • If anyone can help me, I would appreciate it.
  • I believe it takes a while to find this problems, maybe a lot of time.
@636f7374
Copy link
Author

Update

OpenSSL Version

User$ openssl version
OpenSSL 1.0.2t  10 Sep 2019

icr(0.31.0) > require "openssl"
 => ok
icr(0.31.0) > LibSSL::OPENSSL_VERSION
 => "1.0.2"

Call graph

  • HTTP(S) Tunnel with MITM
Sampling process 1017 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling toucan (pid 1017) every 1 millisecond
Process:         toucan [1017]
Path:            /usr/local/bin/toucan
Load Address:    0x10644e000
Identifier:      toucan
Version:         0
Code Type:       X86-64
Parent Process:  bash [800]

Date/Time:       2019-12-27 08:52:00.548 +0800
Launch Time:     2019-12-27 07:46:33.401 +0800
OS Version:      Mac OS X 10.12.6 (16G29)
Report Version:  7
Analysis Tool:   /usr/bin/sample
----

Call graph:
    2712 Thread_17315   DispatchQueue_1: com.apple.main-thread  (serial)
    + 2712 ~procProc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal/0.31.0_1/src/fiber.cr:48  (in toucan) + 9  [0x106465039]  fiber.cr:48
    +   2712 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 94  [0x1064c0a7e]  fiber.cr:255
    +     2712 ~procProc(Nil)@/usr/local/Cellar/crystal/0.31.0_1/src/kernel.cr:542  (in toucan) + 24  [0x106464f18]  kernel.cr:542
    +       2712 *sleep<Int32>:Nil  (in toucan) + 66  [0x106464f72]  concurrent.cr:15
    +         2712 *Crystal::Scheduler::sleep<Time::Span>:Nil  (in toucan) + 57  [0x1064db0f9]  scheduler.cr:51
    +           2712 *Crystal::Scheduler#sleep<Time::Span>:Nil  (in toucan) + 84  [0x1064db154]  scheduler.cr:157
    +             2712 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x1064da843]  scheduler.cr:146
    +               2712 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x1064d9362]  event_loop.cr:16
    +                 2712 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x1064d9e51]  event.cr:62
    +                   2712 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x106ff3343]
    +                     2712 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x106ffc5ba]
    +                       2712 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffa28f1d96]
    2712 Thread_17317
    + 2712 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffa29db08d]
    +   2712 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffa29db887]
    +     2712 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffa29db93b]
    +       2712 GC_mark_thread  (in toucan) + 132  [0x1068022d8]
    +         2712 GC_help_marker  (in toucan) + 46  [0x1067fc626]
    +           2712 GC_wait_marker  (in toucan) + 23  [0x106803acd]
    +             2712 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffa29dc7fa]
    +               2712 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffa28f0bf2]
    2712 Thread_17318
    + 2712 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffa29db08d]
    +   2712 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffa29db887]
    +     2712 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffa29db93b]
    +       2712 GC_mark_thread  (in toucan) + 132  [0x1068022d8]
    +         2712 GC_help_marker  (in toucan) + 46  [0x1067fc626]
    +           2712 GC_wait_marker  (in toucan) + 23  [0x106803acd]
    +             2712 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffa29dc7fa]
    +               2712 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffa28f0bf2]
    2712 Thread_17319
    + 2712 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffa29db08d]
    +   2712 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffa29db887]
    +     2712 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffa29db93b]
    +       2712 GC_mark_thread  (in toucan) + 132  [0x1068022d8]
    +         2712 GC_help_marker  (in toucan) + 46  [0x1067fc626]
    +           2712 GC_wait_marker  (in toucan) + 23  [0x106803acd]
    +             2712 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffa29dc7fa]
    +               2712 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffa28f0bf2]
    2712 Thread_17320
    + 2712 ~proc2Proc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal/0.31.0_1/src/fiber.cr:48  (in toucan) + 9  [0x106465319]  fiber.cr:48
    +   2712 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 112  [0x1064c0a90]  fiber.cr:255
    +     2712 ~procProc(Nil)@src/toucan/tunnel/http/proxy.cr:121  (in toucan) + 31  [0x10647205f]  proxy.cr:122
    +       2712 *Toucan::Tunnel::Http::Proxy#handle_client<TCPSocket+>:(Fiber | IO+ | Int32 | Nil)  (in toucan) + 1915  [0x1067c37ab]  proxy.cr:243
    +         2712 *Toucan::Tunnel::Http::Connector#perform<HTTP::Request>:(Fiber | IO+ | Int32 | Nil)  (in toucan) + 2210  [0x1067c7f72]  connector.cr:437
    +           2712 *Toucan::Tunnel::Http::Connector#upgrade_server<TCPSocket, HTTP::Request>:(IO+ | Nil)  (in toucan) + 247  [0x1067d3a57]  connector.cr:280
    +             2712 *MITM::Client::upgrade<TCPSocket, MITM::Context, (String | Nil)>:IO+  (in toucan) + 73  [0x1067db059]  client.cr:6
    +               2712 *OpenSSL::SSL::SuperSocket::Client::new:io:context:sync_context_free:hostname<TCPSocket, OpenSSL::SSL::SuperContext::Client, Bool, (String | Nil)>:OpenSSL::SSL::SuperSocket::Client  (in toucan) + 196  [0x10678cdf4]  super_socket.cr:5
    +                 2712 *OpenSSL::SSL::SuperSocket::Client#initialize<TCPSocket, OpenSSL::SSL::SuperContext::Client, Bool, (String | Nil)>:Nil  (in toucan) + 99  [0x10678ce73]  super_socket.cr:10
    +                   2712 ssl23_connect  (in libssl.1.0.0.dylib) + 1799  [0x106d675ab]
    +                     2712 ssl23_read_bytes  (in libssl.1.0.0.dylib) + 54  [0x106d67e5f]
    +                       2712 BIO_read  (in libcrypto.1.0.0.dylib) + 100  [0x106e5ed0b]
    +                         2712 ~procProc(Pointer(LibCrypto::Bio), Pointer(UInt8), Int32, Int32)@/usr/local/Cellar/crystal/0.31.0_1/src/openssl/bio.cr:36  (in toucan) + 1149  [0x10646859d]  bio.cr:39
    +                           2712 *Socket+@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 190  [0x10656de8e]  buffered.cr:79
    +                             2712 *Socket+@Socket#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 338  [0x10656d542]  socket.cr:59
    +                               2712 *Socket+@IO::Evented#wait_readable:Nil  (in toucan) + 57  [0x10656dad9]  evented.cr:117
    +                                 2712 *Socket+@IO::Evented#wait_readable<(Time::Span | Nil)>:Nil  (in toucan) + 680  [0x10656dd88]  evented.cr:125
    +                                   2712 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x1064da7d9]  scheduler.cr:43
    +                                     2712 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x1064da843]  scheduler.cr:146
    +                                       2712 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x1064d9362]  event_loop.cr:16
    +                                         2712 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x1064d9e51]  event.cr:62
    +                                           2712 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x106ff3343]
    +                                             2712 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x106ffc5ba]
    +                                               2712 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffa28f1d96]
    2712 Thread_17321
    + 2712 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffa29db08d]
    +   2712 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffa29db887]
    +     2712 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffa29db93b]
    +       2712 GC_call_with_stack_base  (in toucan) + 26  [0x1067ff16e]
    +         2712 GC_inner_start_routine  (in toucan) + 101  [0x10680219f]
    +           2712 ~procProc(Pointer(Void), Pointer(Void))@/usr/local/Cellar/crystal/0.31.0_1/src/thread.cr:32  (in toucan) + 13  [0x10646569d]  thread.cr:33
    +             2712 *Thread#start:(Exception+ | Nil)  (in toucan) + 184  [0x1064c1a18]  thread.cr:255
    +               2712 ~proc2Proc(Nil)@/usr/local/Cellar/crystal/0.31.0_1/src/crystal/scheduler.cr:169  (in toucan) + 55  [0x106465687]  scheduler.cr:169
    +                 2712 *Crystal::Scheduler#run_loop:NoReturn  (in toucan) + 155  [0x1064db5fb]  scheduler.cr:169
    +                   2712 *Crystal::FiberChannel#receive:Fiber  (in toucan) + 30  [0x1064dbb7e]  fiber_channel.cr:20
    +                     2712 *IO::FileDescriptor+@IO#read_bytes<UInt64.class>:UInt64  (in toucan) + 34  [0x1064e7002]  io.cr:889
    +                       2712 *UInt64@Int::from_io<IO::FileDescriptor+, IO::ByteFormat::LittleEndian:Module>:UInt64  (in toucan) + 34  [0x10649f112]  int.cr:520
    +                         2712 *IO::ByteFormat::LittleEndian::decode<UInt64.class, IO::FileDescriptor+>:UInt64  (in toucan) + 59  [0x1064f3e7b]  byte_format.cr:131
    +                           2712 *IO::FileDescriptor+@IO#read_fully<Slice(UInt8)>:Int32  (in toucan) + 67  [0x1064e4543]  io.cr:513
    +                             2712 *IO::FileDescriptor+@IO#read_fully?<Slice(UInt8)>:(Int32 | Nil)  (in toucan) + 104  [0x1064e45f8]  io.cr:530
    +                               2712 *IO::FileDescriptor+@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 231  [0x1064e4767]  buffered.cr:81
    +                                 2712 *IO::FileDescriptor+@IO::Buffered#fill_buffer:Slice(UInt8)  (in toucan) + 76  [0x1064e52cc]  buffered.cr:214
    +                                   2712 *IO::FileDescriptor+@Crystal::System::FileDescriptor#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 310  [0x1064e49c6]  file_descriptor.cr:59
    +                                     2712 *IO::FileDescriptor+@IO::Evented#wait_readable:Nil  (in toucan) + 60  [0x1064e4f7c]  evented.cr:117
    +                                       2712 *IO::FileDescriptor+@IO::Evented#wait_readable<(Time::Span | Nil)>:Nil  (in toucan) + 680  [0x1064e5238]  evented.cr:125
    +                                         2712 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x1064da7d9]  scheduler.cr:43
    +                                           2712 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x1064da843]  scheduler.cr:146
    +                                             2712 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x1064d9362]  event_loop.cr:16
    +                                               2712 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x1064d9e51]  event.cr:62
    +                                                 2712 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x106ff3343]
    +                                                   2712 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x106ffc5ba]
    +                                                     2712 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffa28f1d96]
    2712 Thread_17322
      2712 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffa29db08d]
        2712 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffa29db887]
          2712 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffa29db93b]
            2712 GC_call_with_stack_base  (in toucan) + 26  [0x1067ff16e]
              2712 GC_inner_start_routine  (in toucan) + 101  [0x10680219f]
                2712 ~procProc(Pointer(Void), Pointer(Void))@/usr/local/Cellar/crystal/0.31.0_1/src/thread.cr:32  (in toucan) + 13  [0x10646569d]  thread.cr:33
                  2712 *Thread#start:(Exception+ | Nil)  (in toucan) + 184  [0x1064c1a18]  thread.cr:255
                    2712 ~proc2Proc(Nil)@/usr/local/Cellar/crystal/0.31.0_1/src/crystal/scheduler.cr:169  (in toucan) + 55  [0x106465687]  scheduler.cr:169
                      2712 *Crystal::Scheduler#run_loop:NoReturn  (in toucan) + 155  [0x1064db5fb]  scheduler.cr:169
                        2712 *Crystal::FiberChannel#receive:Fiber  (in toucan) + 30  [0x1064dbb7e]  fiber_channel.cr:20
                          2712 *IO::FileDescriptor+@IO#read_bytes<UInt64.class>:UInt64  (in toucan) + 34  [0x1064e7002]  io.cr:889
                            2712 *UInt64@Int::from_io<IO::FileDescriptor+, IO::ByteFormat::LittleEndian:Module>:UInt64  (in toucan) + 34  [0x10649f112]  int.cr:520
                              2712 *IO::ByteFormat::LittleEndian::decode<UInt64.class, IO::FileDescriptor+>:UInt64  (in toucan) + 59  [0x1064f3e7b]  byte_format.cr:131
                                2712 *IO::FileDescriptor+@IO#read_fully<Slice(UInt8)>:Int32  (in toucan) + 67  [0x1064e4543]  io.cr:513
                                  2712 *IO::FileDescriptor+@IO#read_fully?<Slice(UInt8)>:(Int32 | Nil)  (in toucan) + 104  [0x1064e45f8]  io.cr:530
                                    2712 *IO::FileDescriptor+@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 231  [0x1064e4767]  buffered.cr:81
                                      2712 *IO::FileDescriptor+@IO::Buffered#fill_buffer:Slice(UInt8)  (in toucan) + 76  [0x1064e52cc]  buffered.cr:214
                                        2712 *IO::FileDescriptor+@Crystal::System::FileDescriptor#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 310  [0x1064e49c6]  file_descriptor.cr:59
                                          2712 *IO::FileDescriptor+@IO::Evented#wait_readable:Nil  (in toucan) + 60  [0x1064e4f7c]  evented.cr:117
                                            2712 *IO::FileDescriptor+@IO::Evented#wait_readable<(Time::Span | Nil)>:Nil  (in toucan) + 680  [0x1064e5238]  evented.cr:125
                                              2712 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x1064da7d9]  scheduler.cr:43
                                                2712 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x1064da843]  scheduler.cr:146
                                                  2712 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x1064d9362]  event_loop.cr:16
                                                    2712 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x1064d9e51]  event.cr:62
                                                      2712 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x106ff3343]
                                                        2712 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x106ffc5ba]
                                                          2712 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffa28f1d96]

Total number in stack (recursive counted multiple, when >=5):
        5       _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffa29db93b]
        5       _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffa29db887]
        5       thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffa29db08d]

Sort by top of stack, same collapsed (when >= 5):
        kevent  (in libsystem_kernel.dylib)        10848
        __psynch_cvwait  (in libsystem_kernel.dylib)        8136

Binary Images:
       0x10644e000 -        0x106897ff7 +toucan (0) <95679652-C092-385C-9833-68678E2FDF70> /usr/local/bin/toucan
       0x106d30000 -        0x106d48fff +libyaml-0.2.dylib (0) <D64BFABD-6330-3455-AEA3-A051EC3B4B3B> /usr/local/opt/libyaml/lib/libyaml-0.2.dylib
       0x106d51000 -        0x106d91fff +libssl.1.0.0.dylib (0) <9BD9BD97-9105-3B6F-950E-C864E96B7C3C> /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
       0x106db3000 -        0x106f26cc7 +libcrypto.1.0.0.dylib (0) <B4F57263-6009-31D3-9027-6D114744EFB0> /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
       0x106fa6000 -        0x106fd3ff3  libpcre.0.dylib (8) <BCEA4851-21D3-3EFD-B66F-438CC1F96AF3> /usr/lib/libpcre.0.dylib
       0x106fdd000 -        0x106fdefff +libevent_pthreads-2.1.7.dylib (0) <4B335AB9-9974-32C4-AA80-A3F649E4B819> /usr/local/opt/libevent/lib/libevent_pthreads-2.1.7.dylib
       0x106fe5000 -        0x107012ff7 +libevent-2.1.7.dylib (0) <E8D7300E-8FE0-33C8-B9C5-DA74B3278FED> /usr/local/opt/libevent/lib/libevent-2.1.7.dylib
       0x111993000 -        0x1119d0dc7  dyld (0.0 - ???) <322C06B7-8878-311D-888C-C8FD2CA96FF3> /usr/lib/dyld
    0x7fffa1218000 -     0x7fffa1219ffb  libSystem.B.dylib (1238.60.2) <F18AC1E7-C6F1-34B1-8069-BE571B3231D4> /usr/lib/libSystem.B.dylib
    0x7fffa1352000 -     0x7fffa13a8ff7  libc++.1.dylib (307.5) <0B43BB5D-E6EB-3464-8DE9-B41AC8ED9D1C> /usr/lib/libc++.1.dylib
    0x7fffa13a9000 -     0x7fffa13d2ff7  libc++abi.dylib (307.4) <BC271AD3-831B-362A-9DA7-E8C51F285FE4> /usr/lib/libc++abi.dylib
    0x7fffa1820000 -     0x7fffa1912ff7  libiconv.2.dylib (50) <42125B35-81D7-3FC4-9475-A26DBE10884D> /usr/lib/libiconv.2.dylib
    0x7fffa1ec7000 -     0x7fffa2299047  libobjc.A.dylib (709.1) <70614861-0340-32E2-85ED-FE65759CDFFA> /usr/lib/libobjc.A.dylib
    0x7fffa26c6000 -     0x7fffa26d7ff3  libz.1.dylib (67) <46E3FFA2-4328-327A-8D34-A03E20BFFB8E> /usr/lib/libz.1.dylib
    0x7fffa26e6000 -     0x7fffa26eaff7  libcache.dylib (79) <093A4DAB-8385-3D47-A350-E20CB7CCF7BF> /usr/lib/system/libcache.dylib
    0x7fffa26eb000 -     0x7fffa26f5fff  libcommonCrypto.dylib (60092.50.5) <8A64D1B0-C70E-385C-92F0-E669079FDA90> /usr/lib/system/libcommonCrypto.dylib
    0x7fffa26f6000 -     0x7fffa26fdfff  libcompiler_rt.dylib (62) <55D47421-772A-32AB-B529-1A46C2F43B4D> /usr/lib/system/libcompiler_rt.dylib
    0x7fffa26fe000 -     0x7fffa2706fff  libcopyfile.dylib (138) <819BEA3C-DF11-3E3D-A1A1-5A51C5BF1961> /usr/lib/system/libcopyfile.dylib
    0x7fffa2707000 -     0x7fffa278afdf  libcorecrypto.dylib (442.50.19) <65D7165E-2E71-335D-A2D6-33F78E2DF0C1> /usr/lib/system/libcorecrypto.dylib
    0x7fffa278b000 -     0x7fffa27bcfff  libdispatch.dylib (703.50.37) <6582BAD6-ED27-3B30-B620-90B1C5A4AE3C> /usr/lib/system/libdispatch.dylib
    0x7fffa27bd000 -     0x7fffa27c2ffb  libdyld.dylib (433.5) <9B2AC56D-107C-3541-A127-9094A751F2C9> /usr/lib/system/libdyld.dylib
    0x7fffa27c3000 -     0x7fffa27c3ffb  libkeymgr.dylib (28) <7AA011A9-DC21-3488-BF73-3B5B14D1FDD6> /usr/lib/system/libkeymgr.dylib
    0x7fffa27d1000 -     0x7fffa27d1fff  liblaunch.dylib (972.70.1) <B856ABD2-896E-3DE0-B2C8-146A6AF8E2A7> /usr/lib/system/liblaunch.dylib
    0x7fffa27d2000 -     0x7fffa27d7ff3  libmacho.dylib (898) <17D5D855-F6C3-3B04-B680-E9BF02EF8AED> /usr/lib/system/libmacho.dylib
    0x7fffa27d8000 -     0x7fffa27daff3  libquarantine.dylib (85.50.1) <12448CC2-378E-35F3-BE33-9DC395A5B970> /usr/lib/system/libquarantine.dylib
    0x7fffa27db000 -     0x7fffa27dcffb  libremovefile.dylib (45) <38D4CB9C-10CD-30D3-8B7B-A515EC75FE85> /usr/lib/system/libremovefile.dylib
    0x7fffa27dd000 -     0x7fffa27f5ff7  libsystem_asl.dylib (349.50.5) <096E4228-3B7C-30A6-8B13-EC909A64499A> /usr/lib/system/libsystem_asl.dylib
    0x7fffa27f6000 -     0x7fffa27f6ff7  libsystem_blocks.dylib (67) <10DC5404-73AB-35B3-A277-A8AFECB476EB> /usr/lib/system/libsystem_blocks.dylib
    0x7fffa27f7000 -     0x7fffa2884fef  libsystem_c.dylib (1158.50.2) <E5AE5244-7D0C-36AC-8BB6-C7AE7EA52A4B> /usr/lib/system/libsystem_c.dylib
    0x7fffa2885000 -     0x7fffa2888ffb  libsystem_configuration.dylib (888.60.2) <BECC01A2-CA8D-31E6-BCDF-D452965FA976> /usr/lib/system/libsystem_configuration.dylib
    0x7fffa2889000 -     0x7fffa288cfff  libsystem_coreservices.dylib (41.4) <7D26DE79-B424-3450-85E1-F7FAB32714AB> /usr/lib/system/libsystem_coreservices.dylib
    0x7fffa288d000 -     0x7fffa28a5fff  libsystem_coretls.dylib (121.50.4) <EC6FCF07-DCFB-3A03-9CC9-6DD3709974C6> /usr/lib/system/libsystem_coretls.dylib
    0x7fffa28a6000 -     0x7fffa28acfff  libsystem_dnssd.dylib (765.50.9) <CC960215-0B1B-3822-A13A-3DDE96FA796F> /usr/lib/system/libsystem_dnssd.dylib
    0x7fffa28ad000 -     0x7fffa28d6ff7  libsystem_info.dylib (503.50.4) <611DB84C-BF70-3F92-8702-B9F28A900920> /usr/lib/system/libsystem_info.dylib
    0x7fffa28d7000 -     0x7fffa28f9ff7  libsystem_kernel.dylib (3789.70.16) <34B1F16C-BC9C-3C5F-9045-0CAE91CB5914> /usr/lib/system/libsystem_kernel.dylib
    0x7fffa28fa000 -     0x7fffa2941fe7  libsystem_m.dylib (3121.6) <86D499B5-BBDC-3D3B-8A4E-97AE8E6672A4> /usr/lib/system/libsystem_m.dylib
    0x7fffa2942000 -     0x7fffa2960ff7  libsystem_malloc.dylib (116.50.8) <A3D15F17-99A6-3367-8C7E-4280E8619C95> /usr/lib/system/libsystem_malloc.dylib
    0x7fffa2961000 -     0x7fffa29baffb  libsystem_network.dylib (856.60.1) <369D0221-56CA-3C3E-9EDE-94B41CAE77B7> /usr/lib/system/libsystem_network.dylib
    0x7fffa29bb000 -     0x7fffa29c4ff3  libsystem_networkextension.dylib (563.60.2) <B021F2B3-8A75-3633-ABB0-FC012B8E9B0C> /usr/lib/system/libsystem_networkextension.dylib
    0x7fffa29c5000 -     0x7fffa29ceff3  libsystem_notify.dylib (165.20.1) <B8160190-A069-3B3A-BDF6-2AA408221FAE> /usr/lib/system/libsystem_notify.dylib
    0x7fffa29cf000 -     0x7fffa29d7fe7  libsystem_platform.dylib (126.50.8) <897462FD-B318-321B-A554-E61982630F7E> /usr/lib/system/libsystem_platform.dylib
    0x7fffa29d8000 -     0x7fffa29e2ff7  libsystem_pthread.dylib (218.60.3) <B8FB5E20-3295-39E2-B5EB-B464D1D4B104> /usr/lib/system/libsystem_pthread.dylib
    0x7fffa29e3000 -     0x7fffa29e6ff7  libsystem_sandbox.dylib (592.70.1) <4B92EC49-ACD0-36AE-B07A-A2B8152EAF9D> /usr/lib/system/libsystem_sandbox.dylib
    0x7fffa29e7000 -     0x7fffa29e8ff3  libsystem_secinit.dylib (24.50.4) <F78B847B-3565-3E4B-98A6-F7AD40392E2D> /usr/lib/system/libsystem_secinit.dylib
    0x7fffa29e9000 -     0x7fffa29f0ffb  libsystem_symptoms.dylib (532.50.47) <3390E07C-C1CE-348F-ADBD-2C5440B45EAA> /usr/lib/system/libsystem_symptoms.dylib
    0x7fffa29f1000 -     0x7fffa2a04ff7  libsystem_trace.dylib (518.70.1) <AC63A7FE-50D9-3A30-96E6-F6B7FF16E465> /usr/lib/system/libsystem_trace.dylib
    0x7fffa2a05000 -     0x7fffa2a0affb  libunwind.dylib (35.3) <3D50D8A8-C460-334D-A519-2DA841102C6B> /usr/lib/system/libunwind.dylib
    0x7fffa2a0b000 -     0x7fffa2a34ff7  libxpc.dylib (972.70.1) <BF896DF0-D8E9-31A8-A4B3-01120BFEEE52> /usr/lib/system/libxpc.dylib
Sample analysis of process 1017 written to file /dev/stdout
  • HTTP(S) Relay
Sampling process 1018 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling toucan (pid 1018) every 1 millisecond
Process:         toucan [1018]
Path:            /usr/local/bin/toucan
Load Address:    0x1018e7000
Identifier:      toucan
Version:         0
Code Type:       X86-64
Parent Process:  bash [816]

Date/Time:       2019-12-27 08:52:06.084 +0800
Launch Time:     2019-12-27 07:46:34.864 +0800
OS Version:      Mac OS X 10.12.6 (16G29)
Report Version:  7
Analysis Tool:   /usr/bin/sample
----

Call graph:
    2714 Thread_17330   DispatchQueue_1: com.apple.main-thread  (serial)
    + 2714 ~procProc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal/0.31.0_1/src/fiber.cr:48  (in toucan) + 9  [0x1018fe039]  fiber.cr:48
    +   2714 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 94  [0x101959a7e]  fiber.cr:255
    +     2714 ~procProc(Nil)@/usr/local/Cellar/crystal/0.31.0_1/src/kernel.cr:542  (in toucan) + 24  [0x1018fdf18]  kernel.cr:542
    +       2714 *sleep<Int32>:Nil  (in toucan) + 66  [0x1018fdf72]  concurrent.cr:15
    +         2714 *Crystal::Scheduler::sleep<Time::Span>:Nil  (in toucan) + 57  [0x1019740f9]  scheduler.cr:51
    +           2714 *Crystal::Scheduler#sleep<Time::Span>:Nil  (in toucan) + 84  [0x101974154]  scheduler.cr:157
    +             2714 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x101973843]  scheduler.cr:146
    +               2714 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x101972362]  event_loop.cr:16
    +                 2714 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x101972e51]  event.cr:62
    +                   2714 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10248c343]
    +                     2714 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x1024955ba]
    +                       2714 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffa28f1d96]
    2714 Thread_17331
    + 2714 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffa29db08d]
    +   2714 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffa29db887]
    +     2714 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffa29db93b]
    +       2714 GC_mark_thread  (in toucan) + 132  [0x101c9b2d8]
    +         2714 GC_help_marker  (in toucan) + 46  [0x101c95626]
    +           2714 GC_wait_marker  (in toucan) + 23  [0x101c9cacd]
    +             2714 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffa29dc7fa]
    +               2714 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffa28f0bf2]
    2714 Thread_17332
    + 2714 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffa29db08d]
    +   2714 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffa29db887]
    +     2714 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffa29db93b]
    +       2714 GC_mark_thread  (in toucan) + 132  [0x101c9b2d8]
    +         2714 GC_help_marker  (in toucan) + 46  [0x101c95626]
    +           2714 GC_wait_marker  (in toucan) + 23  [0x101c9cacd]
    +             2714 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffa29dc7fa]
    +               2714 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffa28f0bf2]
    2714 Thread_17333
    + 2714 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffa29db08d]
    +   2714 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffa29db887]
    +     2714 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffa29db93b]
    +       2714 GC_mark_thread  (in toucan) + 132  [0x101c9b2d8]
    +         2714 GC_help_marker  (in toucan) + 46  [0x101c95626]
    +           2714 GC_wait_marker  (in toucan) + 23  [0x101c9cacd]
    +             2714 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffa29dc7fa]
    +               2714 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffa28f0bf2]
    2714 Thread_17334
    + 2714 ~proc2Proc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal/0.31.0_1/src/fiber.cr:48  (in toucan) + 9  [0x1018fe319]  fiber.cr:48
    +   2714 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 748  [0x101959d0c]  fiber.cr:98
    +     2714 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x1019737d9]  scheduler.cr:43
    +       2714 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x101973843]  scheduler.cr:146
    +         2714 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x101972362]  event_loop.cr:16
    +           2714 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x101972e51]  event.cr:62
    +             2714 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10248c343]
    +               2714 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x1024955ba]
    +                 2714 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffa28f1d96]
    2714 Thread_17335
    + 2714 ~proc2Proc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal/0.31.0_1/src/fiber.cr:48  (in toucan) + 9  [0x1018fe319]  fiber.cr:48
    +   2714 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 748  [0x101959d0c]  fiber.cr:98
    +     2714 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x1019737d9]  scheduler.cr:43
    +       2714 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x101973843]  scheduler.cr:146
    +         2714 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x101972362]  event_loop.cr:16
    +           2714 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x101972e51]  event.cr:62
    +             2714 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10248c343]
    +               2714 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x1024955ba]
    +                 2714 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffa28f1d96]
    2714 Thread_17336
      2714 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffa29db08d]
        2714 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffa29db887]
          2714 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffa29db93b]
            2714 GC_call_with_stack_base  (in toucan) + 26  [0x101c9816e]
              2714 GC_inner_start_routine  (in toucan) + 101  [0x101c9b19f]
                2714 ~procProc(Pointer(Void), Pointer(Void))@/usr/local/Cellar/crystal/0.31.0_1/src/thread.cr:32  (in toucan) + 13  [0x1018fe69d]  thread.cr:33
                  2714 *Thread#start:(Exception+ | Nil)  (in toucan) + 184  [0x10195aa18]  thread.cr:255
                    2714 ~proc2Proc(Nil)@/usr/local/Cellar/crystal/0.31.0_1/src/crystal/scheduler.cr:169  (in toucan) + 55  [0x1018fe687]  scheduler.cr:169
                      2714 *Crystal::Scheduler#run_loop:NoReturn  (in toucan) + 155  [0x1019745fb]  scheduler.cr:169
                        2714 *Crystal::FiberChannel#receive:Fiber  (in toucan) + 30  [0x101974b7e]  fiber_channel.cr:20
                          2714 *IO::FileDescriptor+@IO#read_bytes<UInt64.class>:UInt64  (in toucan) + 34  [0x101980002]  io.cr:889
                            2714 *UInt64@Int::from_io<IO::FileDescriptor+, IO::ByteFormat::LittleEndian:Module>:UInt64  (in toucan) + 34  [0x101938112]  int.cr:520
                              2714 *IO::ByteFormat::LittleEndian::decode<UInt64.class, IO::FileDescriptor+>:UInt64  (in toucan) + 59  [0x10198ce7b]  byte_format.cr:131
                                2714 *IO::FileDescriptor+@IO#read_fully<Slice(UInt8)>:Int32  (in toucan) + 67  [0x10197d543]  io.cr:513
                                  2714 *IO::FileDescriptor+@IO#read_fully?<Slice(UInt8)>:(Int32 | Nil)  (in toucan) + 104  [0x10197d5f8]  io.cr:530
                                    2714 *IO::FileDescriptor+@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 231  [0x10197d767]  buffered.cr:81
                                      2714 *IO::FileDescriptor+@IO::Buffered#fill_buffer:Slice(UInt8)  (in toucan) + 76  [0x10197e2cc]  buffered.cr:214
                                        2714 *IO::FileDescriptor+@Crystal::System::FileDescriptor#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 310  [0x10197d9c6]  file_descriptor.cr:59
                                          2714 *IO::FileDescriptor+@IO::Evented#wait_readable:Nil  (in toucan) + 60  [0x10197df7c]  evented.cr:117
                                            2714 *IO::FileDescriptor+@IO::Evented#wait_readable<(Time::Span | Nil)>:Nil  (in toucan) + 680  [0x10197e238]  evented.cr:125
                                              2714 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x1019737d9]  scheduler.cr:43
                                                2714 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x101973843]  scheduler.cr:146
                                                  2714 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x101972362]  event_loop.cr:16
                                                    2714 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x101972e51]  event.cr:62
                                                      2714 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10248c343]
                                                        2714 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x1024955ba]
                                                          2714 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffa28f1d96]

Total number in stack (recursive counted multiple, when >=5):

Sort by top of stack, same collapsed (when >= 5):
        kevent  (in libsystem_kernel.dylib)        10856
        __psynch_cvwait  (in libsystem_kernel.dylib)        8142

Binary Images:
       0x1018e7000 -        0x101d30ff7 +toucan (0) <95679652-C092-385C-9833-68678E2FDF70> /usr/local/bin/toucan
       0x1021c8000 -        0x1021e0fff +libyaml-0.2.dylib (0) <D64BFABD-6330-3455-AEA3-A051EC3B4B3B> /usr/local/opt/libyaml/lib/libyaml-0.2.dylib
       0x1021e8000 -        0x102228fff +libssl.1.0.0.dylib (0) <9BD9BD97-9105-3B6F-950E-C864E96B7C3C> /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
       0x10224e000 -        0x1023c1cc7 +libcrypto.1.0.0.dylib (0) <B4F57263-6009-31D3-9027-6D114744EFB0> /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
       0x102440000 -        0x10246dff3  libpcre.0.dylib (8) <BCEA4851-21D3-3EFD-B66F-438CC1F96AF3> /usr/lib/libpcre.0.dylib
       0x10247a000 -        0x10247bfff +libevent_pthreads-2.1.7.dylib (0) <4B335AB9-9974-32C4-AA80-A3F649E4B819> /usr/local/opt/libevent/lib/libevent_pthreads-2.1.7.dylib
       0x10247e000 -        0x1024abff7 +libevent-2.1.7.dylib (0) <E8D7300E-8FE0-33C8-B9C5-DA74B3278FED> /usr/local/opt/libevent/lib/libevent-2.1.7.dylib
       0x10bead000 -        0x10beeadc7  dyld (0.0 - ???) <322C06B7-8878-311D-888C-C8FD2CA96FF3> /usr/lib/dyld
    0x7fffa1218000 -     0x7fffa1219ffb  libSystem.B.dylib (1238.60.2) <F18AC1E7-C6F1-34B1-8069-BE571B3231D4> /usr/lib/libSystem.B.dylib
    0x7fffa1352000 -     0x7fffa13a8ff7  libc++.1.dylib (307.5) <0B43BB5D-E6EB-3464-8DE9-B41AC8ED9D1C> /usr/lib/libc++.1.dylib
    0x7fffa13a9000 -     0x7fffa13d2ff7  libc++abi.dylib (307.4) <BC271AD3-831B-362A-9DA7-E8C51F285FE4> /usr/lib/libc++abi.dylib
    0x7fffa1820000 -     0x7fffa1912ff7  libiconv.2.dylib (50) <42125B35-81D7-3FC4-9475-A26DBE10884D> /usr/lib/libiconv.2.dylib
    0x7fffa1ec7000 -     0x7fffa2299047  libobjc.A.dylib (709.1) <70614861-0340-32E2-85ED-FE65759CDFFA> /usr/lib/libobjc.A.dylib
    0x7fffa26c6000 -     0x7fffa26d7ff3  libz.1.dylib (67) <46E3FFA2-4328-327A-8D34-A03E20BFFB8E> /usr/lib/libz.1.dylib
    0x7fffa26e6000 -     0x7fffa26eaff7  libcache.dylib (79) <093A4DAB-8385-3D47-A350-E20CB7CCF7BF> /usr/lib/system/libcache.dylib
    0x7fffa26eb000 -     0x7fffa26f5fff  libcommonCrypto.dylib (60092.50.5) <8A64D1B0-C70E-385C-92F0-E669079FDA90> /usr/lib/system/libcommonCrypto.dylib
    0x7fffa26f6000 -     0x7fffa26fdfff  libcompiler_rt.dylib (62) <55D47421-772A-32AB-B529-1A46C2F43B4D> /usr/lib/system/libcompiler_rt.dylib
    0x7fffa26fe000 -     0x7fffa2706fff  libcopyfile.dylib (138) <819BEA3C-DF11-3E3D-A1A1-5A51C5BF1961> /usr/lib/system/libcopyfile.dylib
    0x7fffa2707000 -     0x7fffa278afdf  libcorecrypto.dylib (442.50.19) <65D7165E-2E71-335D-A2D6-33F78E2DF0C1> /usr/lib/system/libcorecrypto.dylib
    0x7fffa278b000 -     0x7fffa27bcfff  libdispatch.dylib (703.50.37) <6582BAD6-ED27-3B30-B620-90B1C5A4AE3C> /usr/lib/system/libdispatch.dylib
    0x7fffa27bd000 -     0x7fffa27c2ffb  libdyld.dylib (433.5) <9B2AC56D-107C-3541-A127-9094A751F2C9> /usr/lib/system/libdyld.dylib
    0x7fffa27c3000 -     0x7fffa27c3ffb  libkeymgr.dylib (28) <7AA011A9-DC21-3488-BF73-3B5B14D1FDD6> /usr/lib/system/libkeymgr.dylib
    0x7fffa27d1000 -     0x7fffa27d1fff  liblaunch.dylib (972.70.1) <B856ABD2-896E-3DE0-B2C8-146A6AF8E2A7> /usr/lib/system/liblaunch.dylib
    0x7fffa27d2000 -     0x7fffa27d7ff3  libmacho.dylib (898) <17D5D855-F6C3-3B04-B680-E9BF02EF8AED> /usr/lib/system/libmacho.dylib
    0x7fffa27d8000 -     0x7fffa27daff3  libquarantine.dylib (85.50.1) <12448CC2-378E-35F3-BE33-9DC395A5B970> /usr/lib/system/libquarantine.dylib
    0x7fffa27db000 -     0x7fffa27dcffb  libremovefile.dylib (45) <38D4CB9C-10CD-30D3-8B7B-A515EC75FE85> /usr/lib/system/libremovefile.dylib
    0x7fffa27dd000 -     0x7fffa27f5ff7  libsystem_asl.dylib (349.50.5) <096E4228-3B7C-30A6-8B13-EC909A64499A> /usr/lib/system/libsystem_asl.dylib
    0x7fffa27f6000 -     0x7fffa27f6ff7  libsystem_blocks.dylib (67) <10DC5404-73AB-35B3-A277-A8AFECB476EB> /usr/lib/system/libsystem_blocks.dylib
    0x7fffa27f7000 -     0x7fffa2884fef  libsystem_c.dylib (1158.50.2) <E5AE5244-7D0C-36AC-8BB6-C7AE7EA52A4B> /usr/lib/system/libsystem_c.dylib
    0x7fffa2885000 -     0x7fffa2888ffb  libsystem_configuration.dylib (888.60.2) <BECC01A2-CA8D-31E6-BCDF-D452965FA976> /usr/lib/system/libsystem_configuration.dylib
    0x7fffa2889000 -     0x7fffa288cfff  libsystem_coreservices.dylib (41.4) <7D26DE79-B424-3450-85E1-F7FAB32714AB> /usr/lib/system/libsystem_coreservices.dylib
    0x7fffa288d000 -     0x7fffa28a5fff  libsystem_coretls.dylib (121.50.4) <EC6FCF07-DCFB-3A03-9CC9-6DD3709974C6> /usr/lib/system/libsystem_coretls.dylib
    0x7fffa28a6000 -     0x7fffa28acfff  libsystem_dnssd.dylib (765.50.9) <CC960215-0B1B-3822-A13A-3DDE96FA796F> /usr/lib/system/libsystem_dnssd.dylib
    0x7fffa28ad000 -     0x7fffa28d6ff7  libsystem_info.dylib (503.50.4) <611DB84C-BF70-3F92-8702-B9F28A900920> /usr/lib/system/libsystem_info.dylib
    0x7fffa28d7000 -     0x7fffa28f9ff7  libsystem_kernel.dylib (3789.70.16) <34B1F16C-BC9C-3C5F-9045-0CAE91CB5914> /usr/lib/system/libsystem_kernel.dylib
    0x7fffa28fa000 -     0x7fffa2941fe7  libsystem_m.dylib (3121.6) <86D499B5-BBDC-3D3B-8A4E-97AE8E6672A4> /usr/lib/system/libsystem_m.dylib
    0x7fffa2942000 -     0x7fffa2960ff7  libsystem_malloc.dylib (116.50.8) <A3D15F17-99A6-3367-8C7E-4280E8619C95> /usr/lib/system/libsystem_malloc.dylib
    0x7fffa2961000 -     0x7fffa29baffb  libsystem_network.dylib (856.60.1) <369D0221-56CA-3C3E-9EDE-94B41CAE77B7> /usr/lib/system/libsystem_network.dylib
    0x7fffa29bb000 -     0x7fffa29c4ff3  libsystem_networkextension.dylib (563.60.2) <B021F2B3-8A75-3633-ABB0-FC012B8E9B0C> /usr/lib/system/libsystem_networkextension.dylib
    0x7fffa29c5000 -     0x7fffa29ceff3  libsystem_notify.dylib (165.20.1) <B8160190-A069-3B3A-BDF6-2AA408221FAE> /usr/lib/system/libsystem_notify.dylib
    0x7fffa29cf000 -     0x7fffa29d7fe7  libsystem_platform.dylib (126.50.8) <897462FD-B318-321B-A554-E61982630F7E> /usr/lib/system/libsystem_platform.dylib
    0x7fffa29d8000 -     0x7fffa29e2ff7  libsystem_pthread.dylib (218.60.3) <B8FB5E20-3295-39E2-B5EB-B464D1D4B104> /usr/lib/system/libsystem_pthread.dylib
    0x7fffa29e3000 -     0x7fffa29e6ff7  libsystem_sandbox.dylib (592.70.1) <4B92EC49-ACD0-36AE-B07A-A2B8152EAF9D> /usr/lib/system/libsystem_sandbox.dylib
    0x7fffa29e7000 -     0x7fffa29e8ff3  libsystem_secinit.dylib (24.50.4) <F78B847B-3565-3E4B-98A6-F7AD40392E2D> /usr/lib/system/libsystem_secinit.dylib
    0x7fffa29e9000 -     0x7fffa29f0ffb  libsystem_symptoms.dylib (532.50.47) <3390E07C-C1CE-348F-ADBD-2C5440B45EAA> /usr/lib/system/libsystem_symptoms.dylib
    0x7fffa29f1000 -     0x7fffa2a04ff7  libsystem_trace.dylib (518.70.1) <AC63A7FE-50D9-3A30-96E6-F6B7FF16E465> /usr/lib/system/libsystem_trace.dylib
    0x7fffa2a05000 -     0x7fffa2a0affb  libunwind.dylib (35.3) <3D50D8A8-C460-334D-A519-2DA841102C6B> /usr/lib/system/libunwind.dylib
    0x7fffa2a0b000 -     0x7fffa2a34ff7  libxpc.dylib (972.70.1) <BF896DF0-D8E9-31A8-A4B3-01120BFEEE52> /usr/lib/system/libxpc.dylib
Sample analysis of process 1018 written to file /dev/stdout

@ysbaddaden
Copy link
Contributor

It looks like an OpenSSL call is blocking the whole thread, which prevents the event loop/fibers to run?

BIO_read should be event loop compatible, but maybe there is a bug, or we call a blocking openssl function.

How does it fare with MT enabled?

@ysbaddaden
Copy link
Contributor

Sorry, you enabled MT but force same thread, which prevents fibers to run on many threads, thus don't benefit much from it (one blocking ssl connection will block all others).

@ysbaddaden
Copy link
Contributor

Stupid question: i see you spawn a fiber for each server, but do you spawn a fiber to handle each client connection? If not, each server will only be capable to handle a single connection at a time.

@636f7374
Copy link
Author

@ysbaddaden !!!

It looks like an OpenSSL call is blocking the whole thread, which prevents the event loop/fibers to run?

BIO_read should be event loop compatible, but maybe there is a bug, or we call a blocking openssl function.

How does it fare with MT enabled?
Sorry, you enabled MT but force same thread, which prevents fibers to run on many threads, thus don't benefit much from it (one blocking ssl connection will block all others).

Oops! I did as written on the official website, Maybe I understood the mistake at the time (May be due to translation problems. 😅)

Okay, I should delete all same_thread: true?

@ysbaddaden
Copy link
Contributor

See my last question, if you missed it.

@636f7374
Copy link
Author

636f7374 commented Dec 27, 2019

@ysbaddaden Yes.

  • Setup
  def self.listen_servers(servers : Array(HttpServerType))
    channel = Channel(Nil).new
    servers.each do |server|
      spawn server.listen
    end ensure channel.send nil

    servers.size.times { channel.receive }
  end

  def self.listen_all
    Config.load_default_setup do |setup|
      servers = [] of HttpServerType
      Tunnel.create_servers servers, setup
      Relay.create_servers servers, setup
      listen_servers servers
    end
  end

  {% for name in ["relay", "tunnel"] %}
  class {{name.capitalize.id}}
    alias ToucanType = Toucan::{{name.capitalize.id}}
    alias OptionType = Option::{{name.capitalize.id}}

    def self.to_option(setup : Parser::Setup, &block)
      setup.{{name.id}}.try &.each do |item|
        yield OptionType.from_setup item
      end
    end

    def self.create_servers(servers, setup : Parser::Setup)
      to_option setup do |option|
        ToucanType.bind option do |server|
          servers << server if server
        end
      end
    end

    def self.listen(option)
      Config.load_setup option.setupPath do |setup|
        setup.try do |_setup|
          servers = [] of HttpServerType
          create_servers servers, _setup
          Setup.listen_servers servers
        end
      end
    end
  end
  {% end %}
  • HTTP(S) Tunnel with MITM
    def accept!(server : Socket::Server)
      while socket = server.accept?
        socket.try do |client|
          _client = client.as TCPSocket
          spawn same_thread: true do
            handle_client _client
          end
        end
      end
    end

    def listen
      raise "Can't re-start closed server" if closed?
      raise "Can't start server with no sockets to listen to, use Http::Proxy#bind first" if servers.empty?
      raise "Can't start running server" if listening?

      @listening = true
      channel = Channel(Nil).new

      servers.each do |server|
        spawn same_thread: true do
          until closed?
            accept server
          end
        ensure
          channel.send nil
        end
      end

      servers.size.times { channel.receive }
    end
---
tunnel:
- bindHost: 0.0.0.0
  bindPort: 1234
- bindHost: 0.0.0.0
  bindPort: 2345
...

@636f7374
Copy link
Author

636f7374 commented Dec 27, 2019

@ysbaddaden
it can listen on multiple ports and allocate fiber for each,
Then each server accepts each client and assigns them a fiber.

By default, each tunnel server will only listen on one.

@636f7374
Copy link
Author

@ysbaddaden Under normal circumstances, no problem, this problem does not occur often.

When busy? Or when the connection speed is poor? This problem will appear.
This problem will suddenly appear.

@636f7374
Copy link
Author

636f7374 commented Dec 27, 2019

@ysbaddaden

I added another fiber in perform. I don't know if it will solve this problem. It is being tested.

I also tried to remove same_thread: true, If there are any new developments, I will post them here.

Thank you for your help! 🙏

    def perform(request : HTTP::Request)
> spawn same_thread: true do
      client = upgrade_client _client, request

      unless client
        return ...
      end

      logger.try &.connect_to host, port
      upstream = connect_server

      unless upstream
        return ...
      end

      set_remote_socket_timeout upstream
      server = upgrade_server upstream, request

      unless server
        return ...
      end

      transport client, server, _extract
    end
> end
end

@ysbaddaden
Copy link
Contributor

OK. There is probabky a blocking openssl call somewhere or a bug in BIO.

Same thread prevents other threads from handling the fiber, thus doesn't benefit from MT, since a single thread handles all fibers.

@636f7374
Copy link
Author

636f7374 commented Dec 27, 2019

@ysbaddaden After testing, I have deleted all same_thread: true, There seems to be some improvement in performance, but the problem remains.

if I kill (HTTP(S) Tunnel with MITM), Then the (HTTP(S) Relay) It will quickly process the remaining accepted connections.

if I kill (HTTP(S) Relay), and then restart (HTTP(S) Relay), It won't get stuck and process the request as usual.

If you use openssl s_client connection (HTTP (S) Relay) during the stuck process, then CONNECTED (00000003) will appear, and it will always get stuck.

@ysbaddaden


OK. There is probabky a blocking openssl call somewhere or a bug in BIO.

HTTP (S) Relay uses only HTTP::Handler,
probably in (HTTP (S) Relay)?, I am testing.

  • HTTP (S) Relay
    def call(context : HTTP::Server::Context)
      _logger = Logger.new logger, 3_i32
      set_logger_option _logger
      _logger.connect_to_relay context
      load_..., logger

      Request.new context do |request|
        request... = ...

        request.logger = _logger
        request.option = option

        request.chunk_stream request.body_io do |stream|
          request.set_auto_decompress
          ...
          request.show_summary

          request.create stream do |response|
            ...
            response.show_summary
            response.set_stream_body

            # response.upgrade request do |processor|
            #  processor.perform
            # end

            unless response.upgraded?
              _logger.finished unless response.transportError
            end
          end
        end
      end
    end

If you kill (HTTP (S) Tunnel with MITM) at this time, openssl s_client will be quickly accepted and show:

depth=0 C = FI, ST = " ", L = " ", O = " ", OU = " ", CN = Finland, emailAddress = " "
verify error:num=18:self signed certificate
verify return:1
depth=0 C = FI, ST = " ", L = " ", O = " ", OU = " ", CN = Finland, emailAddress = " "
verify return:1
---
Certificate chain
 0 s:/C=FI/ST= /L= /O= /OU= /CN=Finland/emailAddress= 
   i:/C=FI/ST= /L= /O= /OU= /CN=Finland/emailAddress= 
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIJlTCCBX2gAwIBAgIJANiiV+GF3hs6MA0GCSqGSIb3DQEBCwUAMGExCzAJBgNV
BAYTAkZJMQowCAYDVQQIDAEgMQowCAYDVQQHDAEgMQowCAYDVQQKDAEgMQowCAYD
VQQLDAEgMRAwDgYDVQQDDAdGaW5sYW5kMRAwDgYJKoZIhvcNAQkBFgEgMB4XDTE5
MDYzMDA4MjIxNFoXDTIxMDYyOTA4MjIxNFowYTELMAkGA1UEBhMCRkkxCjAIBgNV
BAgMASAxCjAIBgNVBAcMASAxCjAIBgNVBAoMASAxCjAIBgNVBAsMASAxEDAOBgNV
BAMMB0ZpbmxhbmQxEDAOBgkqhkiG9w0BCQEWASAwggQiMA0GCSqGSIb3DQEBAQUA
A4IEDwAwggQKAoIEAQD+8Q482p9V11UleujbwYAjGwTW1uVi/RTY9wyqgbP8pKli
9i+EZIrCSRYYiiqFqFMGJBqnN/U4cXfOyzZuHHvmF2lePNFupPqp9MPuTpiGlJGe
e1TYyYZM3RUMU2MTduYW9zw7JIDK939U8an1XfTLGq4GCLWW70CSu4YB5Ko/RfG0
zxRDUiVp9bigqFw0DJFVLZ7oNL0YmAn6vX6xb/ZlgWDdLaAdr4/Pa/tM3Vuw4hL6
BqxKI2HdaxqNRxzdXW9XhUrmnCSSZ26eVlhFQS6BIPNUmfx5iipgv7NK9pEXmJHx
ToYcO0RphIVYacXf0hJz2ffbIgIVzLMEb/ys/dSpAGHdF1+xbaAZ3wPe2ornNCAt
yJIymEvtV9foOSU2uEfJ9IVgcnEnzyivgkPh0nsBLsDVioJaE3TxQfPsngAgd0tb
1zbjtVUw40ctRlPjOW3jaodNtf0wJXgtcLqgp5BUiMdbt4r12qSIW7jHSIGxnTlV
7ij7bsSfDUooPinBVhWaIAKFBS8wK2kPI8Ns9mVo5W43EkkavfsvuHXfFUHXR0Pq
xvHa7qNzJpMsG/0max3zxZHYA2/Px0DrJ3C9pgoe8PNo/+PvMjKkDJAO7r4RcwRV
6RBaaWKWnKzX7NKacL/r0OjRBEAYKmA3sJDSP3Oyo2VagLxOQjtu9JfSc1CZq9Hq
OFAJZnCXf/hoDIbmCkr8H4WyO/mVG7sa4Egg/lqyVpft8vFZG7UQzpgeE2py0rxS
QU9pKyOxuG3sZqoHVa/OagHg8tlNBizwR8YT1VMmk/aWCxF6nS47du/3+3Js6BBN
79OtkWC4+pGlrzw3gWmmpxGYtD4/hUcfgK++GkIwTPTMqSX5+Gt98m/OdOadAhpf
eIsY048SWxRHFAWFmT58Nw0JGmtikhDJ14Jih1SED7aPJtfcbY8pDI4EF4KqWMLe
Fd7JLASzchwM+mcXsXUaAXW90N6zEZi0PC3bOssAR6ztMftIFTogJTRKP+9pi9Od
RffySFNQiPxehGhNKetoD6GZbXHRYWFnGbXu6SGNiZnxDRvIL5OFW7nKaGVSe4hD
fR4Hzw1SThbbZ/4utRe8AhFdEMc+1Zx3YfFuv/6AYgt1uXMBvXJRlWz/FNHdvrr7
W9LgNiTHwfSRmtouKqwJ4GJ2g5T8lcJQUNhYx7ii4C1z0T0V9MVJ6C7crzeNS9ZY
uGKPLi/bSZErceuxqxjpEPODS4IhrgwO1HBpJbxF87aXDvRdJQRUIlEpGHSkO2y9
dTujPAXdAz/BuYn/W7T55VpjM1WCn93/mv207q1CJvN5zT9k7XyvEJbjP0aXSMmc
XDMjfehOkIxyZedqMea+vUQV+1xun9LKL3arAzQpAgMBAAGjUDBOMB0GA1UdDgQW
BBTBhQ9GtGlUFEekljiRJsYQf4ZOPTAfBgNVHSMEGDAWgBTBhQ9GtGlUFEekljiR
JsYQf4ZOPTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IEAQBCNbt6Nd7U
9GgGBlkKDADnOSDa4uYfnwxTwzq/xsMpM0ukgTzZMv5KbaPchlZC3eZE/58UsrST
vqvYpH8U2UHQx4UpLncmyrEXtlojjG93uejVQPONxGlGeDuQ0h3zDgUkc6yz1W5+
CfZRLjernOl1RXRQcg4966XhGSscReueV+h5jFQ8xMyOGfrCSTRYqCr+hkwxo3cS
jKLBMHRJgbjaZFlW3E1C6vag1mDoR1dhmJYV80maW3ZpngrlrPRzMzrBJaXVb07X
GFx1MROCmDC2kidvd/YtkrD5dOWerAAg8Tf4NPLxPQZWc0yc1IkGVTaQt1XwOJCW
I1uSmhiUamvW2+wuLGDYKCq/2Gz2IUqf4j8h2YCVaIUE+2GzlDjlk9RommupkGXo
9Qgvjf/dh7y4Jm43TDOYolrxJNOm7IciuRjfytfVVFvohKmFKL6fS7ozOXBFzTps
rSW9lX7Acek23WHg4AsYBcsHo03NWeraoTPeyVR//PsiDO9TS/19RAuZBfsFzfY0
5MSWpZX3H71pLQDLtecVvCyWqzczzSFpywvhYlbTXX2dixBdnLFiXRdZhJwyEBbW
WlY3Ht5u7/9sPDQn6e+HXl1bQ06EW7ZiNbVmCotwL9aC7gmtujxASBsYZsfFwtXp
wApOfMHkkfln4PisaWOH3zQMXGPe0fLJzlTWNUydlRKBOcb4BCe+HQAfbzC8ySWr
t4WGmiXvDobi+YXWOqppXNAjYAvDwYud/NOz9WUGsRpCvCm3J5zqPq+xNqsEDVwK
a2eTzcffLhDfafF84oXX+/v8Zeafbp0g29XuUmBs6bvnwF/1S0MNNb/kxElGt+w4
XN/4Uro70pr1ITPBlHOdtTd9BEix6uHH1CVxxt11LeOlunOIvYNqIjrcmOZVhrIK
a9fi1ijdwOOOD4XKuolTJ6uVbGziKIcVcjMMMb03eLyf6T5/ylkTyUyS6Ok++07K
0GZ92olqOMvSN2Cw7NDwKQZ9m32i5XnreSAxK3rh6h5YNGg5yrNBBalLe9hMFUV9
h7J1LTcG6AsTSpsnrcrz5s+y0GysEvbR5Nn+egCYpYdFqkpCaT07eLry9YEZ84JF
vjcFWhfJyShnpYxQiRs7gpEiUp7zp1Ymn71joGAiz8Id5M4Bl9ftavQAf6x36EA2
FcuOQ8G8e+wCQrGkLORSeYXFHXU5aVO1UriXIHW1zeNy0cQj0oGg3SbXIP0ERUH/
vLGsV0aahhpN61SIoQpGd6qX85a/6Sv5TgPh1tEq4FA9G3G1xUrU0gY2GYiiX89F
mYkTmGtlHhPQaAO2HxZvbqaYg1vmXVEJTIj4AfjhGEhxDwlGE1BFEG5LSBjGuwdE
XXe4Asu6d1qW
-----END CERTIFICATE-----
subject=/C=FI/ST= /L= /O= /OU= /CN=Finland/emailAddress= 
issuer=/C=FI/ST= /L= /O= /OU= /CN=Finland/emailAddress= 
---
No client certificate CA names sent
---
SSL handshake has read 2770 bytes and written 1393 bytes
---
New, TLSv1/SSLv3, Cipher is AES256-GCM-SHA384
Server public key is 8192 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : AES256-GCM-SHA384
    Session-ID: A957A35E11A34575D421F02DBC5421EF7095430598E54199D3251B8412095BFD
    Session-ID-ctx: 
    Master-Key: 3F9504D480722EED93BD84CD9DCD0BC617CEF5F2EEA21BC6BA084B920C4825BD1F5D2852A83E16017A6616B9C3714A66
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    TLS session ticket lifetime hint: 300 (seconds)
    TLS session ticket:
    0000 - 68 1d 55 68 77 f8 03 89-c6 ca 8d 29 71 ec 89 b8   h.Uhw......)q...
    0010 - a8 0e fc 3c 45 c9 dd 31-82 4d a5 e0 8f d1 7e 55   ...<E..1.M....~U
    0020 - dc f8 dc 0e 30 7a 21 b2-0a 3d 4f c7 d5 d4 d7 2d   ....0z!..=O....-
    0030 - c5 64 9f 52 71 10 42 ae-93 be d2 50 89 6e 17 6b   .d.Rq.B....P.n.k
    0040 - 3c 29 bb b5 aa 2f 17 72-6f b4 05 a6 bb 32 a3 5d   <).../.ro....2.]
    0050 - 03 d2 ef 90 52 87 99 fa-b2 df 04 91 97 02 21 b9   ....R.........!.
    0060 - 2c 58 9a 76 c1 73 c6 48-0a cd 2a c5 54 68 14 cc   ,X.v.s.H..*.Th..
    0070 - 4e 14 b1 dd db 34 01 6f-f1 3a 5a dc 51 b9 fb d6   N....4.o.:Z.Q...
    0080 - 43 12 e7 c4 7b 11 3e 22-c5 a4 06 93 0c 21 58 92   C...{.>".....!X.
    0090 - 4e c8 3b 18 09 2b 6c 1e-09 46 00 67 09 fa a7 c1   N.;..+l..F.g....

    Start Time: 1577462009
    Timeout   : 300 (sec)
    Verify return code: 18 (self signed certificate)
---
read:errno=0

Call graph

  • HTTP(S) Relay
Sampling process 6187 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling toucan (pid 6187) every 1 millisecond
Process:         toucan [6187]
Path:            /usr/local/bin/toucan
Load Address:    0x1060f3000
Identifier:      toucan
Version:         0
Code Type:       X86-64
Parent Process:  bash [816]

Date/Time:       2019-12-27 18:09:39.012 +0800
Launch Time:     2019-12-27 18:07:11.612 +0800
OS Version:      Mac OS X 10.12.6 (16G29)
Report Version:  7
Analysis Tool:   /usr/bin/sample
----

Call graph:
    2567 Thread_205099   DispatchQueue_1: com.apple.main-thread  (serial)
    + 2567 ~proc2Proc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal/0.31.0_1/src/fiber.cr:48  (in toucan) + 9  [0x106109c39]  fiber.cr:48
    +   2567 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 112  [0x106165c40]  fiber.cr:255
    +     2567 ~procProc(Nil)@lib/cherry/src/cherry/http/server.cr:80  (in toucan) + 23  [0x106114727]  server.cr:81
    +       2567 *HTTP::Server#handle_client<Socket::Server, IO+>:Nil  (in toucan) + 374  [0x106401e06]  server.cr:131
    +         2567 *HTTP::Server::RequestProcessor#process<IO+, IO+>:Nil  (in toucan) + 53  [0x106402885]  request_processor.cr:22
    +           2567 *HTTP::Server::RequestProcessor#process<IO+, IO+, IO::FileDescriptor>:Nil  (in toucan) + 2171  [0x10640310b]  request_processor.cr:48
    +             2567 *Toucan::Relay::Http::Server#call<HTTP::Server::Context>:(IO+ | Int32 | Nil)  (in toucan) + 2253  [0x10638c92d]  server.cr:627
    +               2567 *HTTP::Client#send_request<HTTP::Request>:Bool  (in toucan) + 59  [0x10645778b]  client.cr:643
    +                 2567 *HTTP::Client#socket:IO+  (in toucan) + 292  [0x106457ed4]  client.cr:107
    +                   2567 *TCPSocket::new<String, Int32, (Float64 | Nil), (Float64 | Nil)>:TCPSocket  (in toucan) + 490  [0x10642522a]  tcp_socket.cr:27
    +                     2567 *TCPSocket#initialize<String, Int32, (Float64 | Nil), (Float64 | Nil)>:Nil  (in toucan) + 1092  [0x106425684]  tcp_socket.cr:120
    +                       2567 getaddrinfo  (in libsystem_info.dylib) + 185  [0x7fffa28b1ad7]
    +                         2567 si_addrinfo  (in libsystem_info.dylib) + 1945  [0x7fffa28b2317]
    +                           2567 search_addrinfo  (in libsystem_info.dylib) + 179  [0x7fffa28b6128]
    +                             2567 mdns_addrinfo  (in libsystem_info.dylib) + 631  [0x7fffa28b63e5]
    +                               2567 _mdns_search  (in libsystem_info.dylib) + 1294  [0x7fffa28b4737]
    +                                 2567 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffa28f1d96]
    2567 Thread_205101
    + 2567 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffa29db08d]
    +   2567 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffa29db887]
    +     2567 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffa29db93b]
    +       2567 GC_mark_thread  (in toucan) + 132  [0x10649fdd8]
    +         2567 GC_help_marker  (in toucan) + 46  [0x10649a126]
    +           2567 GC_wait_marker  (in toucan) + 23  [0x1064a15cd]
    +             2567 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffa29dc7fa]
    +               2567 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffa28f0bf2]
    2567 Thread_205102
    + 2567 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffa29db08d]
    +   2567 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffa29db887]
    +     2567 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffa29db93b]
    +       2567 GC_mark_thread  (in toucan) + 132  [0x10649fdd8]
    +         2567 GC_help_marker  (in toucan) + 46  [0x10649a126]
    +           2567 GC_wait_marker  (in toucan) + 23  [0x1064a15cd]
    +             2567 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffa29dc7fa]
    +               2567 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffa28f0bf2]
    2567 Thread_205103
    + 2567 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffa29db08d]
    +   2567 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffa29db887]
    +     2567 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffa29db93b]
    +       2567 GC_mark_thread  (in toucan) + 132  [0x10649fdd8]
    +         2567 GC_help_marker  (in toucan) + 46  [0x10649a126]
    +           2567 GC_wait_marker  (in toucan) + 23  [0x1064a15cd]
    +             2567 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffa29dc7fa]
    +               2567 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffa28f0bf2]
    2567 Thread_205104
    + 2567 ~proc2Proc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal/0.31.0_1/src/fiber.cr:48  (in toucan) + 9  [0x106109c39]  fiber.cr:48
    +   2567 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 112  [0x106165c40]  fiber.cr:255
    +     2566 ~procProc(Nil)@lib/cherry/src/cherry/http/server.cr:80  (in toucan) + 23  [0x106114727]  server.cr:81
    +     ! 2566 *HTTP::Server#handle_client<Socket::Server, IO+>:Nil  (in toucan) + 374  [0x106401e06]  server.cr:131
    +     !   2566 *HTTP::Server::RequestProcessor#process<IO+, IO+>:Nil  (in toucan) + 53  [0x106402885]  request_processor.cr:22
    +     !     2566 *HTTP::Server::RequestProcessor#process<IO+, IO+, IO::FileDescriptor>:Nil  (in toucan) + 2171  [0x10640310b]  request_processor.cr:48
    +     !       2014 *Toucan::Relay::Http::Server#call<HTTP::Server::Context>:(IO+ | Int32 | Nil)  (in toucan) + 120210  [0x1063a95f2]  server.cr:101
    +     !       : 2014 *Toucan::Logger@Toucan::Render::Logger#finished:(IO+ | Int32 | Nil)  (in toucan) + 831  [0x10638779f]  logger.cr:52
    +     !       :   2014 *Toucan::Logger#info<String>:(IO+ | Int32 | Nil)  (in toucan) + 127  [0x106382e4f]  logger.cr:201
    +     !       :     2014 *Logger#info<String>:(IO+ | Int32 | Nil)  (in toucan) + 29  [0x10638134d]  logger.cr:138
    +     !       :       2014 *Logger#info<String, Nil>:(IO+ | Int32 | Nil)  (in toucan) + 34  [0x106381392]  logger.cr:138
    +     !       :         2014 *Logger#log<Logger::Severity, String, Nil>:(IO+ | Int32 | Nil)  (in toucan) + 132  [0x106381434]  logger.cr:164
    +     !       :           2014 *Logger#write<Logger::Severity, Time, String, String>:(IO+ | Int32 | Nil)  (in toucan) + 196  [0x106381534]  logger.cr:57
    +     !       :             2014 *Mutex#lock:Nil  (in toucan) + 179  [0x1061c9cb3]  mutex.cr:24
    +     !       :               2014 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x10617f989]  scheduler.cr:43
    +     !       :                 2014 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x10617f9f3]  scheduler.cr:146
    +     !       :                   2014 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x10617e512]  event_loop.cr:16
    +     !       :                     2014 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x10617f001]  event.cr:62
    +     !       :                       2014 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x106c85343]
    +     !       :                         2014 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x106c8e5ba]
    +     !       :                           2014 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffa28f1d96]
    +     !       552 *Toucan::Relay::Http::Server#call<HTTP::Server::Context>:(IO+ | Int32 | Nil)  (in toucan) + 119080  [0x1063a9188]  server.cr:93
    +     !         552 *Toucan::Relay::Http::Response#show_summary:Nil  (in toucan) + 134  [0x10645a8a6]  response.cr:108
    +     !           552 *Toucan::Logger@Toucan::Render::Logger#show_response_status<HTTP::Client::Response, HTTP::Server::Response>:(IO+ | Int32 | Nil)  (in toucan) + 1671  [0x106385b77]  logger.cr:198
    +     !             552 *Toucan::Logger#info<String>:(IO+ | Int32 | Nil)  (in toucan) + 127  [0x106382e4f]  logger.cr:201
    +     !               552 *Logger#info<String>:(IO+ | Int32 | Nil)  (in toucan) + 29  [0x10638134d]  logger.cr:138
    +     !                 552 *Logger#info<String, Nil>:(IO+ | Int32 | Nil)  (in toucan) + 34  [0x106381392]  logger.cr:138
    +     !                   552 *Logger#log<Logger::Severity, String, Nil>:(IO+ | Int32 | Nil)  (in toucan) + 132  [0x106381434]  logger.cr:164
    +     !                     552 *Logger#write<Logger::Severity, Time, String, String>:(IO+ | Int32 | Nil)  (in toucan) + 196  [0x106381534]  logger.cr:57
    +     !                       552 *Mutex#lock:Nil  (in toucan) + 179  [0x1061c9cb3]  mutex.cr:24
    +     !                         552 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x10617f989]  scheduler.cr:43
    +     !                           552 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x10617f9f3]  scheduler.cr:146
    +     !                             552 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x10617e512]  event_loop.cr:16
    +     !                               552 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x10617f001]  event.cr:62
    +     !                                 552 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x106c85343]
    +     !                                   552 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x106c8e5ba]
    +     !                                     552 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffa28f1d96]
    +     1 ~proc2Proc(Nil)@src/toucan/relay/http/context.cr:27  (in toucan) + 42  [0x10611524a]  context.cr:28
    +       1 *Toucan::Relay::Http::Response@Toucan::Relay::Http::Context#transport<IO+, IO::FileDescriptor, Int32, Bool>:(Bool | IO+ | Int32 | Nil)  (in toucan) + 17846  [0x10645f336]  context.cr:73
    +         1 *Toucan::Relay::Http::Response#show_transport_closed:(IO+ | Int32 | Nil)  (in toucan) + 119  [0x106460247]  response.cr:150
    +           1 *Toucan::Logger@Toucan::Render::Logger#downstream_transport_closed:(IO+ | Int32 | Nil)  (in toucan) + 610  [0x1063864e2]  logger.cr:127
    +             1 *Toucan::Logger#elapsed_text:String  (in toucan) + 181  [0x106383cf5]  logger.cr:185
    +               1 *Float64#to_s:String  (in toucan) + 68  [0x10618e824]  float.cr:274
    +                 1 *Float::Printer@Float::Printer::print<Float64, String::Builder>:Nil  (in toucan) + 183  [0x1063695c7]  printer.cr:33
    +                   1 *Float::Printer@Float::Printer::internal<Float64, String::Builder>:Nil  (in toucan) + 5678  [0x10636ac4e]  printer.cr:39
    +                     1 *Float::Printer::Grisu3@Float::Printer::Grisu3::grisu3<Float64, Pointer(UInt8)>:Tuple(Bool, Int32, Int32)  (in toucan) + 273  [0x10636c501]  grisu3.cr:327
    +                       1 *Float::Printer::CachedPowers::get_cached_power_for_binary_exponent<Int32>:Tuple(Float::Printer::DiyFP, Int32)  (in toucan) + 219  [0x10636dc0b]  cached_powers.cr:159
    +                         1 *Float64#ceil:Float64  (in toucan) + 9  [0x10618e869]  float.cr:241
    +                           1 ???  (in libsystem_m.dylib)  load address 0x7fffa28fa000 + 0x5d08  [0x7fffa28ffd08]
    2567 Thread_205105
    + 2567 ~proc2Proc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal/0.31.0_1/src/fiber.cr:48  (in toucan) + 9  [0x106109c39]  fiber.cr:48
    +   2567 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 112  [0x106165c40]  fiber.cr:255
    +     2567 ~procProc(Nil)@lib/cherry/src/cherry/http/server.cr:80  (in toucan) + 23  [0x106114727]  server.cr:81
    +       2567 *HTTP::Server#handle_client<Socket::Server, IO+>:Nil  (in toucan) + 374  [0x106401e06]  server.cr:131
    +         2567 *HTTP::Server::RequestProcessor#process<IO+, IO+>:Nil  (in toucan) + 53  [0x106402885]  request_processor.cr:22
    +           2567 *HTTP::Server::RequestProcessor#process<IO+, IO+, IO::FileDescriptor>:Nil  (in toucan) + 2171  [0x10640310b]  request_processor.cr:48
    +             2567 *Toucan::Relay::Http::Server#call<HTTP::Server::Context>:(IO+ | Int32 | Nil)  (in toucan) + 119080  [0x1063a9188]  server.cr:93
    +               2567 *Toucan::Relay::Http::Response#show_summary:Nil  (in toucan) + 134  [0x10645a8a6]  response.cr:108
    +                 2567 *Toucan::Logger@Toucan::Render::Logger#show_response_status<HTTP::Client::Response, HTTP::Server::Response>:(IO+ | Int32 | Nil)  (in toucan) + 1671  [0x106385b77]  logger.cr:198
    +                   2567 *Toucan::Logger#info<String>:(IO+ | Int32 | Nil)  (in toucan) + 127  [0x106382e4f]  logger.cr:201
    +                     2567 *Logger#info<String>:(IO+ | Int32 | Nil)  (in toucan) + 29  [0x10638134d]  logger.cr:138
    +                       2567 *Logger#info<String, Nil>:(IO+ | Int32 | Nil)  (in toucan) + 34  [0x106381392]  logger.cr:138
    +                         2567 *Logger#log<Logger::Severity, String, Nil>:(IO+ | Int32 | Nil)  (in toucan) + 132  [0x106381434]  logger.cr:164
    +                           2567 *Logger#write<Logger::Severity, Time, String, String>:(IO+ | Int32 | Nil)  (in toucan) + 196  [0x106381534]  logger.cr:57
    +                             2567 *Mutex#lock:Nil  (in toucan) + 179  [0x1061c9cb3]  mutex.cr:24
    +                               2567 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x10617f989]  scheduler.cr:43
    +                                 2567 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x10617f9f3]  scheduler.cr:146
    +                                   2567 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x10617e512]  event_loop.cr:16
    +                                     2567 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x10617f001]  event.cr:62
    +                                       2567 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x106c85343]
    +                                         2567 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x106c8e5ba]
    +                                           2567 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffa28f1d96]
    2567 Thread_205106
      2567 ~proc2Proc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal/0.31.0_1/src/fiber.cr:48  (in toucan) + 9  [0x106109c39]  fiber.cr:48
        2567 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 112  [0x106165c40]  fiber.cr:255
          2562 ~proc2Proc(Nil)@src/toucan/relay/http/context.cr:27  (in toucan) + 42  [0x10611524a]  context.cr:28
          ! 2532 *Toucan::Relay::Http::Response@Toucan::Relay::Http::Context#transport<IO+, IO::FileDescriptor, Int32, Bool>:(Bool | IO+ | Int32 | Nil)  (in toucan) + 8266  [0x10645cdca]  context.cr:13
          ! : 2532 *IO::copy<IO+, IO::Memory, Int32>:UInt64  (in toucan) + 1652  [0x1061815a4]  io.cr:1153
          ! :   2532 *HTTP::FixedLengthContent#read<Slice(UInt8)>:Int32  (in toucan) + 94  [0x1062316ee]  content.cr:31
          ! :     2532 *HTTP::FixedLengthContent@IO::Sized#read<Slice(UInt8)>:Int32  (in toucan) + 597  [0x106231955]  sized.cr:32
          ! :       2532 *OpenSSL::SSL::Socket+@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 309  [0x10620cc65]  buffered.cr:79
          ! :         2532 *OpenSSL::SSL::SuperSocket+@OpenSSL::SSL::SuperSocket#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 161  [0x10620f961]  super_socket.cr:147
          ! :           2532 ssl3_read_internal  (in libssl.1.0.0.dylib) + 96  [0x1069f77fa]
          ! :             2532 ssl3_read_bytes  (in libssl.1.0.0.dylib) + 1966  [0x1069faa7c]
          ! :               2532 ssl3_read_n  (in libssl.1.0.0.dylib) + 588  [0x1069f957c]
          ! :                 2532 BIO_read  (in libcrypto.1.0.0.dylib) + 100  [0x106af6d0b]
          ! :                   2532 ~procProc(Pointer(LibCrypto::Bio), Pointer(UInt8), Int32, Int32)@/usr/local/Cellar/crystal/0.31.0_1/src/openssl/bio.cr:36  (in toucan) + 1149  [0x10610cebd]  bio.cr:39
          ! :                     2532 *Socket+@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 190  [0x10621306e]  buffered.cr:79
          ! :                       2532 *Socket+@Socket#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 338  [0x106212722]  socket.cr:59
          ! :                         2532 *Socket+@IO::Evented#wait_readable:Nil  (in toucan) + 57  [0x106212cb9]  evented.cr:117
          ! :                           2532 *Socket+@IO::Evented#wait_readable<(Time::Span | Nil)>:Nil  (in toucan) + 680  [0x106212f68]  evented.cr:125
          ! :                             2532 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x10617f989]  scheduler.cr:43
          ! :                               2532 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x10617f9f3]  scheduler.cr:146
          ! :                                 2532 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x10617e512]  event_loop.cr:16
          ! :                                   2532 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x10617f001]  event.cr:62
          ! :                                     2532 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x106c85343]
          ! :                                       2532 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x106c8e5ba]
          ! :                                         2532 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffa28f1d96]
          ! 30 *Toucan::Relay::Http::Response@Toucan::Relay::Http::Context#transport<IO+, IO::FileDescriptor, Int32, Bool>:(Bool | IO+ | Int32 | Nil)  (in toucan) + 17846  [0x10645f336]  context.cr:73
          !   30 *Toucan::Relay::Http::Response#show_transport_closed:(IO+ | Int32 | Nil)  (in toucan) + 119  [0x106460247]  response.cr:150
          !     30 *Toucan::Logger@Toucan::Render::Logger#downstream_transport_closed:(IO+ | Int32 | Nil)  (in toucan) + 831  [0x1063865bf]  logger.cr:122
          !       30 *Toucan::Logger#warn<String>:(IO+ | Int32 | Nil)  (in toucan) + 127  [0x106383f0f]  logger.cr:201
          !         30 *Logger#warn<String>:(IO+ | Int32 | Nil)  (in toucan) + 29  [0x106381e0d]  logger.cr:138
          !           30 *Logger#warn<String, Nil>:(IO+ | Int32 | Nil)  (in toucan) + 34  [0x106381e52]  logger.cr:138
          !             30 *Logger#log<Logger::Severity, String, Nil>:(IO+ | Int32 | Nil)  (in toucan) + 132  [0x106381434]  logger.cr:164
          !               30 *Logger#write<Logger::Severity, Time, String, String>:(IO+ | Int32 | Nil)  (in toucan) + 196  [0x106381534]  logger.cr:57
          !                 30 *Mutex#lock:Nil  (in toucan) + 179  [0x1061c9cb3]  mutex.cr:24
          !                   30 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x10617f989]  scheduler.cr:43
          !                     30 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x10617f9f3]  scheduler.cr:146
          !                       30 *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x10617e512]  event_loop.cr:16
          !                         30 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x10617f001]  event.cr:62
          !                           30 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x106c85343]
          !                             30 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x106c8e5ba]
          !                               30 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffa28f1d96]
          5 ~procProc(Nil)@lib/cherry/src/cherry/http/server.cr:80  (in toucan) + 23  [0x106114727]  server.cr:81
            5 *HTTP::Server#handle_client<Socket::Server, IO+>:Nil  (in toucan) + 374  [0x106401e06]  server.cr:131
              5 *HTTP::Server::RequestProcessor#process<IO+, IO+>:Nil  (in toucan) + 53  [0x106402885]  request_processor.cr:22
                5 *HTTP::Server::RequestProcessor#process<IO+, IO+, IO::FileDescriptor>:Nil  (in toucan) + 2171  [0x10640310b]  request_processor.cr:48
                  3 *Toucan::Relay::Http::Server#call<HTTP::Server::Context>:(IO+ | Int32 | Nil)  (in toucan) + 1479  [0x10638c627]  server.cr:232
                  : 3 *HTTP::Client#close:Nil  (in toucan) + 1487  [0x10645915f]  client.cr:59
                  :   3 *HTTP::Client#all_free:Nil  (in toucan) + 63  [0x1064589cf]  client.cr:79
                  :     3 *OpenSSL::SSL::SuperSocket::Client@OpenSSL::SSL::SuperSocket#all_free:Nil  (in toucan) + 26  [0x106430daa]  super_socket.cr:132
                  :       3 *OpenSSL::SSL::SuperSocket::Client@OpenSSL::SSL::SuperSocket#free:Nil  (in toucan) + 38  [0x106430df6]  super_socket.cr:122
                  :         3 *OpenSSL::SSL::SuperSocket::Client@OpenSSL::SSL::SuperSocket#free!:Nil  (in toucan) + 20  [0x106430e14]  super_socket.cr:127
                  :           3 SSL_free  (in libssl.1.0.0.dylib) + 554  [0x106a0d9b0]
                  :             3 SSL_CTX_free  (in libssl.1.0.0.dylib) + 142  [0x106a0dd43]
                  :               3 X509_STORE_free  (in libcrypto.1.0.0.dylib) + 168  [0x106b37cf8]
                  :                 3 sk_pop_free  (in libcrypto.1.0.0.dylib) + 46  [0x106afebb3]
                  :                   3 cleanup  (in libcrypto.1.0.0.dylib) + 35  [0x106b37d4a]
                  :                     3 ASN1_item_free  (in libcrypto.1.0.0.dylib) + 25  [0x106b1ecd9]
                  :                       3 asn1_item_combine_free  (in libcrypto.1.0.0.dylib) + 241  [0x106b1edd0]
                  :                         3 asn1_item_combine_free  (in libcrypto.1.0.0.dylib) + 241  [0x106b1edd0]
                  :                           2 x509_name_ex_free  (in libcrypto.1.0.0.dylib) + 47  [0x106b1a8d2]
                  :                           | 2 sk_pop_free  (in libcrypto.1.0.0.dylib) + 46  [0x106afebb3]
                  :                           |   2 ASN1_item_free  (in libcrypto.1.0.0.dylib) + 25  [0x106b1ecd9]
                  :                           |     2 asn1_item_combine_free  (in libcrypto.1.0.0.dylib) + 241  [0x106b1edd0]
                  :                           |       2 ASN1_primitive_free  (in libcrypto.1.0.0.dylib) + 143  [0x106b1f064]
                  :                           |         2 ASN1_STRING_free  (in libcrypto.1.0.0.dylib) + 34  [0x106b29413]
                  :                           |           2 CRYPTO_free  (in libcrypto.1.0.0.dylib) + 37  [0x106a4d4d6]
                  :                           |             2 free_tiny  (in libsystem_malloc.dylib) + 321,17  [0x7fffa295bf77,0x7fffa295be47]
                  :                           1 asn1_item_combine_free  (in libcrypto.1.0.0.dylib) + 241  [0x106b1edd0]
                  :                             1 ASN1_primitive_free  (in libcrypto.1.0.0.dylib) + 143  [0x106b1f064]
                  :                               1 ASN1_STRING_free  (in libcrypto.1.0.0.dylib) + 34  [0x106b29413]
                  :                                 1 CRYPTO_free  (in libcrypto.1.0.0.dylib) + 37  [0x106a4d4d6]
                  :                                   1 free_tiny  (in libsystem_malloc.dylib) + 8  [0x7fffa295be3e]
                  1 *Toucan::Relay::Http::Server#call<HTTP::Server::Context>:(IO+ | Int32 | Nil)  (in toucan) + 2379  [0x10638c9ab]  server.cr:127
                  : 1 *IO+@IO#gets<Int32, Bool>:(String | Nil)  (in toucan) + 159  [0x106202f1f]  io.cr:591
                  :   1 *IO+@IO#gets<Char, Int32, Bool>:(String | Nil)  (in toucan) + 917  [0x1061ffb85]  io.cr:632
                  :     1 *OpenSSL::SSL::Socket+@IO::Buffered#peek:Slice(UInt8)  (in toucan) + 49  [0x10620c851]  buffered.cr:102
                  :       1 *OpenSSL::SSL::Socket+@IO::Buffered#fill_buffer:Slice(UInt8)  (in toucan) + 95  [0x10620c91f]  buffered.cr:214
                  :         1 *OpenSSL::SSL::SuperSocket+@OpenSSL::SSL::SuperSocket#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 161  [0x10620f961]  super_socket.cr:147
                  :           1 ssl3_read_internal  (in libssl.1.0.0.dylib) + 96  [0x1069f77fa]
                  :             1 ssl3_read_bytes  (in libssl.1.0.0.dylib) + 1966  [0x1069faa7c]
                  :               1 ssl3_read_n  (in libssl.1.0.0.dylib) + 588  [0x1069f957c]
                  :                 1 BIO_read  (in libcrypto.1.0.0.dylib) + 100  [0x106af6d0b]
                  :                   1 ~procProc(Pointer(LibCrypto::Bio), Pointer(UInt8), Int32, Int32)@/usr/local/Cellar/crystal/0.31.0_1/src/openssl/bio.cr:36  (in toucan) + 1149  [0x10610cebd]  bio.cr:39
                  :                     1 *Socket+@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 190  [0x10621306e]  buffered.cr:79
                  :                       1 *Socket+@Socket#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 338  [0x106212722]  socket.cr:59
                  :                         1 *Socket+@IO::Evented#wait_readable:Nil  (in toucan) + 57  [0x106212cb9]  evented.cr:117
                  :                           1 *Socket+@IO::Evented#wait_readable<(Time::Span | Nil)>:Nil  (in toucan) + 737  [0x106212fa1]  evented.cr:118
                  :                             1 *raise<IO::Timeout>:NoReturn  (in toucan) + 69  [0x106103f45]  raise.cr:191
                  :                               1 *CallStack::new:CallStack  (in toucan) + 40  [0x10612e348]  callstack.cr:47
                  :                                 1 *CallStack#initialize:Array(Pointer(Void))  (in toucan) + 17  [0x10612e371]  callstack.cr:48
                  :                                   1 *CallStack::unwind:Array(Pointer(Void))  (in toucan) + 85  [0x10612e3d5]  callstack.cr:99
                  :                                     1 _Unwind_Backtrace  (in libunwind.dylib) + 65  [0x7fffa2a0a191]
                  :                                       1 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step()  (in libunwind.dylib) + 133  [0x7fffa2a060e5]
                  :                                         1 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::setInfoBasedOnIPRegister(bool)  (in libunwind.dylib) + 117  [0x7fffa2a05a29]
                  :                                           1 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::getInfoFromCompactEncodingSection(unsigned long long, unsigned long long, unsigned long long)  (in libunwind.dylib) + 246  [0x7fffa2a05e5e]
                  1 *Toucan::Relay::Http::Server#call<HTTP::Server::Context>:(IO+ | Int32 | Nil)  (in toucan) + 119091  [0x1063a9193]  server.cr:94
                    1 *Toucan::Relay::Http::Response#set_stream_body:(IO+ | Int32 | Nil)  (in toucan) + 223  [0x10645a99f]  response.cr:159
                      1 *IO::copy<IO+, HTTP::Server::Response>:UInt64  (in toucan) + 219  [0x10618252b]  io.cr:1130
                        1 *HTTP::Server::Response#write<Slice(UInt8)>:Nil  (in toucan) + 233  [0x1061e0269]  response.cr:80
                          1 *HTTP::Server::Response::Output@IO::Buffered#write<Slice(UInt8)>:Nil  (in toucan) + 263  [0x1061e3b27]  buffered.cr:144
                            1 *HTTP::Server::Response::Output@IO::Buffered#flush:HTTP::Server::Response::Output  (in toucan) + 81  [0x1061e4901]  buffered.cr:192
                              1 *HTTP::Server::Response::Output#unbuffered_write<Slice(UInt8)>:(IO+ | Nil)  (in toucan) + 1916  [0x1061e437c]  response.cr:220
                                1 *OpenSSL::SSL::Socket+@IO::Buffered#write<Slice(UInt8)>:Nil  (in toucan) + 329  [0x10620c379]  buffered.cr:140
                                  1 *OpenSSL::SSL::SuperSocket+@OpenSSL::SSL::SuperSocket#unbuffered_write<Slice(UInt8)>:Nil  (in toucan) + 164  [0x10620f2c4]  super_socket.cr:168
                                    1 ssl3_write_bytes  (in libssl.1.0.0.dylib) + 1318  [0x1069f9c1b]
                                      1 ssl3_write_pending  (in libssl.1.0.0.dylib) + 149  [0x1069f9dce]
                                        1 BIO_write  (in libcrypto.1.0.0.dylib) + 104  [0x106af6de9]
                                          1 ~procProc(Pointer(LibCrypto::Bio), Pointer(UInt8), Int32, Int32)@/usr/local/Cellar/crystal/0.31.0_1/src/openssl/bio.cr:22  (in toucan) + 473  [0x10610be49]  bio.cr:24
                                            1 *Socket+@IO::Buffered#write<Slice(UInt8)>:Nil  (in toucan) + 117  [0x1062122e5]  buffered.cr:135
                                              1 *Socket+@Socket#unbuffered_write<Slice(UInt8)>:Nil  (in toucan) + 241  [0x1062117d1]  socket.cr:548
                                                1 __sendto  (in libsystem_kernel.dylib) + 10  [0x7fffa28f0fa6]

Total number in stack (recursive counted multiple, when >=5):
        6       kevent  (in libsystem_kernel.dylib) + 0  [0x7fffa28f1d8c]
        5       *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x10617f001]  event.cr:62
        5       *Crystal::EventLoop::run_once:Int32  (in toucan) + 34  [0x10617e512]  event_loop.cr:16
        5       *Crystal::Scheduler#reschedule:Nil  (in toucan) + 99  [0x10617f9f3]  scheduler.cr:146
        5       *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x10617f989]  scheduler.cr:43
        5       event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x106c85343]
        5       kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x106c8e5ba]

Sort by top of stack, same collapsed (when >= 5):
        kevent  (in libsystem_kernel.dylib)        10262
        __psynch_cvwait  (in libsystem_kernel.dylib)        7701

Binary Images:
       0x1060f3000 -        0x106535fff +toucan (0) <8936C248-B89D-3904-96DA-8040AFFCBDFB> /usr/local/bin/toucan
       0x1069cb000 -        0x1069e3fff +libyaml-0.2.dylib (0) <D64BFABD-6330-3455-AEA3-A051EC3B4B3B> /usr/local/opt/libyaml/lib/libyaml-0.2.dylib
       0x1069e8000 -        0x106a28fff +libssl.1.0.0.dylib (0) <9BD9BD97-9105-3B6F-950E-C864E96B7C3C> /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
       0x106a4b000 -        0x106bbecc7 +libcrypto.1.0.0.dylib (0) <B4F57263-6009-31D3-9027-6D114744EFB0> /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
       0x106c3e000 -        0x106c6bff3  libpcre.0.dylib (8) <BCEA4851-21D3-3EFD-B66F-438CC1F96AF3> /usr/lib/libpcre.0.dylib
       0x106c72000 -        0x106c73fff +libevent_pthreads-2.1.7.dylib (0) <4B335AB9-9974-32C4-AA80-A3F649E4B819> /usr/local/opt/libevent/lib/libevent_pthreads-2.1.7.dylib
       0x106c77000 -        0x106ca4ff7 +libevent-2.1.7.dylib (0) <E8D7300E-8FE0-33C8-B9C5-DA74B3278FED> /usr/local/opt/libevent/lib/libevent-2.1.7.dylib
       0x107c1b000 -        0x107c58dc7  dyld (0.0 - ???) <322C06B7-8878-311D-888C-C8FD2CA96FF3> /usr/lib/dyld
    0x7fffa1218000 -     0x7fffa1219ffb  libSystem.B.dylib (1238.60.2) <F18AC1E7-C6F1-34B1-8069-BE571B3231D4> /usr/lib/libSystem.B.dylib
    0x7fffa1352000 -     0x7fffa13a8ff7  libc++.1.dylib (307.5) <0B43BB5D-E6EB-3464-8DE9-B41AC8ED9D1C> /usr/lib/libc++.1.dylib
    0x7fffa13a9000 -     0x7fffa13d2ff7  libc++abi.dylib (307.4) <BC271AD3-831B-362A-9DA7-E8C51F285FE4> /usr/lib/libc++abi.dylib
    0x7fffa1820000 -     0x7fffa1912ff7  libiconv.2.dylib (50) <42125B35-81D7-3FC4-9475-A26DBE10884D> /usr/lib/libiconv.2.dylib
    0x7fffa1ec7000 -     0x7fffa2299047  libobjc.A.dylib (709.1) <70614861-0340-32E2-85ED-FE65759CDFFA> /usr/lib/libobjc.A.dylib
    0x7fffa26c6000 -     0x7fffa26d7ff3  libz.1.dylib (67) <46E3FFA2-4328-327A-8D34-A03E20BFFB8E> /usr/lib/libz.1.dylib
    0x7fffa26e6000 -     0x7fffa26eaff7  libcache.dylib (79) <093A4DAB-8385-3D47-A350-E20CB7CCF7BF> /usr/lib/system/libcache.dylib
    0x7fffa26eb000 -     0x7fffa26f5fff  libcommonCrypto.dylib (60092.50.5) <8A64D1B0-C70E-385C-92F0-E669079FDA90> /usr/lib/system/libcommonCrypto.dylib
    0x7fffa26f6000 -     0x7fffa26fdfff  libcompiler_rt.dylib (62) <55D47421-772A-32AB-B529-1A46C2F43B4D> /usr/lib/system/libcompiler_rt.dylib
    0x7fffa26fe000 -     0x7fffa2706fff  libcopyfile.dylib (138) <819BEA3C-DF11-3E3D-A1A1-5A51C5BF1961> /usr/lib/system/libcopyfile.dylib
    0x7fffa2707000 -     0x7fffa278afdf  libcorecrypto.dylib (442.50.19) <65D7165E-2E71-335D-A2D6-33F78E2DF0C1> /usr/lib/system/libcorecrypto.dylib
    0x7fffa278b000 -     0x7fffa27bcfff  libdispatch.dylib (703.50.37) <6582BAD6-ED27-3B30-B620-90B1C5A4AE3C> /usr/lib/system/libdispatch.dylib
    0x7fffa27bd000 -     0x7fffa27c2ffb  libdyld.dylib (433.5) <9B2AC56D-107C-3541-A127-9094A751F2C9> /usr/lib/system/libdyld.dylib
    0x7fffa27c3000 -     0x7fffa27c3ffb  libkeymgr.dylib (28) <7AA011A9-DC21-3488-BF73-3B5B14D1FDD6> /usr/lib/system/libkeymgr.dylib
    0x7fffa27d1000 -     0x7fffa27d1fff  liblaunch.dylib (972.70.1) <B856ABD2-896E-3DE0-B2C8-146A6AF8E2A7> /usr/lib/system/liblaunch.dylib
    0x7fffa27d2000 -     0x7fffa27d7ff3  libmacho.dylib (898) <17D5D855-F6C3-3B04-B680-E9BF02EF8AED> /usr/lib/system/libmacho.dylib
    0x7fffa27d8000 -     0x7fffa27daff3  libquarantine.dylib (85.50.1) <12448CC2-378E-35F3-BE33-9DC395A5B970> /usr/lib/system/libquarantine.dylib
    0x7fffa27db000 -     0x7fffa27dcffb  libremovefile.dylib (45) <38D4CB9C-10CD-30D3-8B7B-A515EC75FE85> /usr/lib/system/libremovefile.dylib
    0x7fffa27dd000 -     0x7fffa27f5ff7  libsystem_asl.dylib (349.50.5) <096E4228-3B7C-30A6-8B13-EC909A64499A> /usr/lib/system/libsystem_asl.dylib
    0x7fffa27f6000 -     0x7fffa27f6ff7  libsystem_blocks.dylib (67) <10DC5404-73AB-35B3-A277-A8AFECB476EB> /usr/lib/system/libsystem_blocks.dylib
    0x7fffa27f7000 -     0x7fffa2884fef  libsystem_c.dylib (1158.50.2) <E5AE5244-7D0C-36AC-8BB6-C7AE7EA52A4B> /usr/lib/system/libsystem_c.dylib
    0x7fffa2885000 -     0x7fffa2888ffb  libsystem_configuration.dylib (888.60.2) <BECC01A2-CA8D-31E6-BCDF-D452965FA976> /usr/lib/system/libsystem_configuration.dylib
    0x7fffa2889000 -     0x7fffa288cfff  libsystem_coreservices.dylib (41.4) <7D26DE79-B424-3450-85E1-F7FAB32714AB> /usr/lib/system/libsystem_coreservices.dylib
    0x7fffa288d000 -     0x7fffa28a5fff  libsystem_coretls.dylib (121.50.4) <EC6FCF07-DCFB-3A03-9CC9-6DD3709974C6> /usr/lib/system/libsystem_coretls.dylib
    0x7fffa28a6000 -     0x7fffa28acfff  libsystem_dnssd.dylib (765.50.9) <CC960215-0B1B-3822-A13A-3DDE96FA796F> /usr/lib/system/libsystem_dnssd.dylib
    0x7fffa28ad000 -     0x7fffa28d6ff7  libsystem_info.dylib (503.50.4) <611DB84C-BF70-3F92-8702-B9F28A900920> /usr/lib/system/libsystem_info.dylib
    0x7fffa28d7000 -     0x7fffa28f9ff7  libsystem_kernel.dylib (3789.70.16) <34B1F16C-BC9C-3C5F-9045-0CAE91CB5914> /usr/lib/system/libsystem_kernel.dylib
    0x7fffa28fa000 -     0x7fffa2941fe7  libsystem_m.dylib (3121.6) <86D499B5-BBDC-3D3B-8A4E-97AE8E6672A4> /usr/lib/system/libsystem_m.dylib
    0x7fffa2942000 -     0x7fffa2960ff7  libsystem_malloc.dylib (116.50.8) <A3D15F17-99A6-3367-8C7E-4280E8619C95> /usr/lib/system/libsystem_malloc.dylib
    0x7fffa2961000 -     0x7fffa29baffb  libsystem_network.dylib (856.60.1) <369D0221-56CA-3C3E-9EDE-94B41CAE77B7> /usr/lib/system/libsystem_network.dylib
    0x7fffa29bb000 -     0x7fffa29c4ff3  libsystem_networkextension.dylib (563.60.2) <B021F2B3-8A75-3633-ABB0-FC012B8E9B0C> /usr/lib/system/libsystem_networkextension.dylib
    0x7fffa29c5000 -     0x7fffa29ceff3  libsystem_notify.dylib (165.20.1) <B8160190-A069-3B3A-BDF6-2AA408221FAE> /usr/lib/system/libsystem_notify.dylib
    0x7fffa29cf000 -     0x7fffa29d7fe7  libsystem_platform.dylib (126.50.8) <897462FD-B318-321B-A554-E61982630F7E> /usr/lib/system/libsystem_platform.dylib
    0x7fffa29d8000 -     0x7fffa29e2ff7  libsystem_pthread.dylib (218.60.3) <B8FB5E20-3295-39E2-B5EB-B464D1D4B104> /usr/lib/system/libsystem_pthread.dylib
    0x7fffa29e3000 -     0x7fffa29e6ff7  libsystem_sandbox.dylib (592.70.1) <4B92EC49-ACD0-36AE-B07A-A2B8152EAF9D> /usr/lib/system/libsystem_sandbox.dylib
    0x7fffa29e7000 -     0x7fffa29e8ff3  libsystem_secinit.dylib (24.50.4) <F78B847B-3565-3E4B-98A6-F7AD40392E2D> /usr/lib/system/libsystem_secinit.dylib
    0x7fffa29e9000 -     0x7fffa29f0ffb  libsystem_symptoms.dylib (532.50.47) <3390E07C-C1CE-348F-ADBD-2C5440B45EAA> /usr/lib/system/libsystem_symptoms.dylib
    0x7fffa29f1000 -     0x7fffa2a04ff7  libsystem_trace.dylib (518.70.1) <AC63A7FE-50D9-3A30-96E6-F6B7FF16E465> /usr/lib/system/libsystem_trace.dylib
    0x7fffa2a05000 -     0x7fffa2a0affb  libunwind.dylib (35.3) <3D50D8A8-C460-334D-A519-2DA841102C6B> /usr/lib/system/libunwind.dylib
    0x7fffa2a0b000 -     0x7fffa2a34ff7  libxpc.dylib (972.70.1) <BF896DF0-D8E9-31A8-A4B3-01120BFEEE52> /usr/lib/system/libxpc.dylib
Sample analysis of process 6187 written to file /dev/stdout

@rdp
Copy link
Contributor

rdp commented Dec 28, 2019

If it's "blocked until a tcp read timeout occurs" maybe related to #8108 ? I could only debug the issue by adding some STDOUT.puts "here1" type stuff in there to see that it hangs during accept. Also one of those traces still shows getaddrinfo ? GL!

@636f7374
Copy link
Author

636f7374 commented Dec 30, 2019

@rdp, @ysbaddaden I successfully fixed the problem, deleted all same_thread: true, fixed memory leak, crash, ..., It took some time.

After several days of testing, I found the cause of this problem.
I found the -Dpreview_mt is not compatible with HTTP::Handler.
When I deleted -Dpreview_mt, everything was resolved.

I have n’t upgraded the latest version of crystal-lang. The version I am currently using is: Crystal 0.31.0 (2019-09-24).

I will upgrade crystal to see if this problem is solved.
If not resolved, I will update this thread.

The latest version of Crystal requires a full Xcode installation? Too big, my internet is a bit slow, and I may need some time.

@rdp, Thank you, brother :) .

@RX14
Copy link
Contributor

RX14 commented Dec 30, 2019

@636f7374 was this problem completely solved only by removing -Dpreview_mt?

@636f7374
Copy link
Author

636f7374 commented Dec 31, 2019

@ysbaddaden @rdp @RX14 Oops! Tested for a period of time, it seems that it has little to do with it, it appears more frequently after adding -Dpreview_mt, Still looking for this problem.

The latest version (Crystal 0.32.1 (2019-12-31)) has been upgraded, as well as openssl libssl 1.1.1, libcrypto 1.1.


@rdp

If it's "blocked until a tcp read timeout occurs" maybe related to #8108 ?

I found this problem in before, I patched client_read_timeout=, client_write_timeout=, in cherry.cr, Just not submitted to crystal-lang issues. (some hack)

    def bind_tls(host : String, port : Int32, context : OpenSSL::SSL::Context::Server,
                 write_timeout : Int32? = nil, read_timeout : Int32? = nil, reuse_port : Bool = false) : Socket::IPAddress
      tcp_server = TCPServer.new host, port, reuse_port: reuse_port
      read_timeout.try { |_read_timeout| tcp_server.client_read_timeout = _read_timeout }
      write_timeout.try { |_write_timeout| tcp_server.client_write_timeout = _write_timeout }

  private def accept(server : Socket::Server)
    begin
      accept! server
    rescue ex
      handle_exception ex
    end
  end

  private def accept!(server : Socket::Server)
    while socket = server.accept?
      next unless client = socket

      spawn handle_client server, client
    end
  end

  private def set_socket_timeout(server : Socket::Server, socket : IO?)
    if socket.responds_to? :read_timeout=
      socket.read_timeout = server.client_read_timeout
    end

    if socket.responds_to? :write_timeout=
      socket.write_timeout = server.client_write_timeout
    end
  end

  def listen
    raise "Can't re-start closed server" if closed?
    raise "Can't start server with no sockets to listen to, use HTTP::Server#bind first" if @sockets.empty?
    raise "Can't start running server" if listening?

    @listening = true
    done = Channel(Nil).new

    @sockets.each do |socket|
      spawn do
        until closed?
          accept socket
        end
      ensure
        done.send nil
      end
    end

    @sockets.size.times { done.receive }
  end

  private def handle_client(server, client : IO)
    set_socket_timeout server, client
    ...
  end

I could only debug the issue by adding some STDOUT.puts "here1" type stuff in there to see that it hangs during accept. Also one of those traces still shows getaddrinfo ? GL!

Seems not the problem, it appears near BIO_read.

very possible!
that the project is still using the default C.getaddrifo, and custom DNS resolver has not been used. I will try.


Crystal Version

Crystal 0.32.1 (2019-12-31)

LLVM: 9.0.0
Default target: x86_64-apple-macosx

Call graph

Sampling process 77693 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling toucan (pid 77693) every 1 millisecond
Process:         toucan [77693]
Path:            /usr/local/bin/toucan
Load Address:    0x107a85000
Identifier:      toucan
Version:         0
Code Type:       X86-64
Parent Process:  bash [77116]

Date/Time:       2019-12-31 13:24:38.317 +0800
Launch Time:     2019-12-31 12:52:33.720 +0800
OS Version:      Mac OS X 10.12.6 (16G29)
Report Version:  7
Analysis Tool:   /usr/bin/sample
----

Call graph:
    2061 Thread_226229   DispatchQueue_1: com.apple.main-thread  (serial)
    + 1276 ~proc2Proc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal/0.32.1/src/fiber.cr:47  (in toucan) + 9  [0x107a9c919]  fiber.cr:47
    + ! 1236 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 93  [0x107b0809d]  fiber.cr:255
    + ! : 1234 ~procProc(Nil)@lib/cherry/src/cherry/http/server.cr:63  (in toucan) + 26  [0x107aa6c4a]  server.cr:63
    + ! : | 1234 *HTTP::Server#handle_client<Socket::Server, IO+>:Nil  (in toucan) + 307  [0x107d7b903]  server.cr:106
    + ! : |   1234 *HTTP::Server::RequestProcessor#process<IO+, IO+>:Nil  (in toucan) + 53  [0x107d7c295]  request_processor.cr:22
    + ! : |     1096 *HTTP::Server::RequestProcessor#process<IO+, IO+, IO::FileDescriptor>:Nil  (in toucan) + 161  [0x107d7c341]  request_processor.cr:28
    + ! : |     + 1096 *HTTP::Request::from_io:max_request_line_size:max_headers_size<IO+, Int32, Int32>:(HTTP::Request | HTTP::Status | Nil)  (in toucan) + 56  [0x107dabf78]  request.cr:105
    + ! : |     +   1096 *HTTP::Request::parse_request_line<IO+, Int32>:(HTTP::Request::RequestLine | HTTP::Status | Nil)  (in toucan) + 452  [0x107dacd54]  request.cr:128
    + ! : |     +     1096 *OpenSSL::SSL::Socket+@IO::Buffered#peek:Slice(UInt8)  (in toucan) + 54  [0x107bac6e6]  buffered.cr:102
    + ! : |     +       1096 *OpenSSL::SSL::Socket+@IO::Buffered#fill_buffer:Slice(UInt8)  (in toucan) + 167  [0x107bac807]  buffered.cr:214
    + ! : |     +         1096 *OpenSSL::SSL::Socket+@OpenSSL::SSL::Socket#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 94  [0x107bac94e]  socket.cr:116
    + ! : |     +           1096 SSL_read  (in libssl.1.1.dylib) + 25  [0x108386209]
    + ! : |     +             1096 ssl3_read_internal  (in libssl.1.1.dylib) + 110  [0x10837cda0]
    + ! : |     +               1096 ssl3_read_bytes  (in libssl.1.1.dylib) + 473  [0x108374ea1]
    + ! : |     +                 1096 ssl3_get_record  (in libssl.1.1.dylib) + 205  [0x108375ed5]
    + ! : |     +                   1096 ssl3_read_n  (in libssl.1.1.dylib) + 628  [0x1083737e0]
    + ! : |     +                     1096 BIO_read  (in libcrypto.1.1.dylib) + 25  [0x108413aba]
    + ! : |     +                       1096 bio_read_intern  (in libcrypto.1.1.dylib) + 138  [0x108413b53]
    + ! : |     +                         1096 ~procProc(Pointer(LibCrypto::Bio), Pointer(UInt8), UInt64, Pointer(UInt64), Int32)@/usr/local/Cellar/crystal/0.32.1/src/openssl/bio.cr:42  (in toucan) + 1348  [0x107aa0ab4]  bio.cr:46
    + ! : |     +                           1096 *Socket+@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 190  [0x107bb2c2e]  buffered.cr:79
    + ! : |     +                             1096 *Socket+@Socket#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 348  [0x107bb239c]  socket.cr:59
    + ! : |     +                               1096 *Socket+@IO::Evented#wait_readable:Nil  (in toucan) + 57  [0x107bb28c9]  evented.cr:118
    + ! : |     +                                 1096 *Socket+@IO::Evented#wait_readable<(Time::Span | Nil)>:Nil  (in toucan) + 601  [0x107bb2b29]  evented.cr:126
    + ! : |     +                                   1096 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x107b21919]  scheduler.cr:44
    + ! : |     +                                     1096 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 79  [0x107b2196f]  scheduler.cr:151
    + ! : |     +                                       1096 *Crystal::EventLoop::run_once:Int32  (in toucan) + 26  [0x107b2053a]  event_loop_libevent.cr:18
    + ! : |     +                                         1096 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x107b21081]  event_libevent.cr:62
    + ! : |     +                                           1095 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10867b343]
    + ! : |     +                                           ! 1095 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x1086845ba]
    + ! : |     +                                           !   1095 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffb01abd96]
    + ! : |     +                                           1 event_base_loop  (in libevent-2.1.7.dylib) + 743  [0x10867b36f]
    + ! : |     +                                             1 gettime  (in libevent-2.1.7.dylib) + 124  [0x1086793e2]
    + ! : |     +                                               1 evutil_gettime_monotonic_  (in libevent-2.1.7.dylib) + 32  [0x108682af2]
    + ! : |     +                                                 1 clock_gettime  (in libsystem_c.dylib) + 198  [0x7fffb00b32af]
    + ! : |     +                                                   1 _mach_boottime_usec  (in libsystem_c.dylib) + 40  [0x7fffb00b31b4]
    + ! : |     137 *HTTP::Server::RequestProcessor#process<IO+, IO+, IO::FileDescriptor>:Nil  (in toucan) + 2137  [0x107d7caf9]  request_processor.cr:48
    + ! : |     + 84 *Toucan::Relay::Http::Server#call<HTTP::Server::Context>:(IO+ | Int32 | Nil)  (in toucan) + 2174  [0x107d1bc8e]  server.cr:640
    + ! : |     + ! 84 *HTTP::Client#send_request<HTTP::Request>:Bool  (in toucan) + 56  [0x107dd4c48]  client.cr:656
    + ! : |     + !   83 *HTTP::Client#socket:IO+  (in toucan) + 620  [0x107dd546c]  client.cr:112
    + ! : |     + !   : 83 *OpenSSL::SSL::SuperSocket::Client::new:context:hostname:sync_context_free<TCPSocket, OpenSSL::SSL::SuperContext::Client, String, Bool>:OpenSSL::SSL::SuperSocket::Client  (in toucan) + 198  [0x107da7696]  super_socket.cr:5
    + ! : |     + !   :   83 *OpenSSL::SSL::SuperSocket::Client#initialize:context:hostname:sync_context_free<TCPSocket, OpenSSL::SSL::SuperContext::Client, String, Bool>:Nil  (in toucan) + 96  [0x107da7710]  super_socket.cr:10
    + ! : |     + !   :     82 state_machine  (in libssl.1.1.dylib) + 1604  [0x108398f18]
    + ! : |     + !   :     | 82 tls_get_message_header  (in libssl.1.1.dylib) + 94  [0x1083a2c48]
    + ! : |     + !   :     |   82 ssl3_read_bytes  (in libssl.1.1.dylib) + 473  [0x108374ea1]
    + ! : |     + !   :     |     82 ssl3_get_record  (in libssl.1.1.dylib) + 205  [0x108375ed5]
    + ! : |     + !   :     |       82 ssl3_read_n  (in libssl.1.1.dylib) + 628  [0x1083737e0]
    + ! : |     + !   :     |         82 BIO_read  (in libcrypto.1.1.dylib) + 25  [0x108413aba]
    + ! : |     + !   :     |           82 bio_read_intern  (in libcrypto.1.1.dylib) + 138  [0x108413b53]
    + ! : |     + !   :     |             82 ~procProc(Pointer(LibCrypto::Bio), Pointer(UInt8), UInt64, Pointer(UInt64), Int32)@/usr/local/Cellar/crystal/0.32.1/src/openssl/bio.cr:42  (in toucan) + 1348  [0x107aa0ab4]  bio.cr:46
    + ! : |     + !   :     |               82 *Socket+@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 190  [0x107bb2c2e]  buffered.cr:79
    + ! : |     + !   :     |                 82 *Socket+@Socket#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 348  [0x107bb239c]  socket.cr:59
    + ! : |     + !   :     |                   82 *Socket+@IO::Evented#wait_readable:Nil  (in toucan) + 57  [0x107bb28c9]  evented.cr:118
    + ! : |     + !   :     |                     82 *Socket+@IO::Evented#wait_readable<(Time::Span | Nil)>:Nil  (in toucan) + 601  [0x107bb2b29]  evented.cr:126
    + ! : |     + !   :     |                       82 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x107b21919]  scheduler.cr:44
    + ! : |     + !   :     |                         82 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 79  [0x107b2196f]  scheduler.cr:151
    + ! : |     + !   :     |                           82 *Crystal::EventLoop::run_once:Int32  (in toucan) + 26  [0x107b2053a]  event_loop_libevent.cr:18
    + ! : |     + !   :     |                             82 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x107b21081]  event_libevent.cr:62
    + ! : |     + !   :     |                               82 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10867b343]
    + ! : |     + !   :     |                                 82 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x1086845ba]
    + ! : |     + !   :     |                                   82 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffb01abd96]
    + ! : |     + !   :     1 state_machine  (in libssl.1.1.dylib) + 1500  [0x108398eb0]
    + ! : |     + !   :       1 tls_process_server_certificate  (in libssl.1.1.dylib) + 612  [0x10839cdc4]
    + ! : |     + !   :         1 ssl_verify_cert_chain  (in libssl.1.1.dylib) + 480  [0x10837ee1a]
    + ! : |     + !   :           1 X509_verify_cert  (in libcrypto.1.1.dylib) + 546  [0x1085481fe]
    + ! : |     + !   :             1 verify_chain  (in libcrypto.1.1.dylib) + 3569  [0x108549141]
    + ! : |     + !   :               1 internal_verify  (in libcrypto.1.1.dylib) + 279  [0x10854a581]
    + ! : |     + !   :                 1 ASN1_item_verify  (in libcrypto.1.1.dylib) + 496  [0x1083ff56e]
    + ! : |     + !   :                   1 EVP_DigestVerifyFinal  (in libcrypto.1.1.dylib) + 253  [0x1084cdd53]
    + ! : |     + !   :                     1 pkey_rsa_verify  (in libcrypto.1.1.dylib) + 92  [0x1085075e5]
    + ! : |     + !   :                       1 RSA_verify  (in libcrypto.1.1.dylib) + 50  [0x108509781]
    + ! : |     + !   :                         1 int_rsa_verify  (in libcrypto.1.1.dylib) + 138  [0x1085093ee]
    + ! : |     + !   :                           1 rsa_ossl_public_decrypt  (in libcrypto.1.1.dylib) + 604  [0x108505550]
    + ! : |     + !   :                             1 BN_MONT_CTX_set_locked  (in libcrypto.1.1.dylib) + 77  [0x108426731]
    + ! : |     + !   :                               1 BN_MONT_CTX_set  (in libcrypto.1.1.dylib) + 569  [0x108426617]
    + ! : |     + !   :                                 1 BN_div  (in libcrypto.1.1.dylib) + 128  [0x10841e92a]
    + ! : |     + !   :                                   1 bn_div_fixed_top  (in libcrypto.1.1.dylib) + 723  [0x10841ec3d]
    + ! : |     + !   :                                     1 bn_sub_words  (in libcrypto.1.1.dylib) + 32  [0x10841cdb0]
    + ! : |     + !   1 *HTTP::Client#socket:IO+  (in toucan) + 292  [0x107dd5324]  client.cr:107
    + ! : |     + !     1 *TCPSocket::new<String, Int32, (Float64 | Nil), (Float64 | Nil)>:TCPSocket  (in toucan) + 490  [0x107d9d5ba]  tcp_socket.cr:27
    + ! : |     + !       1 *TCPSocket#initialize<String, Int32, (Float64 | Nil), (Float64 | Nil)>:Nil  (in toucan) + 1088  [0x107d9da10]  tcp_socket.cr:120
    + ! : |     + !         1 getaddrinfo  (in libsystem_info.dylib) + 185  [0x7fffb016bad7]
    + ! : |     + !           1 si_addrinfo  (in libsystem_info.dylib) + 1945  [0x7fffb016c317]
    + ! : |     + !             1 search_addrinfo  (in libsystem_info.dylib) + 179  [0x7fffb0170128]
    + ! : |     + !               1 mdns_addrinfo  (in libsystem_info.dylib) + 631  [0x7fffb01703e5]
    + ! : |     + !                 1 _mdns_search  (in libsystem_info.dylib) + 834  [0x7fffb016e56b]
    + ! : |     + !                   1 _mdns_query_start  (in libsystem_info.dylib) + 1050  [0x7fffb016f2ec]
    + ! : |     + !                     1 DNSServiceQueryRecord  (in libsystem_dnssd.dylib) + 248  [0x7fffb0163364]
    + ! : |     + !                       1 deliver_request  (in libsystem_dnssd.dylib) + 1255  [0x7fffb0162dfa]
    + ! : |     + !                         1 __select_nocancel  (in libsystem_kernel.dylib) + 10  [0x7fffb01aaece]
    + ! : |     + 41 *Toucan::Relay::Http::Server#call<HTTP::Server::Context>:(IO+ | Int32 | Nil)  (in toucan) + 2300  [0x107d1bd0c]  server.cr:127
    + ! : |     + ! 41 *IO+@IO#gets<Int32, Bool>:(String | Nil)  (in toucan) + 157  [0x107ba315d]  io.cr:591
    + ! : |     + !   41 *IO+@IO#gets<Char, Int32, Bool>:(String | Nil)  (in toucan) + 915  [0x107b9fe73]  io.cr:632
    + ! : |     + !     41 *OpenSSL::SSL::Socket+@IO::Buffered#peek:Slice(UInt8)  (in toucan) + 54  [0x107bac6e6]  buffered.cr:102
    + ! : |     + !       41 *OpenSSL::SSL::Socket+@IO::Buffered#fill_buffer:Slice(UInt8)  (in toucan) + 95  [0x107bac7bf]  buffered.cr:214
    + ! : |     + !         41 *OpenSSL::SSL::SuperSocket+@OpenSSL::SSL::SuperSocket#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 159  [0x107baf72f]  super_socket.cr:147
    + ! : |     + !           41 SSL_read  (in libssl.1.1.dylib) + 25  [0x108386209]
    + ! : |     + !             41 ssl3_read_internal  (in libssl.1.1.dylib) + 110  [0x10837cda0]
    + ! : |     + !               41 ssl3_read_bytes  (in libssl.1.1.dylib) + 473  [0x108374ea1]
    + ! : |     + !                 41 ssl3_get_record  (in libssl.1.1.dylib) + 205  [0x108375ed5]
    + ! : |     + !                   41 ssl3_read_n  (in libssl.1.1.dylib) + 628  [0x1083737e0]
    + ! : |     + !                     41 BIO_read  (in libcrypto.1.1.dylib) + 25  [0x108413aba]
    + ! : |     + !                       41 bio_read_intern  (in libcrypto.1.1.dylib) + 138  [0x108413b53]
    + ! : |     + !                         41 ~procProc(Pointer(LibCrypto::Bio), Pointer(UInt8), UInt64, Pointer(UInt64), Int32)@/usr/local/Cellar/crystal/0.32.1/src/openssl/bio.cr:42  (in toucan) + 1348  [0x107aa0ab4]  bio.cr:46
    + ! : |     + !                           41 *Socket+@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 190  [0x107bb2c2e]  buffered.cr:79
    + ! : |     + !                             41 *Socket+@Socket#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 348  [0x107bb239c]  socket.cr:59
    + ! : |     + !                               41 *Socket+@IO::Evented#wait_readable:Nil  (in toucan) + 57  [0x107bb28c9]  evented.cr:118
    + ! : |     + !                                 41 *Socket+@IO::Evented#wait_readable<(Time::Span | Nil)>:Nil  (in toucan) + 601  [0x107bb2b29]  evented.cr:126
    + ! : |     + !                                   41 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x107b21919]  scheduler.cr:44
    + ! : |     + !                                     41 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 79  [0x107b2196f]  scheduler.cr:151
    + ! : |     + !                                       41 *Crystal::EventLoop::run_once:Int32  (in toucan) + 26  [0x107b2053a]  event_loop_libevent.cr:18
    + ! : |     + !                                         41 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x107b21081]  event_libevent.cr:62
    + ! : |     + !                                           41 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10867b343]
    + ! : |     + !                                             41 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x1086845ba]
    + ! : |     + !                                               41 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffb01abd96]
    + ! : |     + 10 *Toucan::Relay::Http::Server#call<HTTP::Server::Context>:(IO+ | Int32 | Nil)  (in toucan) + 534  [0x107d1b626]  server.cr:86
    + ! : |     + ! 10 *Toucan::Relay::Http::Request@Toucan::Relay::Http::Context#create_tls_context:(OpenSSL::SSL::SuperContext::Client | Nil)  (in toucan) + 86  [0x107dc2136]  context.cr:188
    + ! : |     + !   10 *Toucan::Relay::Http::Request@Toucan::Relay::Http::Context#create_tls_context!:(OpenSSL::SSL::SuperContext::Client | Nil)  (in toucan) + 38  [0x107dc2236]  context.cr:194
    + ! : |     + !     10 *OpenSSL::SSL::SuperContext::Client::new:OpenSSL::SSL::SuperContext::Client  (in toucan) + 17  [0x107dd20c1]  super_context.cr:6
    + ! : |     + !       10 *OpenSSL::SSL::SuperContext::Client@OpenSSL::SSL::Context::new<Pointer(Void)>:OpenSSL::SSL::SuperContext::Client  (in toucan) + 107  [0x107dd213b]  context.cr:210
    + ! : |     + !         10 *OpenSSL::SSL::SuperContext::Client@OpenSSL::SSL::Context#initialize<Pointer(Void)>:String  (in toucan) + 74  [0x107dd21aa]  context.cr:214
    + ! : |     + !           10 *OpenSSL::SSL::SuperContext::Client@OpenSSL::SSL::Context#set_default_verify_paths:Int32  (in toucan) + 13  [0x107dd224d]  context.cr:253
    + ! : |     + !             10 X509_STORE_set_default_paths  (in libcrypto.1.1.dylib) + 57  [0x1085450b4]
    + ! : |     + !               10 by_file_ctrl  (in libcrypto.1.1.dylib) + 68  [0x1085427be]
    + ! : |     + !                 9 X509_load_cert_crl_file  (in libcrypto.1.1.dylib) + 78  [0x10854265f]
    + ! : |     + !                 : 5 PEM_X509_INFO_read_bio  (in libcrypto.1.1.dylib) + 599  [0x1084e95e0]
    + ! : |     + !                 : | 5 ASN1_item_d2i  (in libcrypto.1.1.dylib) + 58  [0x10840760b]
    + ! : |     + !                 : |   5 ASN1_item_ex_d2i  (in libcrypto.1.1.dylib) + 35  [0x108407645]
    + ! : |     + !                 : |     5 asn1_item_embed_d2i  (in libcrypto.1.1.dylib) + 1311  [0x108407b86]
    + ! : |     + !                 : |       5 asn1_template_ex_d2i  (in libcrypto.1.1.dylib) + 90  [0x10840804a]
    + ! : |     + !                 : |         5 asn1_template_noexp_d2i  (in libcrypto.1.1.dylib) + 164  [0x108408cb8]
    + ! : |     + !                 : |           5 asn1_item_embed_d2i  (in libcrypto.1.1.dylib) + 1311  [0x108407b86]
    + ! : |     + !                 : |             5 asn1_template_ex_d2i  (in libcrypto.1.1.dylib) + 90  [0x10840804a]
    + ! : |     + !                 : |               5 asn1_template_noexp_d2i  (in libcrypto.1.1.dylib) + 164  [0x108408cb8]
    + ! : |     + !                 : |                 5 asn1_item_embed_d2i  (in libcrypto.1.1.dylib) + 573  [0x1084078a4]
    + ! : |     + !                 : |                   3 x509_name_ex_d2i  (in libcrypto.1.1.dylib) + 322  [0x10854f7fc]
    + ! : |     + !                 : |                   + 2 x509_name_canon  (in libcrypto.1.1.dylib) + 743  [0x10854fd67]
    + ! : |     + !                 : |                   + ! 2 i2d_name_canon  (in libcrypto.1.1.dylib) + 81  [0x10854fefa]
    + ! : |     + !                 : |                   + !   2 ASN1_item_ex_i2d  (in libcrypto.1.1.dylib) + 269  [0x1084093c7]
    + ! : |     + !                 : |                   + !     1 asn1_template_ex_i2d  (in libcrypto.1.1.dylib) + 294  [0x108409776]
    + ! : |     + !                 : |                   + !     : 1 ASN1_item_ex_i2d  (in libcrypto.1.1.dylib) + 589  [0x108409507]
    + ! : |     + !                 : |                   + !     :   1 asn1_template_ex_i2d  (in libcrypto.1.1.dylib) + 107  [0x1084096bb]
    + ! : |     + !                 : |                   + !     1 asn1_template_ex_i2d  (in libcrypto.1.1.dylib) + 564  [0x108409884]
    + ! : |     + !                 : |                   + !       1 ASN1_item_ex_i2d  (in libcrypto.1.1.dylib) + 810  [0x1084095e4]
    + ! : |     + !                 : |                   + !         1 asn1_template_ex_i2d  (in libcrypto.1.1.dylib) + 609  [0x1084098b1]
    + ! : |     + !                 : |                   + !           1 ASN1_item_ex_i2d  (in libcrypto.1.1.dylib) + 4  [0x1084092be]
    + ! : |     + !                 : |                   + 1 x509_name_canon  (in libcrypto.1.1.dylib) + 286  [0x10854fb9e]
    + ! : |     + !                 : |                   +   1 ASN1_STRING_to_UTF8  (in libcrypto.1.1.dylib) + 109  [0x1083fd203]
    + ! : |     + !                 : |                   +     1 ASN1_mbstring_copy  (in libcrypto.1.1.dylib) + 24  [0x1083fac24]
    + ! : |     + !                 : |                   +       1 ASN1_mbstring_ncopy  (in libcrypto.1.1.dylib) + 820  [0x1083faf5e]
    + ! : |     + !                 : |                   +         1 free  (in libsystem_malloc.dylib) + 431  [0x7fffb01fff84]
    + ! : |     + !                 : |                   1 x509_name_ex_d2i  (in libcrypto.1.1.dylib) + 84  [0x10854f70e]
    + ! : |     + !                 : |                   + 1 ASN1_item_ex_d2i  (in libcrypto.1.1.dylib) + 35  [0x108407645]
    + ! : |     + !                 : |                   +   1 asn1_item_embed_d2i  (in libcrypto.1.1.dylib) + 398  [0x1084077f5]
    + ! : |     + !                 : |                   +     1 asn1_template_ex_d2i  (in libcrypto.1.1.dylib) + 90  [0x10840804a]
    + ! : |     + !                 : |                   +       1 asn1_template_noexp_d2i  (in libcrypto.1.1.dylib) + 598  [0x108408e6a]
    + ! : |     + !                 : |                   +         1 asn1_item_embed_d2i  (in libcrypto.1.1.dylib) + 398  [0x1084077f5]
    + ! : |     + !                 : |                   +           1 asn1_template_ex_d2i  (in libcrypto.1.1.dylib) + 90  [0x10840804a]
    + ! : |     + !                 : |                   +             1 asn1_template_noexp_d2i  (in libcrypto.1.1.dylib) + 598  [0x108408e6a]
    + ! : |     + !                 : |                   +               1 asn1_item_embed_d2i  (in libcrypto.1.1.dylib) + 1003  [0x108407a52]
    + ! : |     + !                 : |                   +                 1 asn1_item_embed_new  (in libcrypto.1.1.dylib) + 380  [0x10840a3a3]
    + ! : |     + !                 : |                   +                   1 asn1_template_new  (in libcrypto.1.1.dylib) + 44  [0x10840a4f8]
    + ! : |     + !                 : |                   1 x509_name_ex_d2i  (in libcrypto.1.1.dylib) + 348  [0x10854f816]
    + ! : |     + !                 : |                     1 OPENSSL_sk_pop_free  (in libcrypto.1.1.dylib) + 46  [0x10853499d]
    + ! : |     + !                 : |                       1 OPENSSL_sk_free  (in libcrypto.1.1.dylib) + 39  [0x108534313]
    + ! : |     + !                 : |                         1 free_tiny  (in libsystem_malloc.dylib) + 671  [0x7fffb02160d5]
    + ! : |     + !                 : |                           1 tiny_free_no_lock  (in libsystem_malloc.dylib) + 190  [0x7fffb0215406]
    + ! : |     + !                 : 4 PEM_X509_INFO_read_bio  (in libcrypto.1.1.dylib) + 718  [0x1084e9657]
    + ! : |     + !                 :   2 PEM_read_bio_ex  (in libcrypto.1.1.dylib) + 1539  [0x1084eb60e]
    + ! : |     + !                 :   + 1 EVP_DecodeUpdate  (in libcrypto.1.1.dylib) + 287  [0x1084ca5f6]
    + ! : |     + !                 :   + ! 1 evp_decodeblock_int  (in libcrypto.1.1.dylib) + 266  [0x1084ca7e5]
    + ! : |     + !                 :   + 1 EVP_DecodeUpdate  (in libcrypto.1.1.dylib) + 218  [0x1084ca5b1]
    + ! : |     + !                 :   1 PEM_read_bio_ex  (in libcrypto.1.1.dylib) + 645  [0x1084eb290]
    + ! : |     + !                 :   + 1 BIO_free  (in libcrypto.1.1.dylib) + 152  [0x1084138f0]
    + ! : |     + !                 :   +   1 mem_free  (in libcrypto.1.1.dylib) + 23  [0x10841849b]
    + ! : |     + !                 :   +     1 mem_buf_free  (in libcrypto.1.1.dylib) + 62  [0x108418563]
    + ! : |     + !                 :   +       1 BUF_MEM_free  (in libcrypto.1.1.dylib) + 50  [0x108435182]
    + ! : |     + !                 :   +         1 CRYPTO_clear_free  (in libcrypto.1.1.dylib) + 37  [0x1084d98f6]
    + ! : |     + !                 :   +           1 OPENSSL_cleanse  (in libcrypto.1.1.dylib) + 67  [0x108561e33]
    + ! : |     + !                 :   1 PEM_read_bio_ex  (in libcrypto.1.1.dylib) + 1044  [0x1084eb41f]
    + ! : |     + !                 :     1 BIO_gets  (in libcrypto.1.1.dylib) + 146  [0x108413f79]
    + ! : |     + !                 :       1 file_gets  (in libcrypto.1.1.dylib) + 29  [0x108417ad0]
    + ! : |     + !                 :         1 fgets  (in libsystem_c.dylib) + 103  [0x7fffb00ef05a]
    + ! : |     + !                 :           1 __srefill1  (in libsystem_c.dylib) + 24  [0x7fffb00f5797]
    + ! : |     + !                 :             1 _sread  (in libsystem_c.dylib) + 16  [0x7fffb00f615c]
    + ! : |     + !                 :               1 __read_nocancel  (in libsystem_kernel.dylib) + 10  [0x7fffb01aadc6]
    + ! : |     + !                 1 X509_load_cert_crl_file  (in libcrypto.1.1.dylib) + 146  [0x1085426a3]
    + ! : |     + !                   1 X509_STORE_add_cert  (in libcrypto.1.1.dylib) + 11  [0x108545b9f]
    + ! : |     + !                     1 x509_store_add  (in libcrypto.1.1.dylib) + 108  [0x108545c3b]
    + ! : |     + !                       1 X509_OBJECT_retrieve_match  (in libcrypto.1.1.dylib) + 32  [0x108546219]
    + ! : |     + !                         1 internal_find  (in libcrypto.1.1.dylib) + 86  [0x10853483d]
    + ! : |     + !                           1 heapsort  (in libsystem_c.dylib) + 491  [0x7fffb011279e]
    + ! : |     + 1 *Toucan::Relay::Http::Server#call<HTTP::Server::Context>:(IO+ | Int32 | Nil)  (in toucan) + 188631  [0x107d494e7]  server.cr:233
    + ! : |     + ! 1 *HTTP::Client#close:Nil  (in toucan) + 1472  [0x107dd6560]  client.cr:59
    + ! : |     + !   1 *HTTP::Client#all_free:Nil  (in toucan) + 63  [0x107dd5ddf]  client.cr:79
    + ! : |     + !     1 *OpenSSL::SSL::SuperSocket::Client@OpenSSL::SSL::SuperSocket#all_free:Nil  (in toucan) + 26  [0x107da797a]  super_socket.cr:132
    + ! : |     + !       1 *OpenSSL::SSL::SuperSocket::Client@OpenSSL::SSL::SuperSocket#free:Nil  (in toucan) + 38  [0x107da79c6]  super_socket.cr:122
    + ! : |     + !         1 *OpenSSL::SSL::SuperSocket::Client@OpenSSL::SSL::SuperSocket#free!:Nil  (in toucan) + 20  [0x107da79e4]  super_socket.cr:127
    + ! : |     + !           1 SSL_free  (in libssl.1.1.dylib) + 208  [0x108384156]
    + ! : |     + !             1 SSL_SESSION_free  (in libssl.1.1.dylib) + 124  [0x10838cfa7]
    + ! : |     + !               1 OPENSSL_sk_pop_free  (in libcrypto.1.1.dylib) + 46  [0x10853499d]
    + ! : |     + !                 1 ASN1_item_free  (in libcrypto.1.1.dylib) + 25  [0x108409e01]
    + ! : |     + !                   1 asn1_item_embed_free  (in libcrypto.1.1.dylib) + 241  [0x108409ef8]
    + ! : |     + !                     1 asn1_template_free  (in libcrypto.1.1.dylib) + 150  [0x10840a0f6]
    + ! : |     + !                       1 asn1_item_embed_free  (in libcrypto.1.1.dylib) + 241  [0x108409ef8]
    + ! : |     + !                         1 asn1_template_free  (in libcrypto.1.1.dylib) + 150  [0x10840a0f6]
    + ! : |     + !                           1 asn1_item_embed_free  (in libcrypto.1.1.dylib) + 211  [0x108409eda]
    + ! : |     + !                             1 asn1_do_adb  (in libcrypto.1.1.dylib) + 4  [0x10840bbdb]
    + ! : |     + 1 *Toucan::Relay::Http::Server#call<HTTP::Server::Context>:(IO+ | Int32 | Nil)  (in toucan) + 96834  [0x107d32e52]  server.cr:60
    + ! : |     +   1 *HTTP::check_content_type_charset<(IO+ | Nil), HTTP::Headers>:Nil  (in toucan) + 89  [0x107b95e19]  common.cr:132
    + ! : |     +     1 *MIME::MediaType::parse?<String>:(MIME::MediaType | Nil)  (in toucan) + 4833  [0x107db40f1]  media_type.cr:266
    + ! : |     +       1 *Hash(String, String)@Hash(K, V)#[]=<String, String>:String  (in toucan) + 50  [0x107be9e02]  hash.cr:989
    + ! : |     +         1 *Hash(String, String)@Hash(K, V)#upsert<String, String>:(Hash::Entry(String, String) | Nil)  (in toucan) + 95  [0x107be9e6f]  hash.cr:336
    + ! : |     +           1 *Hash(String, String)@Hash(K, V)#malloc_entries<Int32>:Pointer(Hash::Entry(String, String))  (in toucan) + 24  [0x107bea368]  hash.cr:844
    + ! : |     +             1 *Pointer(Hash::Entry(String, String))@Pointer(T)::malloc<Int32>:Pointer(Hash::Entry(String, String))  (in toucan) + 71  [0x107bebc17]  pointer.cr:153
    + ! : |     +               1 __crystal_malloc64  (in toucan) + 17  [0x107a87a41]  gc.cr:24
    + ! : |     +                 1 *GC::malloc<UInt64>:Pointer(Void)  (in toucan) + 9  [0x107ae7ea9]  boehm.cr:110
    + ! : |     +                   1 GC_malloc_kind  (in toucan) + 214  [0x107e2097c]
    + ! : |     +                     1 GC_generic_malloc_many  (in toucan) + 501  [0x107e17116]
    + ! : |     +                       1 GC_reclaim_generic  (in toucan) + 95  [0x107e1db6f]
    + ! : |     +                         1 GC_reclaim_clear  (in toucan) + 93  [0x107e1d886]
    + ! : |     1 *HTTP::Server::RequestProcessor#process<IO+, IO+, IO::FileDescriptor>:Nil  (in toucan) + 1567  [0x107d7c8bf]  request_processor.cr:44
    + ! : |       1 *HTTP::Request#keep_alive?:Bool  (in toucan) + 9  [0x107dae569]  request.cr:60
    + ! : |         1 *HTTP::keep_alive?<HTTP::Request>:Bool  (in toucan) + 144  [0x107b95f30]  common.cr:311
    + ! : |           1 *String#downcase:String  (in toucan) + 31  [0x107ac359f]  string.cr:943
    + ! : |             1 *String#downcase<Unicode::CaseOptions>:String  (in toucan) + 554  [0x107ac37da]  string.cr:949
    + ! : |               1 *Char#downcase:Char  (in toucan) + 29  [0x107aefb7d]  char.cr:369
    + ! : |                 1 *Char#downcase<Unicode::CaseOptions>:Char  (in toucan) + 9  [0x107aedb29]  char.cr:370
    + ! : |                   1 *Unicode::downcase<Char, Unicode::CaseOptions>:Char  (in toucan) + 40  [0x107b4c658]  unicode.cr:90
    + ! : |                     1 *Unicode::check_downcase_ascii<Char, Unicode::CaseOptions>:(Char | Nil)  (in toucan) + 36  [0x107b4c8c4]  unicode.cr:0
    + ! : 2 ~proc2Proc(Nil)@src/toucan/relay/http/context.cr:27  (in toucan) + 42  [0x107aa772a]  context.cr:28
    + ! :   1 *Toucan::Relay::Http::Response@Toucan::Relay::Http::Context#transport<IO+, IO::FileDescriptor, Int32, Bool>:(Bool | IO+ | Int32 | Nil)  (in toucan) + 8237  [0x107dda16d]  context.cr:13
    + ! :   + 1 *IO::copy<IO+, IO::Memory, Int32>:UInt64  (in toucan) + 1302  [0x107b64bb6]  io.cr:1153
    + ! :   +   1 *Gzip::Reader@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 190  [0x107bbbeae]  buffered.cr:79
    + ! :   +     1 *Gzip::Reader#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 3509  [0x107bbb7f5]  reader.cr:85
    + ! :   +       1 *Flate::Reader@IO::Buffered#read<Slice(UInt8)>:Int32  (in toucan) + 190  [0x107bbea4e]  buffered.cr:79
    + ! :   +         1 *Flate::Reader#unbuffered_read<Slice(UInt8)>:Int32  (in toucan) + 3823  [0x107bbfa5f]  reader.cr:89
    + ! :   +           1 inflate  (in libz.1.dylib) + 6323  [0x7fffaff86cdd]
    + ! :   +             1 ???  (in libz.1.dylib)  load address 0x7fffaff80000 + 0x6f51  [0x7fffaff86f51]
    + ! :   +               1 ~procProc(Pointer(Void), UInt32, UInt32, Pointer(Void))@/usr/local/Cellar/crystal/0.32.1/src/flate/reader.cr:25  (in toucan) + 38  [0x107a9feb6]  reader.cr:25
    + ! :   +                 1 *GC::malloc<UInt32>:Pointer(Void)  (in toucan) + 17  [0x107ae7ed1]  gc.cr:72
    + ! :   +                   1 *GC::malloc<UInt64>:Pointer(Void)  (in toucan) + 9  [0x107ae7ea9]  boehm.cr:110
    + ! :   +                     1 GC_malloc_kind_global  (in toucan) + 219  [0x107e167ba]
    + ! :   +                       1 GC_generic_malloc  (in toucan) + 37  [0x107e16549]
    + ! :   +                         1 GC_notify_or_invoke_finalizers  (in toucan) + 150  [0x107e14ffb]
    + ! :   +                           1 GC_invoke_finalizers  (in toucan) + 140  [0x107e14ecb]
    + ! :   +                             1 ~proc12Proc(Pointer(Void), Pointer(Void), Nil)@/usr/local/Cellar/crystal/0.32.1/src/gc/boehm.cr:164  (in toucan) + 17  [0x107aa6bc1]  boehm.cr:164
    + ! :   +                               1 *OpenSSL::SSL::Socket::Server@OpenSSL::SSL::Socket#finalize:Nil  (in toucan) + 13  [0x107da538d]  socket.cr:107
    + ! :   +                                 1 SSL_free  (in libssl.1.1.dylib) + 166  [0x10838412c]
    + ! :   +                                   1 free_tiny  (in libsystem_malloc.dylib) + 691  [0x7fffb02160e9]
    + ! :   1 *Toucan::Relay::Http::Response@Toucan::Relay::Http::Context#transport<IO+, IO::FileDescriptor, Int32, Bool>:(Bool | IO+ | Int32 | Nil)  (in toucan) + 320  [0x107dd8280]  context.cr:3
    + ! :     1 *IO::Memory::new<Int32>:IO::Memory  (in toucan) + 137  [0x107bc9bb9]  memory.cr:24
    + ! :       1 *IO::Memory#initialize<Int32>:Bool  (in toucan) + 79  [0x107bc9c1f]  memory.cr:27
    + ! :         1 *GC::malloc_atomic<UInt32>:Pointer(Void)  (in toucan) + 17  [0x107ae7b41]  gc.cr:76
    + ! :           1 *GC::malloc_atomic<UInt64>:Pointer(Void)  (in toucan) + 9  [0x107ae7b59]  boehm.cr:115
    + ! :             1 GC_malloc_kind_global  (in toucan) + 219  [0x107e167ba]
    + ! :               1 GC_generic_malloc  (in toucan) + 288  [0x107e16644]
    + ! :                 1 GC_alloc_large  (in toucan) + 204  [0x107e16135]
    + ! :                   1 GC_collect_or_expand  (in toucan) + 181  [0x107e11063]
    + ! :                     1 GC_try_to_collect_inner  (in toucan) + 311  [0x107e1003f]
    + ! :                       1 GC_stopped_mark  (in toucan) + 177  [0x107e10182]
    + ! :                         1 GC_mark_some  (in toucan) + 350  [0x107e179c3]
    + ! :                           1 GC_do_parallel_mark  (in toucan) + 111  [0x107e18163]
    + ! :                             1 GC_mark_local  (in toucan) + 142  [0x107e18806]
    + ! :                               1 _pthread_mutex_lock_wait  (in libsystem_pthread.dylib) + 100  [0x7fffb0295dfa]
    + ! :                                 1 __psynch_mutexwait  (in libsystem_kernel.dylib) + 10  [0x7fffb01aac22]
    + ! 40 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 665  [0x107b082d9]  fiber.cr:109
    + !   40 *Crystal::Scheduler::reschedule:Nil  (in toucan) + 25  [0x107b21919]  scheduler.cr:44
    + !     40 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 79  [0x107b2196f]  scheduler.cr:151
    + !       40 *Crystal::EventLoop::run_once:Int32  (in toucan) + 26  [0x107b2053a]  event_loop_libevent.cr:18
    + !         40 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x107b21081]  event_libevent.cr:62
    + !           40 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10867b343]
    + !             40 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x1086845ba]
    + !               40 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffb01abd96]
    + 784 ~procProc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal/0.32.1/src/fiber.cr:47  (in toucan) + 9  [0x107a9c659]  fiber.cr:47
    + ! 784 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 78  [0x107b0808e]  fiber.cr:255
    + !   784 ~procProc(Nil)@/usr/local/Cellar/crystal/0.32.1/src/kernel.cr:542  (in toucan) + 24  [0x107a9c508]  kernel.cr:542
    + !     784 *sleep<Int32>:Nil  (in toucan) + 66  [0x107a9c562]  concurrent.cr:15
    + !       784 *Crystal::Scheduler::sleep<Time::Span>:Nil  (in toucan) + 57  [0x107b21f39]  scheduler.cr:52
    + !         784 *Crystal::Scheduler#sleep<Time::Span>:Nil  (in toucan) + 84  [0x107b21f94]  scheduler.cr:162
    + !           784 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 79  [0x107b2196f]  scheduler.cr:151
    + !             784 *Crystal::EventLoop::run_once:Int32  (in toucan) + 26  [0x107b2053a]  event_loop_libevent.cr:18
    + !               784 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x107b21081]  event_libevent.cr:62
    + !                 784 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10867b343]
    + !                   784 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x1086845ba]
    + !                     784 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffb01abd96]
    + 1 tiny_free_list_add_ptr  (in libsystem_malloc.dylib) + 341  [0x7fffb020073c]
    2061 Thread_226231
    + 2061 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffb029508d]
    +   2061 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffb0295887]
    +     2061 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffb029593b]
    +       2061 GC_mark_thread  (in toucan) + 132  [0x107e1e628]
    +         2060 GC_help_marker  (in toucan) + 46  [0x107e18976]
    +         ! 2060 GC_wait_marker  (in toucan) + 23  [0x107e1fe55]
    +         !   2060 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffb02967fa]
    +         !     2060 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffb01aabf2]
    +         1 GC_help_marker  (in toucan) + 103  [0x107e189af]
    +           1 GC_mark_local  (in toucan) + 278  [0x107e1888e]
    +             1 GC_do_local_mark  (in toucan) + 206  [0x107e18731]
    +               1 GC_return_mark_stack  (in toucan) + 40  [0x107e185d7]
    +                 1 _pthread_mutex_lock_wait  (in libsystem_pthread.dylib) + 100  [0x7fffb0295dfa]
    +                   1 __psynch_mutexwait  (in libsystem_kernel.dylib) + 10  [0x7fffb01aac22]
    2061 Thread_226232
    + 2061 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffb029508d]
    +   2061 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffb0295887]
    +     2061 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffb029593b]
    +       2061 GC_mark_thread  (in toucan) + 132  [0x107e1e628]
    +         2060 GC_help_marker  (in toucan) + 46  [0x107e18976]
    +         ! 2060 GC_wait_marker  (in toucan) + 23  [0x107e1fe55]
    +         !   2060 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffb02967fa]
    +         !     2060 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffb01aabf2]
    +         1 GC_help_marker  (in toucan) + 103  [0x107e189af]
    +           1 GC_mark_local  (in toucan) + 339  [0x107e188cb]
    +             1 GC_wait_marker  (in toucan) + 23  [0x107e1fe55]
    +               1 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffb02967fa]
    +                 1 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffb01aabf2]
    2061 Thread_226233
      2061 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffb029508d]
        2061 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffb0295887]
          2061 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffb029593b]
            2061 GC_mark_thread  (in toucan) + 132  [0x107e1e628]
              2060 GC_help_marker  (in toucan) + 46  [0x107e18976]
              ! 2060 GC_wait_marker  (in toucan) + 23  [0x107e1fe55]
              !   2060 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffb02967fa]
              !     2060 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffb01aabf2]
              1 GC_help_marker  (in toucan) + 103  [0x107e189af]
                1 GC_mark_local  (in toucan) + 142  [0x107e18806]
                  1 _pthread_mutex_lock_wait  (in libsystem_pthread.dylib) + 100  [0x7fffb0295dfa]
                    1 __psynch_mutexwait  (in libsystem_kernel.dylib) + 10  [0x7fffb01aac22]

Total number in stack (recursive counted multiple, when >=5):
        5       *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x107b21081]  event_libevent.cr:62
        5       *Crystal::EventLoop::run_once:Int32  (in toucan) + 26  [0x107b2053a]  event_loop_libevent.cr:18
        5       *Crystal::Scheduler#reschedule:Nil  (in toucan) + 79  [0x107b2196f]  scheduler.cr:151
        5       event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10867b343]
        5       kevent  (in libsystem_kernel.dylib) + 0  [0x7fffb01abd8c]
        5       kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x1086845ba]

Sort by top of stack, same collapsed (when >= 5):
        __psynch_cvwait  (in libsystem_kernel.dylib)        6181
        kevent  (in libsystem_kernel.dylib)        2042

Binary Images:
       0x107a85000 -        0x107eb4ff7 +toucan (0) <FAF476C4-DAA7-36E1-826E-8B16EFE18298> /usr/local/bin/toucan
       0x108350000 -        0x108368fff +libyaml-0.2.dylib (0) <D64BFABD-6330-3455-AEA3-A051EC3B4B3B> /usr/local/opt/libyaml/lib/libyaml-0.2.dylib
       0x10836d000 -        0x1083bcff3 +libssl.1.1.dylib (0) <DEAC0E01-F7A1-3054-AA76-9BDC5504FF3E> /usr/local/opt/[email protected]/lib/libssl.1.1.dylib
       0x1083e8000 -        0x1085a7a53 +libcrypto.1.1.dylib (0) <7AAA983D-49B4-37A5-94D5-D6870CAD4580> /usr/local/opt/[email protected]/lib/libcrypto.1.1.dylib
       0x10863a000 -        0x108667ff3  libpcre.0.dylib (8) <BCEA4851-21D3-3EFD-B66F-438CC1F96AF3> /usr/lib/libpcre.0.dylib
       0x10866d000 -        0x10869aff7 +libevent-2.1.7.dylib (0) <E8D7300E-8FE0-33C8-B9C5-DA74B3278FED> /usr/local/opt/libevent/lib/libevent-2.1.7.dylib
       0x10e8a2000 -        0x10e8dfdc7  dyld (0.0 - ???) <322C06B7-8878-311D-888C-C8FD2CA96FF3> /usr/lib/dyld
    0x7fffaead2000 -     0x7fffaead3ffb  libSystem.B.dylib (1238.60.2) <F18AC1E7-C6F1-34B1-8069-BE571B3231D4> /usr/lib/libSystem.B.dylib
    0x7fffaec0c000 -     0x7fffaec62ff7  libc++.1.dylib (307.5) <0B43BB5D-E6EB-3464-8DE9-B41AC8ED9D1C> /usr/lib/libc++.1.dylib
    0x7fffaec63000 -     0x7fffaec8cff7  libc++abi.dylib (307.4) <BC271AD3-831B-362A-9DA7-E8C51F285FE4> /usr/lib/libc++abi.dylib
    0x7fffaf0da000 -     0x7fffaf1ccff7  libiconv.2.dylib (50) <42125B35-81D7-3FC4-9475-A26DBE10884D> /usr/lib/libiconv.2.dylib
    0x7fffaf781000 -     0x7fffafb53047  libobjc.A.dylib (709.1) <70614861-0340-32E2-85ED-FE65759CDFFA> /usr/lib/libobjc.A.dylib
    0x7fffaff80000 -     0x7fffaff91ff3  libz.1.dylib (67) <46E3FFA2-4328-327A-8D34-A03E20BFFB8E> /usr/lib/libz.1.dylib
    0x7fffaffa0000 -     0x7fffaffa4ff7  libcache.dylib (79) <093A4DAB-8385-3D47-A350-E20CB7CCF7BF> /usr/lib/system/libcache.dylib
    0x7fffaffa5000 -     0x7fffaffaffff  libcommonCrypto.dylib (60092.50.5) <8A64D1B0-C70E-385C-92F0-E669079FDA90> /usr/lib/system/libcommonCrypto.dylib
    0x7fffaffb0000 -     0x7fffaffb7fff  libcompiler_rt.dylib (62) <55D47421-772A-32AB-B529-1A46C2F43B4D> /usr/lib/system/libcompiler_rt.dylib
    0x7fffaffb8000 -     0x7fffaffc0fff  libcopyfile.dylib (138) <819BEA3C-DF11-3E3D-A1A1-5A51C5BF1961> /usr/lib/system/libcopyfile.dylib
    0x7fffaffc1000 -     0x7fffb0044fdf  libcorecrypto.dylib (442.50.19) <65D7165E-2E71-335D-A2D6-33F78E2DF0C1> /usr/lib/system/libcorecrypto.dylib
    0x7fffb0045000 -     0x7fffb0076fff  libdispatch.dylib (703.50.37) <6582BAD6-ED27-3B30-B620-90B1C5A4AE3C> /usr/lib/system/libdispatch.dylib
    0x7fffb0077000 -     0x7fffb007cffb  libdyld.dylib (433.5) <9B2AC56D-107C-3541-A127-9094A751F2C9> /usr/lib/system/libdyld.dylib
    0x7fffb007d000 -     0x7fffb007dffb  libkeymgr.dylib (28) <7AA011A9-DC21-3488-BF73-3B5B14D1FDD6> /usr/lib/system/libkeymgr.dylib
    0x7fffb008b000 -     0x7fffb008bfff  liblaunch.dylib (972.70.1) <B856ABD2-896E-3DE0-B2C8-146A6AF8E2A7> /usr/lib/system/liblaunch.dylib
    0x7fffb008c000 -     0x7fffb0091ff3  libmacho.dylib (898) <17D5D855-F6C3-3B04-B680-E9BF02EF8AED> /usr/lib/system/libmacho.dylib
    0x7fffb0092000 -     0x7fffb0094ff3  libquarantine.dylib (85.50.1) <12448CC2-378E-35F3-BE33-9DC395A5B970> /usr/lib/system/libquarantine.dylib
    0x7fffb0095000 -     0x7fffb0096ffb  libremovefile.dylib (45) <38D4CB9C-10CD-30D3-8B7B-A515EC75FE85> /usr/lib/system/libremovefile.dylib
    0x7fffb0097000 -     0x7fffb00afff7  libsystem_asl.dylib (349.50.5) <096E4228-3B7C-30A6-8B13-EC909A64499A> /usr/lib/system/libsystem_asl.dylib
    0x7fffb00b0000 -     0x7fffb00b0ff7  libsystem_blocks.dylib (67) <10DC5404-73AB-35B3-A277-A8AFECB476EB> /usr/lib/system/libsystem_blocks.dylib
    0x7fffb00b1000 -     0x7fffb013efef  libsystem_c.dylib (1158.50.2) <E5AE5244-7D0C-36AC-8BB6-C7AE7EA52A4B> /usr/lib/system/libsystem_c.dylib
    0x7fffb013f000 -     0x7fffb0142ffb  libsystem_configuration.dylib (888.60.2) <BECC01A2-CA8D-31E6-BCDF-D452965FA976> /usr/lib/system/libsystem_configuration.dylib
    0x7fffb0143000 -     0x7fffb0146fff  libsystem_coreservices.dylib (41.4) <7D26DE79-B424-3450-85E1-F7FAB32714AB> /usr/lib/system/libsystem_coreservices.dylib
    0x7fffb0147000 -     0x7fffb015ffff  libsystem_coretls.dylib (121.50.4) <EC6FCF07-DCFB-3A03-9CC9-6DD3709974C6> /usr/lib/system/libsystem_coretls.dylib
    0x7fffb0160000 -     0x7fffb0166fff  libsystem_dnssd.dylib (765.50.9) <CC960215-0B1B-3822-A13A-3DDE96FA796F> /usr/lib/system/libsystem_dnssd.dylib
    0x7fffb0167000 -     0x7fffb0190ff7  libsystem_info.dylib (503.50.4) <611DB84C-BF70-3F92-8702-B9F28A900920> /usr/lib/system/libsystem_info.dylib
    0x7fffb0191000 -     0x7fffb01b3ff7  libsystem_kernel.dylib (3789.70.16) <34B1F16C-BC9C-3C5F-9045-0CAE91CB5914> /usr/lib/system/libsystem_kernel.dylib
    0x7fffb01b4000 -     0x7fffb01fbfe7  libsystem_m.dylib (3121.6) <86D499B5-BBDC-3D3B-8A4E-97AE8E6672A4> /usr/lib/system/libsystem_m.dylib
    0x7fffb01fc000 -     0x7fffb021aff7  libsystem_malloc.dylib (116.50.8) <A3D15F17-99A6-3367-8C7E-4280E8619C95> /usr/lib/system/libsystem_malloc.dylib
    0x7fffb021b000 -     0x7fffb0274ffb  libsystem_network.dylib (856.60.1) <369D0221-56CA-3C3E-9EDE-94B41CAE77B7> /usr/lib/system/libsystem_network.dylib
    0x7fffb0275000 -     0x7fffb027eff3  libsystem_networkextension.dylib (563.60.2) <B021F2B3-8A75-3633-ABB0-FC012B8E9B0C> /usr/lib/system/libsystem_networkextension.dylib
    0x7fffb027f000 -     0x7fffb0288ff3  libsystem_notify.dylib (165.20.1) <B8160190-A069-3B3A-BDF6-2AA408221FAE> /usr/lib/system/libsystem_notify.dylib
    0x7fffb0289000 -     0x7fffb0291fe7  libsystem_platform.dylib (126.50.8) <897462FD-B318-321B-A554-E61982630F7E> /usr/lib/system/libsystem_platform.dylib
    0x7fffb0292000 -     0x7fffb029cff7  libsystem_pthread.dylib (218.60.3) <B8FB5E20-3295-39E2-B5EB-B464D1D4B104> /usr/lib/system/libsystem_pthread.dylib
    0x7fffb029d000 -     0x7fffb02a0ff7  libsystem_sandbox.dylib (592.70.1) <4B92EC49-ACD0-36AE-B07A-A2B8152EAF9D> /usr/lib/system/libsystem_sandbox.dylib
    0x7fffb02a1000 -     0x7fffb02a2ff3  libsystem_secinit.dylib (24.50.4) <F78B847B-3565-3E4B-98A6-F7AD40392E2D> /usr/lib/system/libsystem_secinit.dylib
    0x7fffb02a3000 -     0x7fffb02aaffb  libsystem_symptoms.dylib (532.50.47) <3390E07C-C1CE-348F-ADBD-2C5440B45EAA> /usr/lib/system/libsystem_symptoms.dylib
    0x7fffb02ab000 -     0x7fffb02beff7  libsystem_trace.dylib (518.70.1) <AC63A7FE-50D9-3A30-96E6-F6B7FF16E465> /usr/lib/system/libsystem_trace.dylib
    0x7fffb02bf000 -     0x7fffb02c4ffb  libunwind.dylib (35.3) <3D50D8A8-C460-334D-A519-2DA841102C6B> /usr/lib/system/libunwind.dylib
    0x7fffb02c5000 -     0x7fffb02eeff7  libxpc.dylib (972.70.1) <BF896DF0-D8E9-31A8-A4B3-01120BFEEE52> /usr/lib/system/libxpc.dylib
Sample analysis of process 77693 written to file /dev/stdout

@rdp
Copy link
Contributor

rdp commented Dec 31, 2019

#8108 describes a situation where the normal #accept call just hangs for awhile (until the timeout occurs), but unfortunately it doesn't appear in any stack traces (except possibly as a wait_readable? Wait why have I never noticed that then? Maybe it's getting obscured by some other fiber or other). Might be worth adding some debug lines around your SSL_Accept section to see if it's affecting you or not. Or maybe it's the DNS thing who knows ;)

@636f7374
Copy link
Author

636f7374 commented Dec 31, 2019

Update

@rdp Yes, after testing, it is not caused by DNS. I used a custom DNS resolver, but the problem still exists.

#8108 describes a situation where the normal #accept call just hangs for awhile (until the timeout occurs), but unfortunately it doesn't appear in any stack traces (except possibly as a wait_readable?

Yes, mine too.
When the program is stuck, lsof only shows one ESTABLISHED. When the connection is killed, many CLOSED will appear, and these CLOSED cannot be eliminated.


Wait why have I never noticed that then? Maybe it's getting obscured by some other fiber or other). Might be worth adding some debug lines around your SSL_Accept section to see if it's affecting you or not. Or maybe it's the DNS thing who knows ;)

Yes, I found it before. When the ESTABLISHED connection is forcibly closed, the server will quickly accept subsequent requests (@wrapped.accept?), Because the client has been disconnected, so lsof will become CLOSED, But I didn't find any fd leak.

Sorry i understand wrong, i will test this part.

class OpenSSL::SSL::Server
  ...
  def accept? : OpenSSL::SSL::Socket::Server?
    if socket = @wrapped.accept?
      ...
    end
  end
end

Call Graph

Sampling process 81751 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling toucan (pid 81751) every 1 millisecond
Process:         toucan [81751]
Path:            /usr/local/bin/toucan
Load Address:    0x10c886000
Identifier:      toucan
Version:         0
Code Type:       X86-64
Parent Process:  bash [77116]

Date/Time:       2019-12-31 20:28:44.234 +0800
Launch Time:     2019-12-31 19:32:00.735 +0800
OS Version:      Mac OS X 10.12.6 (16G29)
Report Version:  7
Analysis Tool:   /usr/bin/sample
----

Call graph:
    2729 Thread_378570   DispatchQueue_1: com.apple.main-thread  (serial)
    + 2729 ~procProc(Fiber, (IO::FileDescriptor | Nil))@/usr/local/Cellar/crystal/0.32.1/src/fiber.cr:47  (in toucan) + 9  [0x10c89d199]  fiber.cr:47
    +   2729 *Fiber#run:(IO::FileDescriptor | Nil)  (in toucan) + 78  [0x10c91123e]  fiber.cr:255
    +     2729 ~procProc(Nil)@/usr/local/Cellar/crystal/0.32.1/src/kernel.cr:542  (in toucan) + 24  [0x10c89d048]  kernel.cr:542
    +       2729 *sleep<Int32>:Nil  (in toucan) + 66  [0x10c89d0a2]  concurrent.cr:15
    +         2729 *Crystal::Scheduler::sleep<Time::Span>:Nil  (in toucan) + 57  [0x10c92b8a9]  scheduler.cr:52
    +           2729 *Crystal::Scheduler#sleep<Time::Span>:Nil  (in toucan) + 84  [0x10c92b904]  scheduler.cr:162
    +             2729 *Crystal::Scheduler#reschedule:Nil  (in toucan) + 79  [0x10c92b2df]  scheduler.cr:151
    +               2729 *Crystal::EventLoop::run_once:Int32  (in toucan) + 26  [0x10c929b9a]  event_loop_libevent.cr:18
    +                 2729 *Crystal::Event::Base#run_once:Int32  (in toucan) + 17  [0x10c92a8f1]  event_libevent.cr:62
    +                   2729 event_base_loop  (in libevent-2.1.7.dylib) + 699  [0x10d531343]
    +                     2729 kq_dispatch  (in libevent-2.1.7.dylib) + 559  [0x10d53a5ba]
    +                       2729 kevent  (in libsystem_kernel.dylib) + 10  [0x7fffb01abd96]
    2729 Thread_378571
    + 2729 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffb029508d]
    +   2729 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffb0295887]
    +     2729 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffb029593b]
    +       2729 GC_mark_thread  (in toucan) + 132  [0x10cc5e048]
    +         2729 GC_help_marker  (in toucan) + 46  [0x10cc58396]
    +           2729 GC_wait_marker  (in toucan) + 23  [0x10cc5f875]
    +             2729 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffb02967fa]
    +               2729 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffb01aabf2]
    2729 Thread_378572
    + 2729 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffb029508d]
    +   2729 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffb0295887]
    +     2729 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffb029593b]
    +       2729 GC_mark_thread  (in toucan) + 132  [0x10cc5e048]
    +         2729 GC_help_marker  (in toucan) + 46  [0x10cc58396]
    +           2729 GC_wait_marker  (in toucan) + 23  [0x10cc5f875]
    +             2729 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffb02967fa]
    +               2729 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffb01aabf2]
    2729 Thread_378573
      2729 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fffb029508d]
        2729 _pthread_start  (in libsystem_pthread.dylib) + 286  [0x7fffb0295887]
          2729 _pthread_body  (in libsystem_pthread.dylib) + 180  [0x7fffb029593b]
            2729 GC_mark_thread  (in toucan) + 132  [0x10cc5e048]
              2729 GC_help_marker  (in toucan) + 46  [0x10cc58396]
                2729 GC_wait_marker  (in toucan) + 23  [0x10cc5f875]
                  2729 _pthread_cond_wait  (in libsystem_pthread.dylib) + 712  [0x7fffb02967fa]
                    2729 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fffb01aabf2]

Total number in stack (recursive counted multiple, when >=5):

Sort by top of stack, same collapsed (when >= 5):
        __psynch_cvwait  (in libsystem_kernel.dylib)        8187
        kevent  (in libsystem_kernel.dylib)        2729

Binary Images:
       0x10c886000 -        0x10cd01fff +toucan (0) <5A5EFCFE-AFC5-3F2B-82EF-E8E9F50D0657> /usr/local/bin/toucan
       0x10d1f7000 -        0x10d20ffff +libyaml-0.2.dylib (0) <D64BFABD-6330-3455-AEA3-A051EC3B4B3B> /usr/local/opt/libyaml/lib/libyaml-0.2.dylib
       0x10d219000 -        0x10d268ff3 +libssl.1.1.dylib (0) <DEAC0E01-F7A1-3054-AA76-9BDC5504FF3E> /usr/local/opt/[email protected]/lib/libssl.1.1.dylib
       0x10d296000 -        0x10d455a53 +libcrypto.1.1.dylib (0) <7AAA983D-49B4-37A5-94D5-D6870CAD4580> /usr/local/opt/[email protected]/lib/libcrypto.1.1.dylib
       0x10d4eb000 -        0x10d518ff3  libpcre.0.dylib (8) <BCEA4851-21D3-3EFD-B66F-438CC1F96AF3> /usr/lib/libpcre.0.dylib
       0x10d523000 -        0x10d550ff7 +libevent-2.1.7.dylib (0) <E8D7300E-8FE0-33C8-B9C5-DA74B3278FED> /usr/local/opt/libevent/lib/libevent-2.1.7.dylib
       0x115ceb000 -        0x115d28dc7  dyld (0.0 - ???) <322C06B7-8878-311D-888C-C8FD2CA96FF3> /usr/lib/dyld
    0x7fffaead2000 -     0x7fffaead3ffb  libSystem.B.dylib (1238.60.2) <F18AC1E7-C6F1-34B1-8069-BE571B3231D4> /usr/lib/libSystem.B.dylib
    0x7fffaec0c000 -     0x7fffaec62ff7  libc++.1.dylib (307.5) <0B43BB5D-E6EB-3464-8DE9-B41AC8ED9D1C> /usr/lib/libc++.1.dylib
    0x7fffaec63000 -     0x7fffaec8cff7  libc++abi.dylib (307.4) <BC271AD3-831B-362A-9DA7-E8C51F285FE4> /usr/lib/libc++abi.dylib
    0x7fffaf0da000 -     0x7fffaf1ccff7  libiconv.2.dylib (50) <42125B35-81D7-3FC4-9475-A26DBE10884D> /usr/lib/libiconv.2.dylib
    0x7fffaf781000 -     0x7fffafb53047  libobjc.A.dylib (709.1) <70614861-0340-32E2-85ED-FE65759CDFFA> /usr/lib/libobjc.A.dylib
    0x7fffaff80000 -     0x7fffaff91ff3  libz.1.dylib (67) <46E3FFA2-4328-327A-8D34-A03E20BFFB8E> /usr/lib/libz.1.dylib
    0x7fffaffa0000 -     0x7fffaffa4ff7  libcache.dylib (79) <093A4DAB-8385-3D47-A350-E20CB7CCF7BF> /usr/lib/system/libcache.dylib
    0x7fffaffa5000 -     0x7fffaffaffff  libcommonCrypto.dylib (60092.50.5) <8A64D1B0-C70E-385C-92F0-E669079FDA90> /usr/lib/system/libcommonCrypto.dylib
    0x7fffaffb0000 -     0x7fffaffb7fff  libcompiler_rt.dylib (62) <55D47421-772A-32AB-B529-1A46C2F43B4D> /usr/lib/system/libcompiler_rt.dylib
    0x7fffaffb8000 -     0x7fffaffc0fff  libcopyfile.dylib (138) <819BEA3C-DF11-3E3D-A1A1-5A51C5BF1961> /usr/lib/system/libcopyfile.dylib
    0x7fffaffc1000 -     0x7fffb0044fdf  libcorecrypto.dylib (442.50.19) <65D7165E-2E71-335D-A2D6-33F78E2DF0C1> /usr/lib/system/libcorecrypto.dylib
    0x7fffb0045000 -     0x7fffb0076fff  libdispatch.dylib (703.50.37) <6582BAD6-ED27-3B30-B620-90B1C5A4AE3C> /usr/lib/system/libdispatch.dylib
    0x7fffb0077000 -     0x7fffb007cffb  libdyld.dylib (433.5) <9B2AC56D-107C-3541-A127-9094A751F2C9> /usr/lib/system/libdyld.dylib
    0x7fffb007d000 -     0x7fffb007dffb  libkeymgr.dylib (28) <7AA011A9-DC21-3488-BF73-3B5B14D1FDD6> /usr/lib/system/libkeymgr.dylib
    0x7fffb008b000 -     0x7fffb008bfff  liblaunch.dylib (972.70.1) <B856ABD2-896E-3DE0-B2C8-146A6AF8E2A7> /usr/lib/system/liblaunch.dylib
    0x7fffb008c000 -     0x7fffb0091ff3  libmacho.dylib (898) <17D5D855-F6C3-3B04-B680-E9BF02EF8AED> /usr/lib/system/libmacho.dylib
    0x7fffb0092000 -     0x7fffb0094ff3  libquarantine.dylib (85.50.1) <12448CC2-378E-35F3-BE33-9DC395A5B970> /usr/lib/system/libquarantine.dylib
    0x7fffb0095000 -     0x7fffb0096ffb  libremovefile.dylib (45) <38D4CB9C-10CD-30D3-8B7B-A515EC75FE85> /usr/lib/system/libremovefile.dylib
    0x7fffb0097000 -     0x7fffb00afff7  libsystem_asl.dylib (349.50.5) <096E4228-3B7C-30A6-8B13-EC909A64499A> /usr/lib/system/libsystem_asl.dylib
    0x7fffb00b0000 -     0x7fffb00b0ff7  libsystem_blocks.dylib (67) <10DC5404-73AB-35B3-A277-A8AFECB476EB> /usr/lib/system/libsystem_blocks.dylib
    0x7fffb00b1000 -     0x7fffb013efef  libsystem_c.dylib (1158.50.2) <E5AE5244-7D0C-36AC-8BB6-C7AE7EA52A4B> /usr/lib/system/libsystem_c.dylib
    0x7fffb013f000 -     0x7fffb0142ffb  libsystem_configuration.dylib (888.60.2) <BECC01A2-CA8D-31E6-BCDF-D452965FA976> /usr/lib/system/libsystem_configuration.dylib
    0x7fffb0143000 -     0x7fffb0146fff  libsystem_coreservices.dylib (41.4) <7D26DE79-B424-3450-85E1-F7FAB32714AB> /usr/lib/system/libsystem_coreservices.dylib
    0x7fffb0147000 -     0x7fffb015ffff  libsystem_coretls.dylib (121.50.4) <EC6FCF07-DCFB-3A03-9CC9-6DD3709974C6> /usr/lib/system/libsystem_coretls.dylib
    0x7fffb0160000 -     0x7fffb0166fff  libsystem_dnssd.dylib (765.50.9) <CC960215-0B1B-3822-A13A-3DDE96FA796F> /usr/lib/system/libsystem_dnssd.dylib
    0x7fffb0167000 -     0x7fffb0190ff7  libsystem_info.dylib (503.50.4) <611DB84C-BF70-3F92-8702-B9F28A900920> /usr/lib/system/libsystem_info.dylib
    0x7fffb0191000 -     0x7fffb01b3ff7  libsystem_kernel.dylib (3789.70.16) <34B1F16C-BC9C-3C5F-9045-0CAE91CB5914> /usr/lib/system/libsystem_kernel.dylib
    0x7fffb01b4000 -     0x7fffb01fbfe7  libsystem_m.dylib (3121.6) <86D499B5-BBDC-3D3B-8A4E-97AE8E6672A4> /usr/lib/system/libsystem_m.dylib
    0x7fffb01fc000 -     0x7fffb021aff7  libsystem_malloc.dylib (116.50.8) <A3D15F17-99A6-3367-8C7E-4280E8619C95> /usr/lib/system/libsystem_malloc.dylib
    0x7fffb021b000 -     0x7fffb0274ffb  libsystem_network.dylib (856.60.1) <369D0221-56CA-3C3E-9EDE-94B41CAE77B7> /usr/lib/system/libsystem_network.dylib
    0x7fffb0275000 -     0x7fffb027eff3  libsystem_networkextension.dylib (563.60.2) <B021F2B3-8A75-3633-ABB0-FC012B8E9B0C> /usr/lib/system/libsystem_networkextension.dylib
    0x7fffb027f000 -     0x7fffb0288ff3  libsystem_notify.dylib (165.20.1) <B8160190-A069-3B3A-BDF6-2AA408221FAE> /usr/lib/system/libsystem_notify.dylib
    0x7fffb0289000 -     0x7fffb0291fe7  libsystem_platform.dylib (126.50.8) <897462FD-B318-321B-A554-E61982630F7E> /usr/lib/system/libsystem_platform.dylib
    0x7fffb0292000 -     0x7fffb029cff7  libsystem_pthread.dylib (218.60.3) <B8FB5E20-3295-39E2-B5EB-B464D1D4B104> /usr/lib/system/libsystem_pthread.dylib
    0x7fffb029d000 -     0x7fffb02a0ff7  libsystem_sandbox.dylib (592.70.1) <4B92EC49-ACD0-36AE-B07A-A2B8152EAF9D> /usr/lib/system/libsystem_sandbox.dylib
    0x7fffb02a1000 -     0x7fffb02a2ff3  libsystem_secinit.dylib (24.50.4) <F78B847B-3565-3E4B-98A6-F7AD40392E2D> /usr/lib/system/libsystem_secinit.dylib
    0x7fffb02a3000 -     0x7fffb02aaffb  libsystem_symptoms.dylib (532.50.47) <3390E07C-C1CE-348F-ADBD-2C5440B45EAA> /usr/lib/system/libsystem_symptoms.dylib
    0x7fffb02ab000 -     0x7fffb02beff7  libsystem_trace.dylib (518.70.1) <AC63A7FE-50D9-3A30-96E6-F6B7FF16E465> /usr/lib/system/libsystem_trace.dylib
    0x7fffb02bf000 -     0x7fffb02c4ffb  libunwind.dylib (35.3) <3D50D8A8-C460-334D-A519-2DA841102C6B> /usr/lib/system/libunwind.dylib
    0x7fffb02c5000 -     0x7fffb02eeff7  libxpc.dylib (972.70.1) <BF896DF0-D8E9-31A8-A4B3-01120BFEEE52> /usr/lib/system/libxpc.dylib
Sample analysis of process 81751 written to file /dev/stdout

Lsof Verbose

  • Before
User$ lsof -p 81751
COMMAND   PID USER   FD     TYPE             DEVICE  SIZE/OFF     NODE NAME
toucan  81751 User  cwd      DIR                1,1      2482   443608 /Users/User
toucan  81751 User  txt      REG                1,1   7693340  4266838 /usr/local/bin/toucan
toucan  81751 User  txt      REG                1,1    114108  5487905 /usr/local/Cellar/libyaml/0.2.2/lib/libyaml-0.2.dylib
toucan  81751 User  txt      REG                1,1    490052  9621873 /usr/local/Cellar/[email protected]/1.1.1d/lib/libssl.1.1.dylib
toucan  81751 User  txt      REG                1,1   2416296  9621870 /usr/local/Cellar/[email protected]/1.1.1d/lib/libcrypto.1.1.dylib
toucan  81751 User  txt      REG                1,1    416976   422220 /usr/lib/libpcre.0.dylib
toucan  81751 User  txt      REG                1,1    248404  9630914 /usr/local/Cellar/libevent/2.1.11_1/lib/libevent-2.1.7.dylib
toucan  81751 User  txt      REG                1,1    698896   422030 /usr/lib/dyld
toucan  81751 User  txt      REG                1,1 662274048  9591240 /private/var/db/dyld/dyld_shared_cache_x86_64h
toucan  81751 User    0u     CHR               16,5    0t4761     1155 /dev/ttys005
toucan  81751 User    1u     CHR               16,5    0t4761     1155 /dev/ttys005
toucan  81751 User    2u     CHR               16,5    0t4761     1155 /dev/ttys005
toucan  81751 User    3r     CHR               14,1   0t97824      574 /dev/urandom
toucan  81751 User    4u     CHR               16,5       0t0     1155 /dev/ttys005
toucan  81751 User    5u     CHR               16,5 0t5954173     1155 /dev/ttys005
toucan  81751 User    6u     CHR               16,5       0t0     1155 /dev/ttys005
toucan  81751 User    7     PIPE 0x59a0cae10f208a09     16384          ->0x59a0cae10f208889
toucan  81751 User    8     PIPE 0x59a0cae10f208889     16384          ->0x59a0cae10f208a09
toucan  81751 User    9w     REG                1,1    541988 15940851 /Users/User/Toucan/Logging/Relay/_HTTP/2019.12.31/19_32_00/479375.log
toucan  81751 User   10u    IPv4 0x59a0cae119292559       0t0      TCP *:dbm (LISTEN)
toucan  81751 User   11w     REG                1,1   5412185 15940853 /Users/User/Toucan/Logging/Relay/HTTPS/2019.12.31/19_32_00/6ADC51.log
toucan  81751 User   12u    IPv4 0x59a0cae118ff3041       0t0      TCP *:vat (LISTEN)
toucan  81751 User   13u  KQUEUE                                       count=0, state=0xa
toucan  81751 User   49u    IPv4 0x59a0cae11937c939       0t0      TCP localhost:vat->localhost:59136 (ESTABLISHED)
  • After
User$ lsof -p 81751
COMMAND   PID USER   FD     TYPE             DEVICE  SIZE/OFF     NODE NAME
toucan  81751 User  cwd      DIR                1,1      2482   443608 /Users/User
toucan  81751 User  txt      REG                1,1   7693340  4266838 /usr/local/bin/toucan
toucan  81751 User  txt      REG                1,1    114108  5487905 /usr/local/Cellar/libyaml/0.2.2/lib/libyaml-0.2.dylib
toucan  81751 User  txt      REG                1,1    490052  9621873 /usr/local/Cellar/[email protected]/1.1.1d/lib/libssl.1.1.dylib
toucan  81751 User  txt      REG                1,1   2416296  9621870 /usr/local/Cellar/[email protected]/1.1.1d/lib/libcrypto.1.1.dylib
toucan  81751 User  txt      REG                1,1    416976   422220 /usr/lib/libpcre.0.dylib
toucan  81751 User  txt      REG                1,1    248404  9630914 /usr/local/Cellar/libevent/2.1.11_1/lib/libevent-2.1.7.dylib
toucan  81751 User  txt      REG                1,1    698896   422030 /usr/lib/dyld
toucan  81751 User  txt      REG                1,1 662274048  9591240 /private/var/db/dyld/dyld_shared_cache_x86_64h
toucan  81751 User    0u     CHR               16,5    0t4761     1155 /dev/ttys005
toucan  81751 User    1u     CHR               16,5    0t4761     1155 /dev/ttys005
toucan  81751 User    2u     CHR               16,5    0t4761     1155 /dev/ttys005
toucan  81751 User    3r     CHR               14,1   0t97824      574 /dev/urandom
toucan  81751 User    4u     CHR               16,5       0t0     1155 /dev/ttys005
toucan  81751 User    5u     CHR               16,5 0t5954173     1155 /dev/ttys005
toucan  81751 User    6u     CHR               16,5       0t0     1155 /dev/ttys005
toucan  81751 User    7     PIPE 0x59a0cae10f208a09     16384          ->0x59a0cae10f208889
toucan  81751 User    8     PIPE 0x59a0cae10f208889     16384          ->0x59a0cae10f208a09
toucan  81751 User    9w     REG                1,1    541988 15940851 /Users/User/Toucan/Logging/Relay/_HTTP/2019.12.31/19_32_00/479375.log
toucan  81751 User   10u    IPv4 0x59a0cae119292559       0t0      TCP *:dbm (LISTEN)
toucan  81751 User   11w     REG                1,1   5412185 15940853 /Users/User/Toucan/Logging/Relay/HTTPS/2019.12.31/19_32_00/6ADC51.log
toucan  81751 User   12u    IPv4 0x59a0cae118ff3041       0t0      TCP *:vat (LISTEN)
toucan  81751 User   13u  KQUEUE                                       count=0, state=0xa
toucan  81751 User   14u    IPv4 0x59a0cae11904b231       0t0      TCP localhost:vat->localhost:59137 (CLOSED)
toucan  81751 User   15u    IPv4 0x59a0cae119665e51       0t0      TCP localhost:vat->localhost:59162 (CLOSED)
toucan  81751 User   16u    IPv4 0x59a0cae1203c1749       0t0      TCP localhost:vat->localhost:59163 (CLOSED)
toucan  81751 User   17u    IPv4 0x59a0cae1102e8231       0t0      TCP localhost:vat->localhost:59165 (CLOSED)
toucan  81751 User   18u    IPv4 0x59a0cae118b75c61       0t0      TCP localhost:vat->localhost:59197 (CLOSED)
toucan  81751 User   19u    IPv4 0x59a0cae12afc3559       0t0      TCP localhost:vat->localhost:59239 (CLOSED)
toucan  81751 User   20u    IPv4 0x59a0cae118f32939       0t0      TCP localhost:vat->localhost:59241 (CLOSED)

@636f7374
Copy link
Author

636f7374 commented Dec 31, 2019

@rdp I set some tracking tags and got some information, which is being analyzed. (I only submitted the part that appeared to be stuck).

Sorry, tags verbose is a bit messy.

:handle_client_processor_error => :handle_client_processor_exception.
HTTP::Client, :socket_ing => HTTP::Client, :tcp_socket_ing.

Tracking Tags (-Dpreview_mt)

I, [23:36:53 #85009]  INFO -- : [8C6A64] - 請求方式: GET
I, [23:36:53 #85009]  INFO -- : [8C6A64] - 請求數據: [#<URI:0x1220df120 @scheme="https", @host="...", @port=nil, @path="...", @query="...", @user=nil, @password=nil, @fragment=nil>]
[HTTP::Client, :socket_ing, 2019-12-31 15:36:53.736020000 UTC]
[HTTP::Client, :socket_tcp_finished, 2019-12-31 15:36:53.778901000 UTC]
[HTTP::Client, :socket_ssl_ing, 2019-12-31 15:36:53.778945000 UTC]
[HTTP::Client, :socket_tcp_finished, 2019-12-31 15:36:53.779636000 UTC]
[HTTP::Client, :socket_ssl_ing, 2019-12-31 15:36:53.779672000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x10672ed80 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x11b5d8000, @out_buffer=Pointer(UInt8)@0x11b5e0000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f2112e00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106a5f260, @io=#<TCPSocket:fd 87>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f6e13050), @io=#<TCPSocket:fd 87>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e30c0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1925400, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:53.779722000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x10672ed80 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x11b5d8000, @out_buffer=Pointer(UInt8)@0x11b5e0000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f2112e00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106a5f260, @io=#<TCPSocket:fd 87>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f6e13050), @io=#<TCPSocket:fd 87>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e30c0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1925400, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:53.779865000 UTC]
[HTTP::Client, :socket_ssl_finished, 2019-12-31 15:36:53.867250000 UTC]
[HTTP::Client, :socket_ing, 2019-12-31 15:36:53.867305000 UTC]
[HTTP::Client, :socket_ing, 2019-12-31 15:36:53.867344000 UTC]
[HTTP::Client, :socket_ssl_finished, 2019-12-31 15:36:53.869671000 UTC]
[HTTP::Client, :socket_ing, 2019-12-31 15:36:53.869777000 UTC]
[HTTP::Client, :socket_ing, 2019-12-31 15:36:53.869884000 UTC]
[HTTP::Client, :socket_ing, 2019-12-31 15:36:53.909851000 UTC]
I, [23:36:53 #85009]  INFO -- : [8C6A64] - 響應狀態: 200
I, [23:36:53 #85009]  INFO -- : [8C6A64] - 已接收: 43.0 Bytes
I, [23:36:53 #85009]  INFO -- : [8C6A64] - 傳輸完成: 187.49ms
[HTTP::Client, :socket_ing, 2019-12-31 15:36:53.918090000 UTC]
I, [23:36:53 #85009]  INFO -- : [6F22F6] - 響應狀態: 200
I, [23:36:53 #85009]  INFO -- : [6F22F6] - 已接收: 43.0 Bytes
I, [23:36:53 #85009]  INFO -- : [6F22F6] - 傳輸完成: 195.71ms
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x122021480 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1067fc000, @out_buffer=Pointer(UInt8)@0x122065000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f1883c00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x122182980, @io=#<TCPSocket:fd 106>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f5a494e0), @io=#<TCPSocket:fd 106>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1221a16f0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f0909800, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:53.995291000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x122021480 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1067fc000, @out_buffer=Pointer(UInt8)@0x122065000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f1883c00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x122182980, @io=#<TCPSocket:fd 106>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f5a494e0), @io=#<TCPSocket:fd 106>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1221a16f0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f0909800, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:53.995651000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x122021180 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x11b620000, @out_buffer=Pointer(UInt8)@0x12210b000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f0816800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106a87130, @io=#<TCPSocket:fd 85>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f2ef9a20), @io=#<TCPSocket:fd 85>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1221a1480 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f100a200, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.000150000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x122021180 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x11b620000, @out_buffer=Pointer(UInt8)@0x12210b000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f0816800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106a87130, @io=#<TCPSocket:fd 85>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f2ef9a20), @io=#<TCPSocket:fd 85>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1221a1480 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f100a200, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.000276000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x122071780 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x122132000, @out_buffer=Pointer(UInt8)@0x11b712000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f18eae00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x1066c9980, @io=#<TCPSocket:fd 112>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f600e320), @io=#<TCPSocket:fd 112>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106aca2a0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1006e00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.040797000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x122071780 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x122132000, @out_buffer=Pointer(UInt8)@0x11b712000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f18eae00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x1066c9980, @io=#<TCPSocket:fd 112>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f600e320), @io=#<TCPSocket:fd 112>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106aca2a0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1006e00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.040957000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x122071840 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x12215c000, @out_buffer=Pointer(UInt8)@0x11b6bc000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f1881c00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106a87850, @io=#<TCPSocket:fd 77>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f6290c10), @io=#<TCPSocket:fd 77>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106aca390 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f10dd800, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.060617000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x122071840 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x12215c000, @out_buffer=Pointer(UInt8)@0x11b6bc000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f1881c00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106a87850, @io=#<TCPSocket:fd 77>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f6290c10), @io=#<TCPSocket:fd 77>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106aca390 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f10dd800, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.060983000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x11b6016c0 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x10688e000, @out_buffer=Pointer(UInt8)@0x1220ca000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f1874600, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x1066355f0, @io=#<TCPSocket:fd 140>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f3f788f0), @io=#<TCPSocket:fd 140>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e3de0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2103600, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.075675000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x11b6016c0 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x10688e000, @out_buffer=Pointer(UInt8)@0x1220ca000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f1874600, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x1066355f0, @io=#<TCPSocket:fd 140>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f3f788f0), @io=#<TCPSocket:fd 140>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e3de0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2103600, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.076161000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x11b602000 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1221c7000, @out_buffer=Pointer(UInt8)@0x106958000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f10a3800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106872be0, @io=#<TCPSocket:fd 56>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f5cc29a0), @io=#<TCPSocket:fd 56>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1221a17b0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f10bd000, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.095860000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x11b602000 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1221c7000, @out_buffer=Pointer(UInt8)@0x106958000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f10a3800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106872be0, @io=#<TCPSocket:fd 56>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f5cc29a0), @io=#<TCPSocket:fd 56>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1221a17b0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f10bd000, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.096236000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x10672ec00 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106a15000, @out_buffer=Pointer(UInt8)@0x1067c2000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f214c000, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106a87be0, @io=#<TCPSocket:fd 145>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f6ece0f0), @io=#<TCPSocket:fd 145>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106acaf30 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1940c00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.114810000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x10672ec00 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106a15000, @out_buffer=Pointer(UInt8)@0x1067c2000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f214c000, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106a87be0, @io=#<TCPSocket:fd 145>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f6ece0f0), @io=#<TCPSocket:fd 145>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106acaf30 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1940c00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.115290000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x1068dae40 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106b18000, @out_buffer=Pointer(UInt8)@0x1220f2000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f20f4a00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x11b6fd130, @io=#<TCPSocket:fd 40>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f05cea90), @io=#<TCPSocket:fd 40>, @context=#<OpenSSL::SSL::SuperContext::Server:0x12211fc00 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1825400, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.188972000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x1068dae40 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106b18000, @out_buffer=Pointer(UInt8)@0x1220f2000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f20f4a00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x11b6fd130, @io=#<TCPSocket:fd 40>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f05cea90), @io=#<TCPSocket:fd 40>, @context=#<OpenSSL::SSL::SuperContext::Server:0x12211fc00 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1825400, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.189330000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x104d7b000 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x10686d000, @out_buffer=Pointer(UInt8)@0x106746000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f184dc00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d92980, @io=#<TCPSocket:fd 54>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f3665d70), @io=#<TCPSocket:fd 54>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106700600 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f0832e00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.278732000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x104d7b000 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x10686d000, @out_buffer=Pointer(UInt8)@0x106746000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f184dc00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d92980, @io=#<TCPSocket:fd 54>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f3665d70), @io=#<TCPSocket:fd 54>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106700600 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f0832e00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.279217000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x103514cc0 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1066f4000, @out_buffer=Pointer(UInt8)@0x10673a000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f2072000, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d92720, @io=#<TCPSocket:fd 61>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f3e86bf0), @io=#<TCPSocket:fd 61>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1067004e0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f184a800, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.406025000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x103514cc0 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1066f4000, @out_buffer=Pointer(UInt8)@0x10673a000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f2072000, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d92720, @io=#<TCPSocket:fd 61>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f3e86bf0), @io=#<TCPSocket:fd 61>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1067004e0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f184a800, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.406526000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x104d7b300 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0[, @sync=HTTP::Serverfalse, ,: @read_buffering=true,handle_client_processor_error @buffer_size=, #<OpenSSL::SSL::SuperSocket::Server:0x11b601480 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=8192Bytes[,] @in_buffer=,Pointer( @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106783000, @out_buffer=Pointer(UInt8)@0x106a4c000, @out_buffer=Pointer(UInt8)@0x106898000, @sync_close=true, @closed=true, @ssl=Pointer(UInt8)@0x121fdf000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f206ee00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x7fe0f20f1a00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104dc2130, @io=Void)@0x1034f4980, @io=#<TCPSocket:fd 108>, @bio=Pointer(#<TCPSocket:fd 64>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f5c118b0), @io=#<TCPSocket:fd 108>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106ab5f00 @alpn_protocol=nil, @handle=Pointer(LibCrypto::Bio)@0x7fe0f40816c0), @io=Void)@0x7fe0f186d000, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36#<TCPSocket:fd 64>:,54 @context=.#<422131000OpenSSL::SSL::SuperContext::Server:0x UTC]106700870
 @alpn_protocol=nil,[ @handle=HTTP::ServerPointer(, :Void)@0xhandle_client_processor_free7fe0f2067a00, ,#< @freed=OpenSSL::SSL::SuperSocket::Servernil:0x>11b601480, @sync_context_free= @encoding=truenil,, @freed= @encoder=falsenil,, @skip_free= @decoder=nilnil,> @in_buffer_rem=, Bytes[], @out_count=20190,- @sync=false12,- @read_buffering=true31,  @buffer_size=158192:,36 @in_buffer=:Pointer(54UInt8.)@0x422059000106a4c000 UTC,] @out_buffer=Pointer(
UInt8)[@0xHTTP::Server121fdf000, ,: @sync_close=true,handle_client_processor_free @closed=, true#<,OpenSSL::SSL::SuperSocket::Server @ssl=:0xPointer(104d7b300Void) @encoding=@0xnil7fe0f20f1a00,, @encoder= @bio=nilOpenSSL::BIO,( @decoder=@boxed_io=nilPointer(,Void @in_buffer_rem=)Bytes[@0x]1034f4980,,  @out_count=@io=0,#<TCPSocket:fd 108> @sync=, false@bio=,Pointer( @read_buffering=LibCrypto::Biotrue),@0x @buffer_size=7fe0f5c118b08192),, @in_buffer= @io=Pointer(#<TCPSocket:fd 108>UInt8,) @context=@0x#<106783000OpenSSL::SSL::SuperContext::Server,:0x @out_buffer=106ab5f00Pointer( @alpn_protocol=UInt8nil),@0x @handle=Pointer(106898000Void,) @sync_close=@0xtrue7fe0f186d000,, @closed= @freed=truenil, @ssl=Pointer(>Void,) @sync_context_free=@0xtrue7fe0f206ee00,, @freed= @bio=falseOpenSSL::BIO,( @skip_free=@boxed_io=nilPointer(>Void, )@0x2019104dc2130-, 12@io=-31#<TCPSocket:fd 64> , @bio=15Pointer(:LibCrypto::Bio36):@0x547fe0f40816c0.)423481000, UTC @io=]#<TCPSocket:fd 64>
, @context=#<OpenSSL::SSL::SuperContext::Server:0x106700870 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2067a00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.423635000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x11b602600 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106ad4000, @out_buffer=Pointer(UInt8)@0x11b5e6000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f189c800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x11b6fd850, @io=#<TCPSocket:fd 67>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f4baf240), @io=#<TCPSocket:fd 67>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e3930 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1080400, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.483758000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x11b602600 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106ad4000, @out_buffer=Pointer(UInt8)@0x11b5e6000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f189c800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x11b6fd850, @io=#<TCPSocket:fd 67>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f4baf240), @io=#<TCPSocket:fd 67>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e3930 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1080400, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.484204000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x11b602300 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x10664f000, @out_buffer=Pointer(UInt8)@0x1069bc000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f207ee00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106a5fab0, @io=#<TCPSocket:fd 66>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f052a660), @io=#<TCPSocket:fd 66>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1221a1930 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f087e200, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.676876000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x11b602300 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x10664f000, @out_buffer=Pointer(UInt8)@0x1069bc000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f207ee00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106a5fab0, @io=#<TCPSocket:fd 66>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f052a660), @io=#<TCPSocket:fd 66>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1221a1930 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f087e200, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.677328000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x122021300 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106967000, @out_buffer=Pointer(UInt8)@0x1220b8000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f0869e00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106a5f5f0, @io=#<TCPSocket:fd 130>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f45a5260), @io=#<TCPSocket:fd 130>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e34b0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1936c00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.695580000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x122021300 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106967000, @out_buffer=Pointer(UInt8)@0x1220b8000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f0869e00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106a5f5f0, @io=#<TCPSocket:fd 130>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f45a5260), @io=#<TCPSocket:fd 130>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e34b0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1936c00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.696089000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x1035149c0 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1068d4000, @out_buffer=Pointer(UInt8)@0x10678a000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f1859200, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d925f0, @io=#<TCPSocket:fd 69>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f37d77c0), @io=#<TCPSocket:fd 69>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1067003c0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2043600, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.790036000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x1035149c0 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1068d4000, @out_buffer=Pointer(UInt8)@0x10678a000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f1859200, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d925f0, @io=#<TCPSocket:fd 69>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f37d77c0), @io=#<TCPSocket:fd 69>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1067003c0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2043600, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.790557000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x122075000 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106937000, @out_buffer=Pointer(UInt8)@0x1069b6000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f107da00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106a5f850, @io=#<TCPSocket:fd 70>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f58688d0), @io=#<TCPSocket:fd 70>, @context=#<OpenSSL::SSL::SuperContext::Server:0x11b7083c0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1855c00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.841201000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x122075000 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106937000, @out_buffer=Pointer(UInt8)@0x1069b6000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f107da00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106a5f850, @io=#<TCPSocket:fd 70>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f58688d0), @io=#<TCPSocket:fd 70>, @context=#<OpenSSL::SSL::SuperContext::Server:0x11b7083c0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1855c00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.841627000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x122021d80 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x121fed000, @out_buffer=Pointer(UInt8)@0x106b0e000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f0916800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x11b6fde40, @io=#<TCPSocket:fd 97>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f4adaed0), @io=#<TCPSocket:fd 97>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e3f30 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2055400, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.989997000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x122021d80 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x121fed000, @out_buffer=Pointer(UInt8)@0x106b0e000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f0916800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x11b6fde40, @io=#<TCPSocket:fd 97>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f4adaed0), @io=#<TCPSocket:fd 97>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e3f30 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2055400, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:54.990608000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x1035249c0 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106a46000, @out_buffer=Pointer(UInt8)@0x10661e000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f18a0000, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106765980, @io=#<TCPSocket:fd 102>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f447eae0), @io=#<TCPSocket:fd 102>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106851690 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2083a00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:55.174979000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x1035249c0 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106a46000, @out_buffer=Pointer(UInt8)@0x10661e000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f18a0000, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106765980, @io=#<TCPSocket:fd 102>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f447eae0), @io=#<TCPSocket:fd 102>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106851690 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2083a00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:55.175523000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x103514600 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106672000, @out_buffer=Pointer(UInt8)@0x1066d4000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f0835e00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d7c000, @io=#<TCPSocket:fd 43>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f2e10260), @io=#<TCPSocket:fd 43>, @context=#<OpenSSL::SSL::SuperContext::Server:0x104dd2a50 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2028e00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:55.209933000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x103514600 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106672000, @out_buffer=Pointer(UInt8)@0x1066d4000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f0835e00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d7c000, @io=#<TCPSocket:fd 43>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f2e10260), @io=#<TCPSocket:fd 43>, @context=#<OpenSSL::SSL::SuperContext::Server:0x104dd2a50 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2028e00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:55.210404000 UTC]
I, [23:36:55 #85009]  INFO -- : [7CC7B3] - 傳輸完成: 31.12s
[HTTP::Server, :handle_client_processor_finished, #<OpenSSL::SSL::SuperSocket::Server:0x104d7b6c0 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x103521000, @out_buffer=Pointer(UInt8)@0x106885000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f2049800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104dc2720, @io=#<TCPSocket:fd 60>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f3c0c340), @io=#<TCPSocket:fd 60>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106700c90 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f183ae00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:55.293546000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x104d7b6c0 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x103521000, @out_buffer=Pointer(UInt8)@0x106885000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f2049800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104dc2720, @io=#<TCPSocket:fd 60>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f3c0c340), @io=#<TCPSocket:fd 60>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106700c90 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f183ae00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:55.293680000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x104d7b900 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x10672b000, @out_buffer=Pointer(UInt8)@0x106843000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f2057a00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104dc2be0, @io=#<TCPSocket:fd 47>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f29db890), @io=#<TCPSocket:fd 47>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106700e40 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2043e00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:56.136583000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x104d7b900 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x10672b000, @out_buffer=Pointer(UInt8)@0x106843000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f2057a00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104dc2be0, @io=#<TCPSocket:fd 47>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f29db890), @io=#<TCPSocket:fd 47>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106700e40 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2043e00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:56.137017000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x103514000 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1066ea000, @out_buffer=Pointer(UInt8)@0x10671f000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f1825800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d99d10, @io=#<TCPSocket:fd 42>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f2fe1720), @io=#<TCPSocket:fd 42>, @context=#<OpenSSL::SSL::SuperContext::Server:0x104dd2540 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f0842c00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:58.640421000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x103514000 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1066ea000, @out_buffer=Pointer(UInt8)@0x10671f000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f1825800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d99d10, @io=#<TCPSocket:fd 42>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f2fe1720), @io=#<TCPSocket:fd 42>, @context=#<OpenSSL::SSL::SuperContext::Server:0x104dd2540 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f0842c00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:58.640610000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x104d7bc00 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x10671c000, @out_buffer=Pointer(UInt8)@0x106846000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f105ac00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d99ab0, @io=#<TCPSocket:fd 46>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f3514e50), @io=#<TCPSocket:fd 46>, @context=#<OpenSSL::SSL::SuperContext::Server:0x104dd2150 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f182da00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:58.701714000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x104d7bc00 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x10671c000, @out_buffer=Pointer(UInt8)@0x106846000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f105ac00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d99ab0, @io=#<TCPSocket:fd 46>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f3514e50), @io=#<TCPSocket:fd 46>, @context=#<OpenSSL::SSL::SuperContext::Server:0x104dd2150 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f182da00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:58.702146000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x103514240 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106712000, @out_buffer=Pointer(UInt8)@0x1066df000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f2034e00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d93980, @io=#<TCPSocket:fd 51>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f32bbdc0), @io=#<TCPSocket:fd 51>, @context=#<OpenSSL::SSL::SuperContext::Server:0x104dd2750 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2030200, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:58.757625000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x103514240 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106712000, @out_buffer=Pointer(UInt8)@0x1066df000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f2034e00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d93980, @io=#<TCPSocket:fd 51>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f32bbdc0), @io=#<TCPSocket:fd 51>, @context=#<OpenSSL::SSL::SuperContext::Server:0x104dd2750 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2030200, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:58.757764000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x104d7ba80 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106722000, @out_buffer=Pointer(UInt8)@0x106762000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f0855400, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d99850, @io=#<TCPSocket:fd 50>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f2e7b860), @io=#<TCPSocket:fd 50>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106700f00 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f0833200, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:58.846195000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x104d7ba80 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106722000, @out_buffer=Pointer(UInt8)@0x106762000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f0855400, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d99850, @io=#<TCPSocket:fd 50>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f2e7b860), @io=#<TCPSocket:fd 50>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106700f00 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f0833200, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:58.846339000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x103514540 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x10667b000, @out_buffer=Pointer(UInt8)@0x1066ee000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f102b800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d99130, @io=#<TCPSocket:fd 44>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f2b68350), @io=#<TCPSocket:fd 44>, @context=#<OpenSSL::SSL::SuperContext::Server:0x104dd29c0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1016800, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:58.974505000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x103514540 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x10667b000, @out_buffer=Pointer(UInt8)@0x1066ee000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f102b800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d99130, @io=#<TCPSocket:fd 44>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f2b68350), @io=#<TCPSocket:fd 44>, @context=#<OpenSSL::SSL::SuperContext::Server:0x104dd29c0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1016800, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:58.974876000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x10672ea80 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106797000, @out_buffer=Pointer(UInt8)@0x11b58e000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f08f9800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d995f0, @io=#<TCPSocket:fd 115>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f5b3e870), @io=#<TCPSocket:fd 115>, @context=#<OpenSSL::SSL::SuperContext::Server:0x104dd2db0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f107a000, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:59.002238000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x10672ea80 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106797000, @out_buffer=Pointer(UInt8)@0x11b58e000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f08f9800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d995f0, @io=#<TCPSocket:fd 115>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f5b3e870), @io=#<TCPSocket:fd 115>, @context=#<OpenSSL::SSL::SuperContext::Server:0x104dd2db0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f107a000, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:36:59.002596000 UTC]
hangs[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x1035140c0 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1066ce000, @out_buffer=Pointer(UInt8)@0x106702000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f0839a00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d93850, @io=#<TCPSocket:fd 52>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f2e5a1d0), @io=#<TCPSocket:fd 52>, @context=#<OpenSSL::SSL::SuperContext::Server:0x104dd2690 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f102d200, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:37:05.201165000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x1035140c0 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1066ce000, @out_buffer=Pointer(UInt8)@0x106702000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f0839a00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x104d93850, @io=#<TCPSocket:fd 52>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f2e5a1d0), @io=#<TCPSocket:fd 52>, @context=#<OpenSSL::SSL::SuperContext::Server:0x104dd2690 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f102d200, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:37:05.201542000 UTC]
^R
3244324332443234242334hangh[HTTP::Client, :socket_tcp_finished, 2019-12-31 15:37:07.362813000 UTC]
[HTTP::Client, :socket_ssl_ing, 2019-12-31 15:37:07.362925000 UTC]
[HTTP::Client, :socket_ssl_finished, 2019-12-31 15:37:07.473948000 UTC]
[HTTP::Client, :socket_ing, 2019-12-31 15:37:07.474069000 UTC]
[HTTP::Client, :socket_ing, 2019-12-31 15:37:07.474178000 UTC]
[HTTP::Client, :socket_ing, 2019-12-31 15:37:07.527154000 UTC]
I, [23:37:07 #85009]  INFO -- : [67B60A] - 響應狀態: 200
I, [23:37:07 #85009]  INFO -- : [67B60A] - 已接收: 28.193 KiloBytes
I, [23:37:07 #85009]  INFO -- : [67B60A] - 傳輸完成: 19.57s
[HTTP::Server, :handle_client_processor_finished, #<OpenSSL::SSL::SuperSocket::Server:0x11b602c00 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1069eb000, @out_buffer=Pointer(UInt8)@0x106ade000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f086ea00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x121ffd000, @io=#<TCPSocket:fd 99>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f6da5ae0), @io=#<TCPSocket:fd 99>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e3510 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f10d8000, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:37:07.685942000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x11b602c00 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1069eb000, @out_buffer=Pointer(UInt8)@0x106ade000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f086ea00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x121ffd000, @io=#<TCPSocket:fd 99>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f6da5ae0), @io=#<TCPSocket:fd 99>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e3510 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f10d8000, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:37:07.686302000 UTC]
hangs
!
hangs
hangs
hangs
[HTTP::Client, :socket_tcp_finished, 2019-12-31 15:37:18.354998000 UTC]
[HTTP::Client, :socket_ssl_ing, 2019-12-31 15:37:18.355096000 UTC]
[HTTP::Client, :socket_ssl_finished, 2019-12-31 15:37:18.431590000 UTC]
[HTTP::Client, :socket_ing, 2019-12-31 15:37:18.431711000 UTC]
[HTTP::Client, :socket_ing, 2019-12-31 15:37:18.431822000 UTC]
[HTTP::Client, :socket_ing, 2019-12-31 15:37:18.506112000 UTC]
I, [23:37:18 #85009]  INFO -- : [959366] - 響應狀態: 200
I, [23:37:18 #85009]  INFO -- : [959366] - 已接收: 51.006 KiloBytes
I, [23:37:18 #85009]  INFO -- : [959366] - 傳輸完成: 30.24s
[HTTP::Server, :handle_client_processor_finished, #<OpenSSL::SSL::SuperSocket::Server:0x11b602e40 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1069b3000, @out_buffer=Pointer(UInt8)@0x106926000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f20bd600, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x121ffdbe0, @io=#<TCPSocket:fd 96>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f6037c60), @io=#<TCPSocket:fd 96>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e35d0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f0866e00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:37:18.547964000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x11b602e40 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1069b3000, @out_buffer=Pointer(UInt8)@0x106926000, @sync_close=true, @closed=true, @ssl=Pointer(Void)@0x7fe0f20bd600, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x121ffdbe0, @io=#<TCPSocket:fd 96>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f6037c60), @io=#<TCPSocket:fd 96>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e35d0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f0866e00, @freed=nil>, @sync_context_free=true, @freed=false, @skip_free=nil>, 2019-12-31 15:37:18.548101000 UTC]
W, [23:37:18 #85009]  WARN -- : [7CC7B3] - 下行傳輸中斷: 54.38s
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x10672e3c0 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1067de000, @out_buffer=Pointer(UInt8)@0x11b5fb000, @sync_close=true, @closed=false, @ssl=Pointer(Void)@0x7fe0f1085e00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x1066c9000, @io=#<TCPSocket:fd 72>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f4352170), @io=#<TCPSocket:fd 72>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106851e40 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1072a00, @freed=true>, @sync_context_free=true, @freed=true, @skip_free=nil>, 2019-12-31 15:37:19.965975000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x10672e3c0 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1067de000, @out_buffer=Pointer(UInt8)@0x11b5fb000, @sync_close=true, @closed=false, @ssl=Pointer(Void)@0x7fe0f1085e00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x1066c9000, @io=#<TCPSocket:fd 72>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f4352170), @io=#<TCPSocket:fd 72>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106851e40 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1072a00, @freed=true>, @sync_context_free=true, @freed=true, @skip_free=nil>, 2019-12-31 15:37:19.966123000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x11b601600 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106652000, @out_buffer=Pointer(UInt8)@0x104dc4000, @sync_close=true, @closed=false, @ssl=Pointer(Void)@0x7fe0f0812800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x121ffd390, @io=#<TCPSocket:fd 94>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f5015b20), @io=#<TCPSocket:fd 94>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e3c00 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2062200, @freed=true>, @sync_context_free=true, @freed=true, @skip_free=nil>, 2019-12-31 15:37:19.972783000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x11b601600 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106652000, @out_buffer=Pointer(UInt8)@0x104dc4000, @sync_close=true, @closed=false, @ssl=Pointer(Void)@0x7fe0f0812800, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x121ffd390, @io=#<TCPSocket:fd 94>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f5015b20), @io=#<TCPSocket:fd 94>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1220e3c00 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f2062200, @freed=true>, @sync_context_free=true, @freed=true, @skip_free=nil>, 2019-12-31 15:37:19[.973002000HTTP::Server UTC, ]:
handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x106ae5a80 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x10673e000, @out_buffer=Pointer(UInt8)@0x106970000, @sync_close=true, @closed=false, @ssl=Pointer(Void)@0x7fe0f1891400, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x1066c95f0, @io=#<TCPSocket:fd 25>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f42969a0), @io=#<TCPSocket:fd 25>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106851000 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1890400, @freed=true>, @sync_context_free=true, @freed=true, @skip_free=nil>, 2019-12-31 15:37:19.973150000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x106ae5a80 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x10673e000, @out_buffer=Pointer(UInt8)@0x106970000, @sync_close=true, @closed=false, @ssl=Pointer(Void)@0x7fe0f1891400, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x1066c95f0, @io=#<TCPSocket:fd 25>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f42969a0), @io=#<TCPSocket:fd 25>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106851000 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f1890400, @freed=true>, @sync_context_free=true, @freed=true, @skip_free=nil>, 2019-12-31 15:37:19.973291000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x122075240 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1221cd000, @out_buffer=Pointer(UInt8)@0x122111000, @sync_close=true, @closed=false, @ssl=Pointer(Void)@0x7fe0f1862600, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106635980, @io=#<TCPSocket:fd 142>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f3705df0), @io=#<TCPSocket:fd 142>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1221a12a0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f100a600, @freed=true>, @sync_context_free=true, @freed=true, @skip_free=nil>, 2019-12-31 15:37:19.978718000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x122075240 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x1221cd000, @out_buffer=Pointer(UInt8)@0x122111000, @sync_close=true, @closed=false, @ssl=Pointer(Void)@0x7fe0f1862600, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106635980, @io=#<TCPSocket:fd 142>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f3705df0), @io=#<TCPSocket:fd 142>, @context=#<OpenSSL::SSL::SuperContext::Server:0x1221a12a0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f100a600, @freed=true>, @sync_context_free=true, @freed=true, @skip_free=nil>, 2019-12-31 15:37:19.978862000 UTC]
[HTTP::Server, :handle_client_processor_error, #<OpenSSL::SSL::SuperSocket::Server:0x103524e40 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106835000, @out_buffer=Pointer(UInt8)@0x106ae1000, @sync_close=true, @closed=false, @ssl=Pointer(Void)@0x7fe0f1077a00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106872000, @io=#<TCPSocket:fd 91>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f54a7550), @io=#<TCPSocket:fd 91>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106851ae0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f102a200, @freed=true>, @sync_context_free=true, @freed=true, @skip_free=nil>, 2019-12-31 15:37:19.981490000 UTC]
[HTTP::Server, :handle_client_processor_free, #<OpenSSL::SSL::SuperSocket::Server:0x103524e40 @encoding=nil, @encoder=nil, @decoder=nil, @in_buffer_rem=Bytes[], @out_count=0, @sync=false, @read_buffering=true, @buffer_size=8192, @in_buffer=Pointer(UInt8)@0x106835000, @out_buffer=Pointer(UInt8)@0x106ae1000, @sync_close=true, @closed=false, @ssl=Pointer(Void)@0x7fe0f1077a00, @bio=OpenSSL::BIO(@boxed_io=Pointer(Void)@0x106872000, @io=#<TCPSocket:fd 91>, @bio=Pointer(LibCrypto::Bio)@0x7fe0f54a7550), @io=#<TCPSocket:fd 91>, @context=#<OpenSSL::SSL::SuperContext::Server:0x106851ae0 @alpn_protocol=nil, @handle=Pointer(Void)@0x7fe0f102a200, @freed=true>, @sync_context_free=true, @freed=true, @skip_free=nil>, 2019-12-31 15:37:19.981654000 UTC]
hangs
hangs12
(killed tunnel with mitm task)
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:38.919671000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 155>, 2019-12-31 15:37:38.921788000 UTC]
[OpenSSL::SSL::SuperServer, :"accept?", #<TCPSocket:fd 26>, 2019-12-31 15:37:38.921864000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket, #<TCPSocket:fd 26>, 2019-12-31 15:37:38.929077000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :super, 2019-12-31 15:37:38.929113000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, 2019-12-31 15:37:38.929137000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, 2019-12-31 15:37:38.929164000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, 2019-12-31 15:37:38.929188000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:38.961220000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 26>, 2019-12-31 15:37:38.962452000 UTC]
[OpenSSL::SSL::SuperServer, :"accept?", #<TCPSocket:fd 26>, 2019-12-31 15:37:38.962506000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket, #<TCPSocket:fd 26>, 2019-12-31 15:37:38.970370000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :super, 2019-12-31 15:37:38.970421000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, 2019-12-31 15:37:38.970444000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, 2019-12-31 15:37:38.970473000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, 2019-12-31 15:37:38.970498000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:39.003923000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.005222000 UTC]
[OpenSSL::SSL::SuperServer, :"accept?", #<TCPSocket:fd 26>, 2019-12-31 15:37:39.005290000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.012535000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :super, 2019-12-31 15:37:39.012571000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, 2019-12-31 15:37:39.012594000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, 2019-12-31 15:37:39.012622000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, 2019-12-31 15:37:39.012647000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:39.046492000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.047731000 UTC]
[OpenSSL::SSL::SuperServer, :"accept?", #<TCPSocket:fd 26>, 2019-12-31 15:37:39.047784000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.055214000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :super, 2019-12-31 15:37:39.055264000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, 2019-12-31 15:37:39.055289000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, 2019-12-31 15:37:39.055318000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, 2019-12-31 15:37:39.055344000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:39.087271000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.088497000 UTC]
[OpenSSL::SSL::SuperServer, :"accept?", #<TCPSocket:fd 26>, 2019-12-31 15:37:39.088552000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.095746000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :super, 2019-12-31 15:37:39.095781000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, 2019-12-31 15:37:39.095804000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, 2019-12-31 15:37:39.095832000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, 2019-12-31 15:37:39.095857000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:39.127803000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.129030000 UTC]
[OpenSSL::SSL::SuperServer, :"accept?", #<TCPSocket:fd 26>, 2019-12-31 15:37:39.129083000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.136468000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :super, 2019-12-31 15:37:39.136517000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, 2019-12-31 15:37:39.136541000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, 2019-12-31 15:37:39.136569000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, 2019-12-31 15:37:39.136593000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:39.168405000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.169633000 UTC]
[OpenSSL::SSL::SuperServer, :"accept?", #<TCPSocket:fd 26>, 2019-12-31 15:37:39.169685000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.176894000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :super, 2019-12-31 15:37:39.176929000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, 2019-12-31 15:37:39.176952000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, 2019-12-31 15:37:39.176979000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, 2019-12-31 15:37:39.177004000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:39.210587000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.211810000 UTC]
[OpenSSL::SSL::SuperServer, :"accept?", #<TCPSocket:fd 26>, 2019-12-31 15:37:39.211863000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.219230000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :super, 2019-12-31 15:37:39.219280000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, 2019-12-31 15:37:39.219303000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, 2019-12-31 15:37:39.219331000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, 2019-12-31 15:37:39.219355000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:39.251178000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.252402000 UTC]
[OpenSSL::SSL::SuperServer, :"accept?", #<TCPSocket:fd 26>, 2019-12-31 15:37:39.252454000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.259677000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :super, 2019-12-31 15:37:39.259710000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, 2019-12-31 15:37:39.259734000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, 2019-12-31 15:37:39.259761000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, 2019-12-31 15:37:39.259785000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:39.291714000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.292945000 UTC]
[OpenSSL::SSL::SuperServer, :"accept?", #<TCPSocket:fd 26>, 2019-12-31 15:37:39.292997000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.300416000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :super, 2019-12-31 15:37:39.300507000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, 2019-12-31 15:37:39.300539000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, 2019-12-31 15:37:39.300568000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, 2019-12-31 15:37:39.300653000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:39.334229000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.335453000 UTC]
[OpenSSL::SSL::SuperServer, :"accept?", #<TCPSocket:fd 26>, 2019-12-31 15:37:39.335507000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.342732000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :super, 2019-12-31 15:37:39.342767000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, 2019-12-31 15:37:39.342789000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, 2019-12-31 15:37:39.342816000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, 2019-12-31 15:37:39.342842000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:39.375091000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.376314000 UTC]
[OpenSSL::SSL::SuperServer, :"accept?", #<TCPSocket:fd 26>, 2019-12-31 15:37:39.376366000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.383588000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :super, 2019-12-31 15:37:39.383622000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, 2019-12-31 15:37:39.383644000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, 2019-12-31 15:37:39.383672000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, 2019-12-31 15:37:39.383696000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:39.417318000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.418642000 UTC]
[OpenSSL::SSL::SuperServer, :"accept?", #<TCPSocket:fd 26>, 2019-12-31 15:37:39.418710000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.425978000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :super, 2019-12-31 15:37:39.426020000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, 2019-12-31 15:37:39.426044000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, 2019-12-31 15:37:39.426073000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, 2019-12-31 15:37:39.426099000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:39.457938000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.459159000 UTC]
[OpenSSL::SSL::SuperServer, :"accept?", #<TCPSocket:fd 26>, 2019-12-31 15:37:39.459213000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.466417000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :super, 2019-12-31 15:37:39.466452000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, 2019-12-31 15:37:39.466474000 UTC]
[OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, 2019-12-31 15:37:39.466502000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, 2019-12-31 15:37:39.466526000 UTC]
[OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, 2019-12-31 15:37:39.498384000 UTC]
[OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, #<TCPSocket:fd 26>, 2019-12-31 15:37:39.499628000 UTC]

Source Code

  • SuperServer
  # Implements `::Socket::Server#accept?`.
  #
  # This method calls `@wrapped.accept?` and wraps the resulting IO in a SSL socket (`OpenSSL::SSL::Socket::Server`) with `context` configuration.
  def accept? : OpenSSL::SSL::SuperSocket::Server?
    if socket = @wrapped.accept?
      STDIN.puts [OpenSSL::SSL::SuperServer, :accept?, socket, Time.utc]

      context = OpenSSL::SSL::SuperContext::Server.new
      context.set_ca_certificate_text certificate, sync_free: true
      context.set_private_key_text privateKey, sync_free: true

      begin
        STDIN.puts [OpenSSL::SSL::SuperServer, :accept_assign_socket, socket, Time.utc]

        server = OpenSSL::SSL::SuperSocket::Server.new socket, context, sync_context_free: true
        STDIN.puts [OpenSSL::SSL::SuperServer, :accept_assign_finished, socket, Time.utc]
        server
      rescue ex
        STDIN.puts [OpenSSL::SSL::SuperServer, :accept_assign_socket_failed, socket, Time.utc]

        socket.close
        raise ex
      end
    end
  end
  • SuperSocket::Server
  class Server < SuperSocket
    def initialize(io, context : SuperContext::Server = SuperContext::Server.new, sync_context_free : Bool = true)
      STDIN.puts [OpenSSL::SSL::SuperSocket::Server, :super, Time.utc]

      super io, context, sync_context_free, true

      begin
        STDIN.puts [OpenSSL::SSL::SuperSocket::Server, :ssl_accept_ing, Time.utc]

        ret = LibSSL.ssl_accept @ssl

        STDIN.puts [OpenSSL::SSL::SuperSocket::Server, :ssl_accept_failed, Time.utc] unless ret == 1_i32

        raise OpenSSL::SSL::Error.new @ssl, ret, "SSL_accept" unless ret == 1_i32
      rescue ex
        sync_context_free ? all_free : free
        raise ex
      end
    end
  end
  • SuperSocket
  protected def initialize(@io, @context : SuperContext, @sync_context_free : Bool = true, debug = false)
    @sync_close = true
    @freed = false
    @closed = false

    begin
      STDIN.puts [OpenSSL::SSL::SuperSocket, :initialize_ssl_new_failed_1, Time.utc] if context.freed? if debug
      raise OpenSSL::Error.new "SSL_new" if context.freed?
    rescue ex
      raise ex
    end

    STDIN.puts [OpenSSL::SSL::SuperSocket, :initialize_ssl_new_ing, Time.utc] if debug

    @ssl = LibSSL.ssl_new context

    begin
      STDIN.puts [OpenSSL::SSL::SuperSocket, :initialize_ssl_new_failed_2, Time.utc] unless @ssl if debug

      raise OpenSSL::Error.new "SSL_new" unless @ssl
    rescue ex
      sync_context_free ? all_free : free
      raise ex
    end

    STDIN.puts [OpenSSL::SSL::SuperSocket, :initialize_ssl_new_finished, Time.utc] if debug

    # Since OpenSSL::SSL::Socket is buffered it makes no
    # sense to wrap a IO::Buffered with buffering activated.
    if io.is_a? IO::Buffered
      io.sync = true
      io.read_buffering = false
    end

    @bio = BIO.new io
    LibSSL.ssl_set_bio @ssl, @bio, @bio
  end
  • HTTP::Server
  private def accept!(server : Socket::Server)
    while socket = server.accept?
      STDIN.puts [HTTP::Server, :accept!, socket, Time.utc]

      next unless client = socket

      spawn handle_client server, client
    end
  end

  private def handle_client(server, client : IO)
    STDIN.puts [HTTP::Server, :handle_client, client, Time.utc]

    set_socket_timeout server, client

    if client.is_a? IO::Buffered
      client.sync = false
    end

    exception = nil

    begin
      STDIN.puts [HTTP::Server, :handle_client_processor_start, client, Time.utc]

      @processor.process client, client

      STDIN.puts [HTTP::Server, :handle_client_processor_finished, client, Time.utc]
    rescue ex
      STDIN.puts [HTTP::Server, :handle_client_processor_error, client, Time.utc]

      exception = ex
    end

    _client = client

    if _client.responds_to? :all_free
      STDIN.puts [HTTP::Server, :handle_client_processor_free, client, Time.utc]

      _client.all_free
    end

    handle_exception exception if exception
  end
  • HTTP::Client
  private def socket
    STDIN.puts [HTTP::Client, :socket_ing, Time.utc]

    _socket = @socket
    return _socket if _socket

    hostname = @host.starts_with?('[') && @host.ends_with?(']') ? @host[1_i32..-2_i32] : @host

    begin
      if resolver = dns_resolver
        socket = Durian::TCPSocket.new hostname, @port, resolver, @connect_timeout
      else
        socket = TCPSocket.new hostname, @port, @dns_timeout, @connect_timeout
      end

      STDIN.puts [HTTP::Client, :socket_tcp_finished, Time.utc]

      socket.read_timeout = @read_timeout if @read_timeout
      socket.sync = false
      self.original_socket = socket

      {% unless flag?(:without_openssl) %}
        case _tls = tls_context
        when OpenSSL::SSL::SuperContext::Client
          STDIN.puts [HTTP::Client, :socket_ssl_ing, Time.utc]

          socket = OpenSSL::SSL::SuperSocket::Client.new socket, context: _tls, hostname: @host, sync_context_free: false
          STDIN.puts [HTTP::Client, :socket_ssl_finished, Time.utc]

          socket.skip_free = true if socket.responds_to? :skip_free=
        when OpenSSL::SSL::Context::Client
          socket = OpenSSL::SSL::Socket::Client.new socket, context: _tls, sync_close: true, hostname: @host
        end
      {% end %}

      @socket = socket
    rescue ex
      STDIN.puts [HTTP::Client, :socket_ssl_failed, Time.utc]

      @socket.try &.close ensure original_socket.try &.close
      all_free ensure super_context_free ensure raise ex
    end
  end

@636f7374
Copy link
Author

636f7374 commented Jan 1, 2020

@rdp Full verbose.

tunnel.txt - 175 KiloBytes
relay.txt - 1.2 MegaBytes

  • Relay
...
03:49:21.881545000 - Tunnel invalid memory access, Restart
I, [11:49:48 #953]  INFO -- : [1B7C6A] - 傳輸完成: 6.33s - Suspected hang
W, [11:50:33 #953]  WARN -- : [4F02FF] - 連接逾時: 33.28s - The Tunnel task is killed
...

@rdp
Copy link
Contributor

rdp commented Jan 1, 2020 via email

@636f7374
Copy link
Author

636f7374 commented Jan 1, 2020

@rdp I updated the pending location information, I re-edited this post, I may not see the updated content in the email, so I repost it.

2020-01-01 03:49:21.881545000 - Tunnel invalid memory access (my cause), Restart
... (Processing)
... (Maybe the problem came before?)
2020-01-01 03:49:48.694403000 - Relay Suspected hangs ~ 10 seconds.
... (Processed some)
2020-01-01 03:50:00.379686000 - continued to hangs.
... (Processed some)
2020-01-01 03:50:18.787955000 - continued to hangs.
... (Processed some)
2020-01-01 03:50:33.663965000 - continued to hangs.
(Kill tunnel, at the same time, Relay starts accepting clients quickly)
... (Done)

@rdp
Copy link
Contributor

rdp commented Jan 1, 2020 via email

@636f7374
Copy link
Author

636f7374 commented Jan 2, 2020

@rdp

Under normal circumstances (without -Dpreview_mt), hangs usually do not occur for 1-2 hours. If you add -Dpreview_mt, hangs usually occur within 2-5 minutes.
This probl occurs whether using a custom DNS resolver or the default C.getaddrinfo.
This usually happens when there are a large number of client (OpenSSL) requests.
Once the Tunnel is terminated, the hang problem of Relay will disappear at the same time (no longer hang).
When Relay hangs, it will no longer accept new clients.

My stupid question: Can gdb, lldb run on the server?, This takes a lot of requests for 2-5 minutes before this problem occurs.
I will analyze the logs later to see if I can find some useful information (before the hang).

@636f7374
Copy link
Author

636f7374 commented Jan 2, 2020

@rdp

The logs indicate that this problem may occur near HTTP::Client, maybe it is caused by my bad implementation. (50% - 60%)
If I find that this issue is indeed caused by somewhere, I will reopen this issue again.
Because it is difficult to narrow down the problem, it is more troublesome to test. :)

@636f7374 636f7374 closed this as completed Jan 2, 2020
@rdp
Copy link
Contributor

rdp commented Jan 3, 2020

OK
a single backtrace when it hangs would be interesting. That or add tons of STDOUT.puts "here1" all over the place :) Also a condensed reproducible test case would be nice. Thanks!

@636f7374
Copy link
Author

@rdp

Sorry, for some reason (Fix bugs), I didn't reply to you in time.

After testing, this problem does not occur with TCPServer (bind_tcp), UNIXServer (bind_unix) (so far).
So I dropped my plan to use OpenSSL::SSL::Server (bind_tls).

Other than that, I couldn't find any conditions that caused this problem.

Before:

  • Client <=Encrypt=> Tunnel <=Decrypt and ReCrypt=> Relay (SSL Server) <=HTTP::Client=> Remote

After:

  • Client <=Encrypt=> Tunnel <=Decrypt=> Relay (TCP Server) <=HTTP::Client=> Remote

I am going to make crystal SOCKS5 Client / Server, Maybe this problem will be resolved some days.

thank you for your help @rdp. 👍

@rdp
Copy link
Contributor

rdp commented Jan 14, 2020 via email

@waj
Copy link
Member

waj commented Apr 26, 2020

@636f7374 can you try if #9177 fixes this issue?

@636f7374
Copy link
Author

@waj Sorry, my program has been substantially modified and has been replaced with UNIXSocket, I read your pull request, I think there is no problem :)

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

5 participants