Skip to content

ReleaseSafe executables for aarch64-linux only prints out first step of backtrace #22161

@leroycep

Description

@leroycep

Zig Version

0.14.0-dev.2379+6188cb8e5

Steps to Reproduce and Observed Behavior

// ./main.zig
const std = @import("std");

noinline fn foo(x: u32) u32 {
    return x * x;
}

noinline fn bar() u32 {
    return foo(std.math.maxInt(u32));
}

pub fn main() !void {
    std.debug.print("{}", .{bar()});
}
~/code/zig/build/example-elfsymtab-backtrace> ../stage3/bin/zig build-exe main.zig -target aarch64-linux-none -OReleaseSafe; try { /usr/bin/qemu-aarch64 ./main }
thread 3134781 panic: integer overflow
/home/geemili/code/zig/build/example-elfsymtab-backtrace/main.zig:4:14: 0x1018b87 in foo (main)
    return x * x;
             ^
qemu: uncaught target signal 6 (Aborted) - core dumped

Expected Behavior

Full backtrace, like in debug mode:

~/code/zig/build/example-elfsymtab-backtrace> ../stage3/bin/zig build-exe main.zig -target aarch64-linux-none; try { /usr/bin/qemu-aarch64 ./main }
thread 3136170 panic: integer overflow
/home/geemili/code/zig/build/example-elfsymtab-backtrace/main.zig:4:14: 0x104bf63 in foo (main)
    return x * x;
             ^
/home/geemili/code/zig/build/example-elfsymtab-backtrace/main.zig:8:15: 0x104a667 in bar (main)
    return foo(std.math.maxInt(u32));
              ^
/home/geemili/code/zig/build/example-elfsymtab-backtrace/main.zig:12:32: 0x104a637 in main (main)
    std.debug.print("{}", .{bar()});
                               ^
/home/geemili/code/zig/lib/std/start.zig:617:37: 0x104a60f in posixCallMainAndExit (main)
            const result = root.main() catch |err| {
                                    ^
???:?:?: 0x0 in ??? (???)
qemu: uncaught target signal 6 (Aborted) - core dumped

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions