#Compilation errors only on 13th Gen Intel(R) Core(TM) i9-13900K

1 messages · Page 1 of 1 (latest)

shy swift
#

Hi!

We are using Zig via the Elixir library burrito, which uses zig to create self contained executables for Elixir applications.

I have always had great success with this library, but on a recent project, I seem to be seeing some really weird compilation errors. The weirder thing is that I'm the only one who sees it. It works in CI, it works on colleagues computers with the same OS.

The only thing I can really think of being the difference is my CPU, which is a 13th Gen Intel(R) Core(TM) i9-13900K.

Has anyone seen compilation errors with this CPU?

I've attached the compilation errors for context, using zig 0.14.1

undone torrent
#

is everyone else using zig 0.14.1?

shy swift
#

Yes

undone torrent
#

these traces look a bit messed up

shy swift
#

Can you clarify what you mean by the traces?

undone torrent
#

the error traces

#

like the file line number message

shy swift
#

what about it is messed up?

median hare
#

what the hell

undone torrent
median hare
#

this looks like memory corruption in the compiler

undone torrent
#

yeah

#

the same line being shown multiple times

#

with empty messages

shy swift
#

And for what it's worth, this is in NixOS, but I have also tried it in a basic ubuntu virtual machine and installed zig via mise and saw the same issue

#

which is what made me think maybe it was related to my CPU

median hare
#

are u using nixpkgs zig?

#

or are u getting it from a flake that fetches it from ziglang.org

shy swift
#

with this example, yes.

but as I mentioned above, i've seen the same issue when installing via mise, which just downloads from ziglang.org

#

Yes, nixpkgs, to answer your question. not a flake

median hare
#

hmmmmmmm

static basin
#

Are the errors different each time, or is the error output exactly the same - same message, lineno, etc

median hare
#

just to double check, try with nix shell github:silversquirl/zig-flake#zig_0_14_1 as well as nix shell github:silversquirl/zig-flake#zig_0_14_0

#

i doubt it's an 0.14.1 regression, but there's always a chance ^-^

shy swift
#

The same, i believe.

#

thanks, i'll try that flake

static basin
median hare
#

also, do u have any older projects using the same lib that u can use to check if it's the lib itself or something about this specific code?

shy swift
#

I'd have to double check, I tried that a month or so ago (i only get so much time to work on this project)

shy swift
median hare
#

or, ideally, something u know used to work, to check if something has changed with ur system

#

am i correct in saying burrito is just a tool written in zig, but ur not writing any zig code in ur actual project?

shy swift
#

Correct, the project is Elixir, which has a dependency called burrito (https://github.com/burrito-elixir/burrito), which more or less creates an archive of the erlang runtime and your project and packs it into a zig made executable

#

I got almost the same error when using that flake and 0.14.1, but it had 48 errors instead of 49, but looked mostly the same. I'm trying 0.14.0 now

#

same issue with 0.14.0

median hare
#

very weird

#

can you try adding -Dcpu=baseline to your zig build command? probably will do nothing but maybe worth a try

#

if that doesn't work, my recommendation would be to build a debug compiler

shy swift
#

is there a way with that flake to make a debug build?

shy swift
median hare
#

u will need to tweak the versions tho, since it's designed for the master branch

#

(just edit flake.nix to change zig_nightly to zig_0_14_1 and llvmPackages_20 to llvmPackages_19)

#

then u can build a debug compiler with build-zig3 && build

shy swift
median hare
#

that's... weird

median hare
#

what are you doing differently in your project?

shy swift
#

nothing really, but there could be something i've overlooked

#

I'd share it, but its private right now, but will be open source in a few days

shy swift
#

We open sourced that project and I’m getting reports with the same errors

#

I still have to try with a debug build of zig

static basin
#

So, not cpu specific, memory corruption in the compiler? Probably worth opening an issue in zig

There error stack is slightlydifferent but the structure of the errors is the same

Maybe that library is doing some funny comptime stuff that's corrupting the memory somehow

Debug build or releasesafe build would catch the error, I expect(?) Since there are extra bounds checks and assertions

shy swift
#

Sorry, just saw this. I’ll open an issue. Appreciate it!

shy swift
# median hare then u can build a debug compiler with `build-zig3 && build`

is there anything else needed to use this flake? I copied it into the zig repo, updated zig_nightly to zig_0_15_1 and llvmPackages_20 to llvmPackages_21 and then had to manually source the shell hook (i use zsh and the use flake from direnv, idk if thats why), then could successfully run build-zig3, but build fails with /home/mitchell/src/zig/build/stage3/bin/zig: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory