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

rpmalloc and msvc asan #319

Open
plekakis opened this issue Dec 17, 2023 · 4 comments
Open

rpmalloc and msvc asan #319

plekakis opened this issue Dec 17, 2023 · 4 comments
Assignees

Comments

@plekakis
Copy link

I am not currently sure if it's a false-positive or a valid issue, but MSVC 2022 address sanitizer complains when rpmalloc is used as the allocation method. I suspect it's a false positive as I have no runtime errors when allocating and freeing a lot of data over several frames (it's a game engine's stress test).

Is this worth investigating (and has rpmalloc been tested with asan)?

@mjansson
Copy link
Owner

I have not tested it with asan - do you have any details you can share of what it's complaining about?

Would be very interested in looking into this, both in the develop branch and also (if you have time) in the mjansson/rewrite branch

@mjansson mjansson self-assigned this Dec 22, 2023
@plekakis
Copy link
Author

plekakis commented Dec 22, 2023 via email

@SunnyPaprika
Copy link

Here is how rpmalloc can be used with ASAN under and MSVC.

https://learn.microsoft.com/en-us/cpp/sanitizers/asan-runtime?view=msvc-170#custom-allocators-and-the-addresssanitizer-runtime

I did choose another way. I made wrapper function around the rpmalloc functions and control with a define if rpmalloc or if the default memory functions should be used. When ASAN is active then default CRT memory functions like malloc are used. This will catch if I did something stupid. The only downside is, it will not catch errors caused by rpmalloc.

@plekakis
Copy link
Author

plekakis commented Jan 5, 2024 via email

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

3 participants