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
{{ message }}
Repository navigation
Panic: reached unreachable code under aarch64 Ampere A1 cpu (Oracle Linux 8) #20038
arch-aarch6464-bit ArmbugObserved behavior contradicts documented or intended behaviorcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.
Zig doesn't support Ampere A1 cpu from OCI cloud machines, trying to run a pre-built binary results in the errors below.
Trying to either bootstrap or to build from source without LLVM support, results in the missing "id_aa64mmfr2_el1" cpu instruction error.
Result of zig env command (using a pre-built aarch64 binary)
bump this up because I encountered the same issue on 0.13.0.
zls crash immediately after start.
Any zig code calling allocator will crash.
Sample code as test.zig:
I'm able to build it to an executable. $ zig build-exe test.zig
Generate test file successfully. $ file ./test
Output is: ./test: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, with debug_info, not stripped
But run it:
thread 1527209 panic: reached unreachable code
Panicked during a panic. Aborting.
Aborted (core dumped)
After some test, this is the line causing problem: try a.append(10);
arch-aarch6464-bit ArmbugObserved behavior contradicts documented or intended behaviorcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.
Activity
mikdusan commentedon May 23, 2024
if it doesn't crash, can you paste output of
zig detect-cpuhashfall commentedon May 23, 2024
This is the output of the command:
WeijieH commentedon Jul 17, 2024
bump this up because I encountered the same issue on 0.13.0.
zls crash immediately after start.
Any zig code calling allocator will crash.
Sample code as test.zig:
I'm able to build it to an executable.
$ zig build-exe test.zigGenerate test file successfully.
$ file ./testOutput is:
./test: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, with debug_info, not strippedBut run it:
After some test, this is the line causing problem:
try a.append(10);DylanLukes commentedon Sep 13, 2024
I'm getting a different (more informative) error on my OCI box, building either
zlsor a freshlyinitd project.I'm on
zig-0.14.0-dev.1550+4fba7336a.alexrp commentedon Sep 13, 2024
This just looks like another page size issue; see #20511.
mikdusan commentedon Sep 13, 2024
@DylanLukes can you run command:
DylanLukes commentedon Sep 14, 2024
@mikdusan Sure, it reports:
pfgithub commentedon Sep 17, 2024
The workaround for now is to edit
lib/std/mem.zignext to your zig installation with this patch (no need to recompile zig):pub const page_size = switch (builtin.cpu.arch) { .wasm32, .wasm64 => 64 * 1024, .aarch64 => switch (builtin.os.tag) { .macos, .ios, .watchos, .tvos, .visionos => 16 * 1024, + .linux => 65536, // or your page size, run `getconf PAGESIZE` to find it else => 4 * 1024, },Once runtime page size detection is implemented, this won't be necessary anymore.
zsxawerdu commentedon Sep 18, 2024
if anyone is having this issue, this is a workaround. modify the above file, and things start working. Example Ziglings.
thank you sir @pfgithub