Hi,
I am using Crystal 0.21.0 [c2c2276] (2017-02-21) on an Ubuntu OS version 16.04 LTS.
I'm pretty sure I didn't have this problem in Crystal 0.20.0
Starting up crystal play on command-line works:
Listening on http://localhost:8080
But when I open a Firefox browser with: localhost:8080, the normal Play screen shows up, with the compiler button spinning, but after a few seconds a popup error screen appears:
see attached screenshot.
At the terminal I see:
At the command terminal where crystal play was started I get:
ivo@ivo-SATELLITE-L50D-B:~$ crystal play
Listening on http://localhost:8080
E, [2017-02-27 10:14:35 +0100 #9280] ERROR -- : Instrumention bug found (session=1, tag=1).
The full text of the error message is:
Exception
Error in line 5: instantiating 'Crystal::Playground::Agent:Class#new(String, Int32)'
in /opt/crystal/src/compiler/crystal/tools/playground/agent.cr:8: instantiating 'HTTP::WebSocket:Class#new(URI)'
@ws = HTTP::WebSocket.new(URI.parse(url))
^~~
in /opt/crystal/src/http/web_socket.cr:28: instantiating 'HTTP::WebSocket::Protocol:Class#new(URI)'
new(Protocol.new(uri))
^~~
in /opt/crystal/src/http/web_socket/protocol.cr:285: instantiating 'new(String, String, (Int32 | Nil), Bool)'
return new(host, path, uri.port, tls)
^~~
in /opt/crystal/src/http/web_socket/protocol.cr:251: expanding macro
{% if !flag?(:without_openssl) %}
^
in macro 'macro_127969024' /opt/crystal/src/http/web_socket/protocol.cr:251, line 8:
instantiating 'OpenSSL::SSL::Socket::Client:Class#new(TCPSocket)'
in /opt/crystal/src/openssl/ssl/socket.cr:4: instantiating 'super(TCPSocket, OpenSSL::SSL::Context::Client, Bool)'
super(io, context, sync_close)
^~~~~
in /opt/crystal/src/openssl/ssl/socket.cr:86: instantiating 'OpenSSL::BIO:Class#new(TCPSocket)'
@bio = BIO.new(io)
^~~
in /opt/crystal/src/openssl/bio.cr:18: instantiating 'IO#read(Slice(UInt8))'
io.read(Slice.new(buffer, len)).to_i
^~~~
in /opt/crystal/src/flate/reader.cr:68: instantiating 'IO#peek()'
@peek = @io.peek
^~~~
in /opt/crystal/src/http/content.cr:107: instantiating 'read_chunk_start()'
read_chunk_start
^~~~~~~~~~~~~~~~
in /opt/crystal/src/http/content.cr:138: instantiating 'read_chunk_end()'
read_chunk_end
^~~~~~~~~~~~~~
in /opt/crystal/src/http/content.cr:146: instantiating 'IO#skip(Int32)'
@io.skip(2)
^~~~
in /opt/crystal/src/io.cr:893: instantiating 'read(Slice(UInt8))'
read_count = read(buffer.to_slice[0, Math.min(bytes_count, 4096)])
^~~~
in /opt/crystal/src/gzip/reader.cr:107: instance variable '@extra' of Gzip::Header must be Slice(UInt8), not Nil
Header.new(first_byte, @io)
^~~
Thanks for your efforts on this beautiful language!
Ivo Balbaert

Same issue on my mac
Same issue on Arch Linux
@tekjar @bararchy could you confirm if the issue persists with the master version, since #4068 was merged?
This will be fixed after #4061 or a fix to #3988. We will focus on that and release a 0.21.1 with improved specs for playground.
I can confirm that Crystal Play works again in Crystal v 0.21.1 on Ubuntu 16.04 LTS.
Great work!
Thanks. It should not break that much again. I will like to more like an acceptance testing for this...
Most helpful comment
Same issue on Arch Linux