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

UNIXServer does not create socket file when launches with -d option #3644

Closed
SlayerShadow opened this issue Dec 6, 2016 · 2 comments
Closed

Comments

@SlayerShadow
Copy link

When program launches on debug mode, unix socket file does not appear on file system.
The code as simple as possible:

require "socket"
s = UNIXServer.new "test.sock" # same for "/tmp/test.sock"
p File.exists?( "test.sock" ) # or "/tmp/test.sock"

crystal run server.cr -d returns false but the same ruby launching and crystal run server.cr returns true.

crystal -v:
Crystal 0.20.1 [18e7617] (2016-12-05)

uname -a:
Linux LocalName 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux

@asterite
Copy link
Member

asterite commented Dec 6, 2016

Compiling with -d --emit llvm-ir to the compiler gives this error:

Module validation failed: inlinable function call in a function with debug info must have a !dbg location
  %83 = call %"String::Builder"* @"*String::Builder::new<Int32>:String::Builder"(i32 119)
inlinable function call in a function with debug info must have a !dbg location
  %84 = call %"String::Builder"* @"*String::Builder@IO#<<<String>:String::Builder"(%"String::Builder"* %83, %String* bitcast ({ i32, i32, i32, [11 x i8] }* @"'cast from '" to %String*))
inlinable function call in a function with debug info must have a !dbg location
  %94 = call %"String::Builder"* @"*String::Builder@IO#<<<(PrettyPrint::Breakable:Class | PrettyPrint::Text:Class)>:String::Builder"(%"String::Builder"* %84, %"(PrettyPrint::Breakable:Class | PrettyPrint::Text:Class)" %93)
inlinable function call in a function with debug info must have a !dbg location
  %95 = call %"String::Builder"* @"*String::Builder@IO#<<<String>:String::Builder"(%"String::Builder"* %94, %String* bitcast ({ i32, i32, i32, [29 x i8] }* @"' to PrettyPrint::Te...'" to %String*))
inlinable function call in a function with debug info must have a !dbg location
  %96 = call %"String::Builder"* @"*String::Builder@IO#<<<String>:String::Builder"(%"String::Builder"* %95, %String* bitcast ({ i32, i32, i32, [67 x i8] }* @"', at /Users/asterit...'" to %String*))
inlinable function call in a function with debug info must have a !dbg location
  %97 = call %String* @"*String::Builder#to_s:String"(%"String::Builder"* %96)
inlinable function call in a function with debug info must have a !dbg location
  %98 = call %TypeCastError* @"*TypeCastError::new<String>:TypeCastError"(%String* %97)

It's strange that the error doesn't happen without passing --emit llvm-ir, seems the verification pass we are invoking doesn't do much regarding debug info...

@asterite
Copy link
Member

asterite commented Dec 6, 2016

Probably similar to #3584

@asterite asterite added this to the 0.20.2 milestone Dec 12, 2016
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

2 participants