You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
% zig build-exe ./ptr_cast_crasher.zig
Unreachable at /tmp/zig-20210605-55791-tdqqwr/zig-0.8.0/src/stage1/ir.cpp:22346 in buf_write_value_bytes. This is a bug in the Zig compiler.thread 1156087 panic:
Unable to dump stack trace: debug info stripped
zsh: abort zig build-exe ./ptr_cast_crasher.zig
This code can be modified to crash in other ways as well, for example, if we change &data[0..8] to data[0..8]:
Vexu
added
bug
Observed behavior contradicts documented or intended behavior
stage1
The process of building from source via WebAssembly and the C backend.
labels
Aug 6, 2021
$ zig version
0.9.0-dev.1679+6cf8a49bb
$ zig build-exe src/main.zig
Unreachable at /home/tau/foreign/zig/src/stage1/ir.cpp:22940 in buf_write_value_bytes. This is a bug in the Zig compiler.
This occurs whether I set the array to undefined or initialize it explicitly, but only if its length is greater than 1. Does anyone have a workaround for the issue?
[EDIT 2021-11-19: still broken on current master.]
For what its worth, I no longer encounter this in 0.8.1 on an M1 Mac. I spoke too soon. I found a case where removing my work around triggers it still.
Given this code in a file named
ptr_cast_crasher.zig
:This code can be modified to crash in other ways as well, for example, if we change
&data[0..8]
todata[0..8]
:The text was updated successfully, but these errors were encountered: