EDIT: just running zig without any arguments also crashes. zig --help works fine.
I just downloaded the zig master branch binaries for windows. zig build-exe hello.zig crashes with no output/error. The contents of hello.zig do not matter, even an empty file leads to this crash. According to gdb -
Thread 1 received signal SIGILL, Illegal instruction.
0x00007ff79fcbcf1d in ?? ()
zig 0.5.0 binaries do not have this problem.
To help debug: what CPU do you have?
Intel i7 7700HQ
Here's a CPU-Z screenshot for more details -
can you get gdb to tell you the instruction? I believe there is a disassemble command.
@andrewrk
gdb -
Thread 1 received signal SIGILL, Illegal instruction.
0x00007ff7cd02cf1d in ?? ()
(gdb) disassemble
No function contains program counter for selected frame.
(gdb) bt
#0 0x00007ff7cd02cf1d in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
windbg -
(if there is some specific gdb command you want me to run, please let me know because I am more used to printf debugging than using debuggers)
Thanks, that actually does provide a clue - it tells us that somehow the PC has jumped to garbage memory, as opposed to, for example, SIMD instructions have accidentally made it into the downloadable binaries.
This is quite a strange issue, though. This is the first I've heard of this happening and we've been shipping static windows binaries for some time.
Just so I can reproduce your situation exactly - which tarball are you using?
Latest master build -
https://ziglang.org/builds/zig-windows-x86_64-0.5.0+1483ae37f.zip
OK I can reproduce this. This looks like a recent regression. Here's an older binary that I believe does not have the issue:
https://ziglang.org/builds/zig-windows-x86_64-0.5.0+652efe38b.zip
Alright this was a regression introduced in 7eb0a3edcef2ab752ff1e45e6f1316b633b29606. It's actually affecting all operating systems, and all the binaries are borked until this is fixed. Oops!
The fix is simple and coming soon. Just need to add -target foo to cmake, to match the logic that used to be in build.zig.
Alright the new binaries are up on the download page and have the illegal instruction problem fixed.
Sorry about that!