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
So it seems when the return address is 0 the stack trace printing function fails. (I don't know how return address can be 0)
GDB stacktrace:
#0 0x00007ffff7c9916c in __pthread_kill_implementation () from /nix/store/rmy663w9p7xb202rcln4jjzmvivznmz8-glibc-2.40-66/lib/libc.so.6
#1 0x00007ffff7c40e86 in raise () from /nix/store/rmy663w9p7xb202rcln4jjzmvivznmz8-glibc-2.40-66/lib/libc.so.6
#2 0x00007ffff7c2893a in abort () from /nix/store/rmy663w9p7xb202rcln4jjzmvivznmz8-glibc-2.40-66/lib/libc.so.6
#3 0x000000000104d691 in posix.abort () at /nix/store/k8wr6zqyhchbnhy51r7f2l5fq14xl0zk-zig-0.14.0/lib/std/posix.zig:710
#4 0x0000000001048a77 in debug.defaultPanic (msg=..., first_trace_addr=...)
at /nix/store/k8wr6zqyhchbnhy51r7f2l5fq14xl0zk-zig-0.14.0/lib/std/debug.zig:676
#5 0x00000000010437e9 in debug.FullPanic((function 'defaultPanic')).integerOverflow ()
at /nix/store/k8wr6zqyhchbnhy51r7f2l5fq14xl0zk-zig-0.14.0/lib/std/debug.zig:91
#6 0x000000000106cdf6 in debug.writeStackTrace__anon_7169 (stack_trace=..., out_stream=..., debug_info=0x1135208 <debug.self_debug_info>,
tty_config=...) at /nix/store/k8wr6zqyhchbnhy51r7f2l5fq14xl0zk-zig-0.14.0/lib/std/debug.zig:708
#7 0x000000000104d803 in debug.dumpStackTrace (stack_trace=...) at /nix/store/k8wr6zqyhchbnhy51r7f2l5fq14xl0zk-zig-0.14.0/lib/std/debug.zig:501
#8 0x0000000001048e87 in debug.defaultPanic (msg=..., first_trace_addr=...)
at /nix/store/k8wr6zqyhchbnhy51r7f2l5fq14xl0zk-zig-0.14.0/lib/std/debug.zig:659
#9 0x00000000010437e9 in debug.FullPanic((function 'defaultPanic')).integerOverflow ()
at /nix/store/k8wr6zqyhchbnhy51r7f2l5fq14xl0zk-zig-0.14.0/lib/std/debug.zig:91
#10 0x000000000106cdf6 in debug.writeStackTrace__anon_7169 (stack_trace=..., out_stream=..., debug_info=0x1135208 <debug.self_debug_info>,
tty_config=...) at /nix/store/k8wr6zqyhchbnhy51r7f2l5fq14xl0zk-zig-0.14.0/lib/std/debug.zig:708
#11 0x000000000104d803 in debug.dumpStackTrace (stack_trace=...) at /nix/store/k8wr6zqyhchbnhy51r7f2l5fq14xl0zk-zig-0.14.0/lib/std/debug.zig:501
#12 0x00000000010f7fa6 in start.callMain () at /nix/store/k8wr6zqyhchbnhy51r7f2l5fq14xl0zk-zig-0.14.0/lib/std/start.zig:663
#13 start.callMainWithArgs () at /nix/store/k8wr6zqyhchbnhy51r7f2l5fq14xl0zk-zig-0.14.0/lib/std/start.zig:616
#14 start.main (c_argc=1, c_argv=0x7fffffffb768, c_envp=0x7fffffffb778)
at /nix/store/k8wr6zqyhchbnhy51r7f2l5fq14xl0zk-zig-0.14.0/lib/std/start.zig:631
Expected Behavior
A stack trace to be there. No recursive panic.
The text was updated successfully, but these errors were encountered:
gerwin3
added
the
bug
Observed behavior contradicts documented or intended behavior
label
Apr 10, 2025
Some extra information: After some debugging it turns out I had forgot to annotate some functions with callconv(C) that were loaded in dynamically (dlopen). Most likely the compiler crash has something to do with that. I could imagine the return address being incorrect when loading a function with the wrong callconv. Still would not expect the compiler to crash. Maybe a message like "return address incorrect"
This does not look like a compiler crash to me; it looks like a crash in your program. Violating calling convention can lead to all sorts of bugs, so I don't think there's a compiler issue here. Rather, it would be nice if someone could de-bitrot #19842.
Zig Version
0.14.0
Steps to Reproduce and Observed Behavior
In my library example (https://github.com/gerwin3/nvidia-video-codec-sdk/blob/main/examples/decode_rainbow.zig) if the code fails and returns an error then it does not produce a correct stack trace. The full output is:
I think it is because the stack trace function itself crashes at
debug.zig:708
.zig/lib/std/debug.zig
Line 708 in 5ad91a6
So it seems when the return address is 0 the stack trace printing function fails. (I don't know how return address can be 0)
GDB stacktrace:
Expected Behavior
A stack trace to be there. No recursive panic.
The text was updated successfully, but these errors were encountered: