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

Module validation failed: inlinable function call in a function with debug info must have a !dbg location #4202

Closed
carsonbaker opened this issue Mar 28, 2017 · 3 comments
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler
Milestone

Comments

@carsonbaker
Copy link

$ crystal build --release this_borks_compiler.cr
Module validation failed: inlinable function call in a function with debug info must have a !dbg location
  %3 = call i8* @__crystal_malloc_atomic(i32 %2)

0x10d71fb53: *raise<String>:NoReturn at ??
0x10e6f0aab: *Crystal::CodeGenVisitor#finish:Nil at ??
0x10e61c37e: *Crystal::Compiler#codegen<Crystal::Program, Crystal::ASTNode+, Array(Crystal::Compiler::Source), String>:(Tuple(Array(Crystal::Compiler::CompilationUnit), Array(String)) | Nil) at ??
0x10eec1ff4: *Crystal::Compiler#compile<Array(Crystal::Compiler::Source), String>:Crystal::Compiler::Result at ??
0x10d77e1eb: *Crystal::Command#run:(Bool | Crystal::Compiler::Result | IO::FileDescriptor | Nil) at ??
0x10d7498dd: main at ??
crystal -v
Crystal 0.21.1 (2017-03-14) LLVM 4.0.0

Build with
crystal build --release this_borks_compiler.cr

Code that reproduces:
this_borks_compiler.cr.txt

@refi64
Copy link
Contributor

refi64 commented Mar 28, 2017

Code in question:

class ModValidationFailedReproduce
  def initialize
    bork_bork_bork = File.size("something")
    Slice(UInt8).new(bork_bork_bork)
  end
end

ModValidationFailedReproduce.new

+1 for bork_bork_bork!

@carsonbaker
Copy link
Author

Indeed, just Slice(UInt8).new(File.size("foo")) triggers it.

@carsonbaker
Copy link
Author

No errors on a slightly older version of Crystal:

carson$ crystal -v && echo "Slice(UInt8).new(File.size(\".\"))" | crystal eval --release
Crystal 0.21.1 [3c6c75e] (2017-03-06) LLVM 3.5.0
[exits 0]

@ysbaddaden ysbaddaden added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler labels Mar 28, 2017
@asterite asterite added this to the Next milestone Mar 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler
Projects
None yet
Development

No branches or pull requests

4 participants