-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support LLVM 18.1 #14277
Support LLVM 18.1 #14277
Conversation
Looks like this had issues after all and something about require "socket"
x = Socket::IPAddress.new("::1", 1)
x == x # Invalid memory access (signal 11) at address 0x0 This reduces to: struct In6Addr
@__in6_u = 0_i128
def ==(other : self)
@__in6_u == other.@__in6_u
end
def ==(other)
false
end
end
struct Int32
def ==(other : In6Addr)
false
end
end
addr = In6Addr.new.as(Int32 | In6Addr)
addr == addr This part of LLVM 18 looks suspicious:
Note that |
Digging a bit further, the above reduced snippet crashes at something like this, indeed an unaligned 128-bit read: (the SIGSEGV is indistinguishable from a null pointer exception since it appears x86-64 doesn't hand out the actual failing address to the signal handler)
"*In6Addr#==<In6Addr>:Bool":
.cfi_startproc
movq %rdi, -48(%rsp)
movq %rdx, -40(%rsp)
movq %rsi, -32(%rsp)
movq -48(%rsp), %rax
movq -40(%rsp), %rcx
movq -32(%rsp), %rdx
movq %rdx, -24(%rsp)
movq %rcx, -16(%rsp)
movaps (%rax), %xmm0 ; crashes here
movaps -24(%rsp), %xmm1
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $65535, %eax
sete %al
retq Same method in LLVM 15: "*In6Addr#==<In6Addr>:Bool":
.cfi_startproc
movq %rdi, -40(%rsp)
movq %rdx, -32(%rsp)
movq %rsi, -24(%rsp)
movq -40(%rsp), %rax
movq -32(%rsp), %rcx
movq -24(%rsp), %rdx
movq %rdx, -16(%rsp)
movq %rcx, -8(%rsp)
movups (%rax), %xmm0 ; ok, movups can read from underaligned addresses
movups -16(%rsp), %xmm1
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $65535, %eax
sete %al
retq |
I haven't really looked into it too much yet, but Athena's nightly windows CI job fails now, while the latest release passes. I'll see about reproducing it and will go from there. EDIT: Created #14285 |
Tested using 18.1.0-rc1 which had no issues.
Note that LLVM's release process has changed; x.0.0 is now reserved for development branches, and the first stable release for each major version is now x.1.0, similar to GCC.
This PR also moves Windows CI to 18.1.0-rc1 directly. Linux CI will have to wait as we still depend on their volunteers' binary packages (they now have a nice note telling people to wait).