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

DebugSymbolStorage: fix infinite loop #1134

Merged
merged 4 commits into from Mar 27, 2024

Conversation

goeiecool9999
Copy link
Contributor

@goeiecool9999 goeiecool9999 commented Mar 24, 2024

This fixes a bug where ClearRange goes into an infinite loop when length is not divisible by 4. Because length is unsigned it wraps around to UINT32_MAX and never becomes zero. Because of this bug, if a user disables a graphic pack like "Graphics" for botw while the game is running length is equal to 9 and the UI thread freezes and never recovers.

@Crementif
Copy link
Member

Huh, seems like a good find!

@Exzap
Copy link
Contributor

Exzap commented Mar 25, 2024

This will overflow when base + length equals 0x1'00000000 (e.g. clearing the last dword of the address space with base = 0xFFFFFFFC length = 4) In practice there shouldn't really be any clears requested in high address space but it still should be either fixed or caught with an assert

@goeiecool9999
Copy link
Contributor Author

I have fixed the overflow. I had to brush up on my integral promotion rules but this should be right (I checked).

I think it's time to take a break...
@goeiecool9999 goeiecool9999 marked this pull request as draft March 26, 2024 00:21
@goeiecool9999 goeiecool9999 marked this pull request as ready for review March 26, 2024 01:05
@Exzap Exzap merged commit 5230fca into cemu-project:main Mar 27, 2024
5 checks passed
@goeiecool9999 goeiecool9999 deleted the inifiniteloopfix branch March 27, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants