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

Support running under Valgrind #92

Open
stephenrkell opened this issue Mar 25, 2024 · 1 comment
Open

Support running under Valgrind #92

stephenrkell opened this issue Mar 25, 2024 · 1 comment

Comments

@stephenrkell
Copy link
Owner

Since Valgrind shadows memory eagerly, it blows up when we allocate a large MAP_NORESERVE region, because it tries to eagerly shadow it.

For a long time, we used memtables everywhere and I could not see a reasonable fix. But now we don't use them much... the pageindex is our only huge unreserved mapping.

I had long thought about a special "Valgrind build" that uses a different data structure for the pageindex. However, probably something simpler and cleaner will suffice: map the pageindex lazily. We can install a SIGSEGV handler and do that (and/or how slow would an ensure_mapped() call be at pageindex manipulations?). It works only because we explicitly place all mappings, so we can ensure we never map something else in a place where we may later need to map the pageindex.

@stephenrkell
Copy link
Owner Author

Having said that, Valgrind itself tries to own the memory map and so we may have a tussle on our hands. Someone needs to try this... probably me, for now.

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

1 participant