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
When debugging into the hasher function used by map when setting a value, the call stack is lost after executing the prologue sub rsp,38h upon entering the __$hasher function.
I would consider this low-priority as it its impact is relatively insignificant.
I'm reporting this mainly because I believe this is because Odin doesn't generate proper unwind table information in the PDB in this particular case, and if this is true and if this is unintentional, there might be other emits affected by this bug, where it actually does matter.
I have not been able to find any resources mentioning whether this is intentional or not.
Operating System & Odin Version:
Odin: dev-2025-01-nightly:2aae4cf
OS: Windows 10 Professional (version: 22H2), build 19045.5371
CPU: 12th Gen Intel(R) Core(TM) i5-12600KF
RAM: 32627 MiB
Backend: LLVM 18.1.8
Compiled with -debug -o:none.
Expected Behavior
Preserve the call stack all the way into the actual hasher.
Current Behavior
00007FF78D98B9A0 sub rsp,38h
00007FF78D98B9A4 mov qword ptr [rsp+28h],rdx ; CALL STACK GONE from here on
00007FF78D98B9A9 mov qword ptr [rsp+30h],rcx
00007FF78D98B9AE jmp __$hasher1+10h (07FF78D98B9B0h)
00007FF78D98B9B0 mov rdx,qword ptr [rsp+28h]
00007FF78D98B9B5 mov rcx,qword ptr [rsp+30h]
00007FF78D98B9BA call runtime.default_hasher_string (07FF78D9894A0h)
00007FF78D98B9BF add rsp,38h ; call stack is good again after this executes
00007FF78D98B9C3 ret
Failure Information (for bugs)
Was able to reproduce in Visual Studio's native debugger, and cppvsdbg in vscode.
I'm not seeing frame pointers anywhere, and I haven't seen any option to disable (or not disable) frame pointers.
So I'm assuming Odin just isn't using them in its codegen, and is relying fully on unwind tables in the PDB, and debugger heuristics.
Steps to Reproduce
package main
main :: proc() {
dat := make(map[string]int)
defer delete(dat)
dat["hello"] = 5
}
Debug into the call instruction to __$hasher1 that's emitted for the line dat["hello"] = 5
OR
Set a breakpoint inside default_hasher_string in dynamic_map_internal.odin.
Observe that the main proc, and everything before it, is gone from the call stack.
The text was updated successfully, but these errors were encountered:
Context
When debugging into the hasher function used by
map
when setting a value, the call stack is lost after executing the prologuesub rsp,38h
upon entering the__$hasher
function.I would consider this low-priority as it its impact is relatively insignificant.
I'm reporting this mainly because I believe this is because Odin doesn't generate proper unwind table information in the PDB in this particular case, and if this is true and if this is unintentional, there might be other emits affected by this bug, where it actually does matter.
I have not been able to find any resources mentioning whether this is intentional or not.
Odin: dev-2025-01-nightly:2aae4cf
OS: Windows 10 Professional (version: 22H2), build 19045.5371
CPU: 12th Gen Intel(R) Core(TM) i5-12600KF
RAM: 32627 MiB
Backend: LLVM 18.1.8
Compiled with
-debug -o:none
.Expected Behavior
Preserve the call stack all the way into the actual hasher.
Current Behavior
Failure Information (for bugs)
Was able to reproduce in Visual Studio's native debugger, and
cppvsdbg
in vscode.I'm not seeing frame pointers anywhere, and I haven't seen any option to disable (or not disable) frame pointers.
So I'm assuming Odin just isn't using them in its codegen, and is relying fully on unwind tables in the PDB, and debugger heuristics.
Steps to Reproduce
Debug into the
call
instruction to__$hasher1
that's emitted for the linedat["hello"] = 5
OR
Set a breakpoint inside
default_hasher_string
indynamic_map_internal.odin
.Observe that the
main
proc, and everything before it, is gone from the call stack.The text was updated successfully, but these errors were encountered: