GithubHelp home page GithubHelp logo

compiler_bug's Introduction

compiler_bug

This project shows a reproducible bug where JSON content doesn't fully return when the --release flag is added.

Testing this

  • git clone this repo
  • cd in to the repo
  • shards
  • crystal src/start_server.cr
  • open http://localhost:3000/ in Chrome (it's easier to see here)
  • Notice everything is ok.
  • ctrl-C to stop the server
  • crystal build --release src/start_server.cr
  • ./start_server
  • Refresh the chrome page
  • Notice the logs throw Index out of bounds, and the response is cut off

Bisecting against Crystal

In order to test this against different commits in Crystal, you'll need to clone the Crystal compiler, and have Docker installed.

  • mkdir sandbox && cd sandbox
  • git clone https://github.com/crystal-lang/crystal.git lang
  • git clone https://github.com/jwoertink/compiler_bug.git demo
  • The last good version this worked on was Crystal 1.1.1 (6d9a1d5)
  • It stopped working in 1.2.0
  • cd lang
  • git bisect start
  • git bisect good 6d9a1d5
  • git bisect bad 9f90efe
  • cd ..
  • sudo docker run --rm -it -v $PWD:/app -w /app crystallang/crystal:1.1.1-build bash
  • From here, you're in the Docker container with access to this repo, and Crystal.
  • cd lang
  • make clean && make
  • cd ../demo
  • Then /app/lang/bin/crystal build --release src/start_server.cr from this repo
  • Back on the local machine, you should be able to ./demo/start_server and boot this up.

compiler_bug's People

Contributors

jwoertink avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.