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-ohm causes "Module validation failed" with --release #3945

Closed
slowernet opened this issue Jan 27, 2017 · 5 comments
Closed

crystal-ohm causes "Module validation failed" with --release #3945

slowernet opened this issue Jan 27, 2017 · 5 comments

Comments

@slowernet
Copy link

app (master)$ crystal -v
Crystal 0.20.5 (2017-01-20)
app (master)$ crystal build --release src/app.cr 
Module validation failed: inlinable function call in a function with debug info must have a !dbg location
  %0 = call %"WeakRef(Resp)"* @"*WeakRef(Resp)@WeakRef(T)::allocate:WeakRef(Resp)"(i32 1104)

0x101765993: *raise<String>:NoReturn at ??
0x102594d7a: *Crystal::CodeGenVisitor#finish:Nil at ??
0x1024df55d: *Crystal::Compiler#codegen<Crystal::Program, Crystal::ASTNode+, Array(Crystal::Compiler::Source), String>:Nil at ??
0x1017bacb4: *Crystal::Command#run:(Bool | Crystal::Compiler::Result | IO::FileDescriptor | Nil) at ??
0x10178c087: main at ??

Error: you've found a bug in the Crystal compiler. Please open an issue, including source code that will allow us to reproduce the bug: https://github.com/crystal-lang/crystal/issues

app.rb:

require "ohm"

shard.yml:

dependencies:
  ohm:
    github: soveran/ohm-crystal
    branch: master

Thanks.

@slowernet slowernet changed the title crystal-ohm causes "Module validation failed" with --release crystal-ohm causes "Module validation failed" with --release Jan 27, 2017
@slowernet
Copy link
Author

Tagging @soveran in case he wants to track.

@soveran
Copy link

soveran commented Jan 27, 2017

@slowernet Thanks for adding me. I think it may have to do with some change in 0.20.5, as I had it working with the previous version. I will check the release notes to see if I find something.

@ysbaddaden
Copy link
Contributor

ysbaddaden commented Jan 27, 2017

Related to #3890
Some more missing !dbg 😭

In the meantime, you may build/run with --no-debug to avoid the issue, or use a Crystal built with LLVM < 3.9.

@slowernet
Copy link
Author

Thanks for the workaround, @ysbaddaden.

@asterite
Copy link
Member

asterite commented Feb 8, 2017

Reduced:

class Foo
  def initialize
  end

  def self.allocate
    Pointer(UInt8).malloc(1_u64).as(self)
  end
end

Foo.new

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

No branches or pull requests

5 participants