compiler_bug
compiler_bug
This project shows a reproducible bug where JSON content doesn't fully return when the --release flag is added.
Testing this
git clonethis repocdin to the reposhardscrystal src/start_server.cr- open
http://localhost:3000/in Chrome (it's easier to see here) - Notice everything is ok.
ctrl-Cto stop the servercrystal 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 sandboxgit clone https://github.com/crystal-lang/crystal.git langgit 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 langgit bisect startgit bisect good 6d9a1d5git bisect bad 9f90efecd ..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 langmake clean && makecd ../demo- Then
/app/lang/bin/crystal build --release src/start_server.crfrom this repo - Back on the local machine, you should be able to
./demo/start_serverand boot this up.
Repository
compiler_bug
Owner
Statistic
- 0
- 0
- 0
- 0
- 3
- over 2 years ago
- January 19, 2023
License
Links
Synced at
Wed, 29 Oct 2025 06:24:10 GMT
Languages