-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
ReleaseSafe panic error trace points at line 0 when freeing an undefined pointer #20085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What panic do you expect from line 650 of When I run this program I get a different source location:
This is using a different compiler, but matches the reported panic ID for your program, i.e. integer overflow. I would note that no panic occurs when this program is compiled and run in Also FYI, that large number being multiplied by 8 is |
Exactly the one I got, integer overflow. It should just tell me the correct line instead of
Yeah, the error happens only in release. But that is likely a different issue, I didn't report this because I think I saw a different issue on this already in the past.
Which one? Also what operating system are you on? Maybe this is a linux issue? |
Right. But the correct source location for the panic encountered by the program you posted is in If you try compiling with the flags
This branch https://github.com/amp-59/zig/tree/runtime_safety.
I am on Linux. I have not tested anything, but I think both issues are caused by the same thing, which is the use of LLVM intrinsics for checking overflow when the compiler has LLVM enabled. This produces more efficient machine code but might be causing debug statements to be missing for the call to panic, so the last thing your DWARF parser sees is an address inside That is just my first idea for debugging this. Honestly, the more concerning issue is that |
From what I've seen some functions are lost from the call stack due to inlining, this is normal behavior from what I've seen so far.
Yeah you are right, and with the following adaptation it also gives the correct stack trace in debug mode with llvm: var biome: Biome = undefined;
--- biome.init();
+++ _ = &biome;
list.append(biome) catch unreachable; So this issue is purely a problem of
I made a new issue for that: #20095 |
Zig Version
0.13.0-dev.75+5c9eb4081
Steps to Reproduce and Observed Behavior
The following code tries to free undefined slices:
One line of the error message point at
array_list.zig:0:0
:Expected Behavior
The error should point at the right line instead of 0, which would be
array_list.zig
line650
The text was updated successfully, but these errors were encountered: