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

ci: build with sanitizer to check for memory issues #109

Merged
merged 3 commits into from
Dec 14, 2022

Conversation

pinheadmz
Copy link
Member

@pinheadmz pinheadmz commented Nov 22, 2022

Closes #104

Built off #99 which fixes some memory leaks.

This PR adds a flag configure --with-sanitizers=<sanitizers> where <sanitizers> is a comma separated list of sanitizers like address,leak. I borrowed the configure logic from Bitcoin Core: https://github.com/bitcoin/bitcoin/blob/38d06e1561013f4ca845fd5ba6ffcc64de67f9c0/configure.ac#L315-L319

The flag is added to CI integration tests. I intentionally committed a few memory violations and then patched them to demonstrate to reviewers how this will look (it's a bit of a mess, but works by throwing errors in the bmocha suite).

example memory leak detected: https://github.com/handshake-org/hnsd/actions/runs/3527082949/jobs/5915748956#step:8:645

example use-after-free detected: https://github.com/handshake-org/hnsd/actions/runs/3527133001/jobs/5915851526#step:8:34

@pinheadmz pinheadmz force-pushed the ci-sanitize branch 3 times, most recently from c4e1ddf to 76ac1b5 Compare November 22, 2022 21:05
@pinheadmz pinheadmz marked this pull request as ready for review November 23, 2022 14:25
@pinheadmz pinheadmz added this to the v2.0.0 milestone Nov 23, 2022
@pinheadmz pinheadmz force-pushed the ci-sanitize branch 3 times, most recently from 345651e to ca16ec4 Compare December 12, 2022 17:29
@pinheadmz pinheadmz merged commit eea9d14 into handshake-org:master Dec 14, 2022
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.

1 participant