Skip to content

silent crash (stack overflow?) when copying small parts of large structs back to themselves #3309

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

Open
beaumccartney opened this issue Mar 21, 2024 · 4 comments
Labels

Comments

@beaumccartney
Copy link
Contributor

beaumccartney commented Mar 21, 2024

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.

@beaumccartney
Copy link
Contributor Author

i ran it in rad debugger and got this

image

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

@beaumccartney beaumccartney changed the title silent crash when copying parts of large structs back to themselves can't find chkstk.asm when copying parts of large structures Mar 22, 2024
@beaumccartney
Copy link
Contributor Author

I switched to using PortableBuildTools and I'm still having the same issue so I'm not confident its a VS install issue anymore

@flysand7
Copy link
Contributor

That sounds like either a rad debugger issue or something else. Are you building your project with -no-crt?

@beaumccartney beaumccartney changed the title can't find chkstk.asm when copying parts of large structures silent crash (stack overflow?) when copying small parts of large structs back to themselves Mar 22, 2024
@beaumccartney
Copy link
Contributor Author

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.

image

my apologies for changing the issue name, I'll change it back

@github-actions github-actions bot added the stale label Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants