Skip to content
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

Stack overflow - last zone 4 encounter #121

Open
Doronimmo opened this issue Dec 10, 2024 · 13 comments
Open

Stack overflow - last zone 4 encounter #121

Doronimmo opened this issue Dec 10, 2024 · 13 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Doronimmo
Copy link
Collaborator

Stack overflow after accepting delivery quest
20241210_154932

@Doronimmo
Copy link
Collaborator Author

After restart, issue continues

@evanbowman
Copy link
Owner

After restart, issue continues

Can I have the save file? This could be really helpful to have if the issue is easily reproducible upon restart.

@Doronimmo
Copy link
Collaborator Author

Skyland.srm.txt
Savefile (srm and sav are basically the same)

@evanbowman
Copy link
Owner

Did you start a new game afterwards? Are you using an overdrive? This version of the save file is not saved at a state right before the crash happens.

@evanbowman
Copy link
Owner

Sometimes with an everdrive, some models will write files back to the sd card upon the next time that the game is loaded, could this be an older version of the save file?

@evanbowman
Copy link
Owner

Unfortunately, this issue is possibly my recursive merge-sort function

(defn/c sort (lat comp)

I'll rewrite it to use the C++ sort function. My lisp sort function was so concise and pretty, RIP

@Doronimmo
Copy link
Collaborator Author

Doronimmo commented Dec 10, 2024

Sometimes with an everdrive, some models will write files back to the sd card upon the next time that the game is loaded, could this be an older version of the save file?

might be the case, this looks like the same game, but 1 zone before.

@Doronimmo
Copy link
Collaborator Author

Unfortunately, this issue is possibly my recursive merge-sort function

(defn/c sort (lat comp)

I'll rewrite it to use the C++ sort function. My lisp sort function was so concise and pretty, RIP

is this the lisp api backend?

@evanbowman
Copy link
Owner

Unfortunately, this issue is possibly my recursive merge-sort function

(defn/c sort (lat comp)

I'll rewrite it to use the C++ sort function. My lisp sort function was so concise and pretty, RIP

is this the lisp api backend?

Some of the lisp api is written in lisp. I'll have to replace this function with C++ code, because it's using too much stack space.

@evanbowman
Copy link
Owner

a13acf0

@evanbowman
Copy link
Owner

#118
These two issues could be the same underlying problem

@evanbowman evanbowman self-assigned this Dec 10, 2024
@evanbowman evanbowman added the bug Something isn't working label Dec 10, 2024
@evanbowman evanbowman added this to the December-2024 milestone Dec 10, 2024
@Doronimmo
Copy link
Collaborator Author

#118 These two issues could be the same underlying problem

So this is when the stack overflow is not detected?

@evanbowman
Copy link
Owner

#118 These two issues could be the same underlying problem

So this is when the stack overflow is not detected?

Possibly, yeah. I do my best to detect stack overflows, but it's imprecise and quite difficult. There's no operating system on the gba and I have to do some manual checks to see if sentinel values placed at the end of the stack get trampled upon. Certain patterns of writes can skip over the memory locations that I use to detect invalid stack writes, preventing the stack overflow detection logic from working. Due to lack of hardware memory protection support in the gameboy, this is the best I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants