Closed Beefster09 closed 1 month ago
I was not able to reproduce this on my Windows setup.
Might be a Linux-only bug. Possibly only LLVM 17
I had to comment out the uvs += color_page.xyxy
line in your snippet, but I can confirm that this is causing a segfault on Linux.
Odin: dev-2024-06:1f4cfd52f
OS: Arch Linux, Linux 6.9.3-arch1-1
CPU: 12th Gen Intel(R) Core(TM) i7-12700K
RAM: 31913 MiB
Backend: LLVM 17.0.6
I've narrowed this down to:
package qw
import "core:fmt"
q :: proc (src: [2]f32, f: f32) {
rect := src.xyxy
fmt.println(rect)
}
main :: proc() {
a: [2]f32 = {1,3}
q(a, 1.5)
}
Removing the f
argument from the q
proc makes it work again. From a look at what assembly instruction it's segfaulting on, I'm guessing there's some stack corruption going on here, if I might be so bold.
Seems plausible that it's stack corruption. Does this occur at o:minimal as well as o:speed, or only at specific optimization levels?
Speed, size, and aggressive all work fine. None, minimal, and unspecified all cause the segfault.
The thick plottens!
Context
For instance, swizzling a
[2]f32]
into a[4]f32]
usingarray.xyxy
will sometimes result in a segfault at runtime.Expected Behavior
array.xyxy
wherearray
is 2 elements long should result in a 4-element array with the original array repeated twice.Current Behavior
Segfault
Failure Information (for bugs)
My code looks something like this: (irrelevant details stripped out)
I did not test this snippet, but it should be trivial to try in a program