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

Crystal v0.30.1 and v0.30.0 segfaults on a specific code base #8100

Closed
shdown opened this issue Aug 19, 2019 · 4 comments · Fixed by #8101
Closed

Crystal v0.30.1 and v0.30.0 segfaults on a specific code base #8100

shdown opened this issue Aug 19, 2019 · 4 comments · Fixed by #8101

Comments

@shdown
Copy link

shdown commented Aug 19, 2019

https://github.com/shdown/isekai/tree/927e3a62101efbed123596226cada1b5e2621360

$ crystal v
Crystal 0.30.1 [5e6a1b672] (2019-08-12)

LLVM: 4.0.0
Default target: x86_64-unknown-linux-gnu
$ make
crystal build src/isekai.cr
Invalid memory access (signal 11) at address 0x3fd01
[0x7f9d8bbaa7d6] ???
[0x7f9d8bac28a0] ???
[0x7f9d8cff14d7] ???
make: *** [Makefile:2: isekai] Error 11
@shdown
Copy link
Author

shdown commented Aug 19, 2019

Reduced the code size needed to reproduce, see https://github.com/shdown/crystal-segfault

@asterite
Copy link
Member

Reduced:

def foo
  x = 1
  yield x if x.is_a?(Char)
  yield x if x.is_a?(Int32)
end

foo { |x| }

@bew
Copy link
Contributor

bew commented Aug 19, 2019

Weird, carc.in doesn't segfault on your reduction @asterite, but gives a compiler bug https://carc.in/#/r/7fcf BUG: trying to assign Nil <- Int32

Are you sure it's the same problem?

@asterite
Copy link
Member

Yes, it's the same issue. The segfault happens for him in the compiler for some reason, I don't know why.

Or, well, @shdown would have to try compiling it with master compiled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants