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

AddressSanitizer doesn't report the location of memory leaks in unloaded cores #14755

Closed
JesseTG opened this issue Dec 22, 2022 · 4 comments
Closed

Comments

@JesseTG
Copy link
Contributor

JesseTG commented Dec 22, 2022

This ticket is relevant to developers who are using LeakSanitizer to debug memory leaks in cores (not in the frontend).

When a libretro core is unloaded, it takes all the symbols with it. In general, this is desired behavior. However, tools that produce stack traces for programs after they close might still have needed any symbols within those cores.

This means, for example, that LeakSanitizer can't identify the origin of core memory leaks unless RetroArch crashes while the core is still loaded. The leaks themselves are still reported, but the stack trace contains (<unknown module>) instead of a library/function name. See these two tickets in the relevant repo for details.

I'd like to see an option to prevent cores from being unloaded, so that memory leaks within them are easier to identify. Someone on Discord suggested that this could be a CLI-only option, so that some hapless newbie doesn't accidentally cause problems for themself.

@JesseTG
Copy link
Contributor Author

JesseTG commented Jan 17, 2023

Huh, I think HAVE_PRESERVE_DYLIB fits this use case already. See this commit for details.

@LibretroAdmin
Copy link
Contributor

This seems to be a relevant request.

@JesseTG
Copy link
Contributor Author

JesseTG commented Jan 17, 2023

One that might have been resolved eight years ago. Building now, will close if --enable-preserve_dylib fulfills this need.

@JesseTG
Copy link
Contributor Author

JesseTG commented Jan 17, 2023

Ah ha! Using --enable-preserve_dylib in the configure script solves this exact problem. Closing.

@JesseTG JesseTG closed this as completed Jan 17, 2023
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

No branches or pull requests

2 participants