Odin
Odin copied to clipboard
silent crash (stack overflow?) when copying small parts of large structs back to themselves
Context
Odin: dev-2024-03:7d6e9ef39
OS: Windows 11 Home Basic (version: 22H2), build 22621.3155
CPU: AMD Ryzen 9 5950X 16-Core Processor
RAM: 32666 MiB
Backend: LLVM 17.0.1
Bug
on windows with certain large structs, clearing them to zero while copying some of their fields back in silently crashes. I've not been able to reproduce this issue on my mac.
e.g.
// silently crashes
gamestate^ = {
persistent = gamestate.persistent
}
factoring out to below fixes the crash for me
persistent := gamestate.persistent
gamestate^ = {}
gamestate.persistent = persistent
Unfortunately I don't have a minimal repro. I'll continue searching for one and update here if I find one.
i ran it in rad debugger and got this
perhaps I don't have all the visual studio things installed that I'm supposed to (god help me) but I don't have a d drive either
I switched to using PortableBuildTools and I'm still having the same issue so I'm not confident its a VS install issue anymore
That sounds like either a rad debugger issue or something else. Are you building your project with -no-crt
?
I'm using libc rn, so using no-crt isn't an option rn
I tried in rememdybg too and I got a stack overflow exception. I suppose that tracks cause the struct is large, but what I'm only copying a small field from the large struct and clearing the rest. I'm not entirely sure how this should behave but I don't have this problem on macos.
my apologies for changing the issue name, I'll change it back