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] Run tests with valgrind mem checker #9

Open
nitely opened this issue May 16, 2024 · 1 comment
Open

[CI] Run tests with valgrind mem checker #9

nitely opened this issue May 16, 2024 · 1 comment

Comments

@nitely
Copy link
Owner

nitely commented May 16, 2024

Either valgrind or a memory sanitizer:

nim r -d:danger --mm:orc --debugger:native -d:useMalloc --debuginfo:on --linedir:on --passC:'-fno-omit-frame-pointer' --passC:'-mno-omit-leaf-frame-pointer' --passC:"-fsanitize=address" --passL:"-fsanitize=address" tests/testclient.nim
nim c -d:danger --mm:orc --debugger:native --threads:off -d:useMalloc tests/testclient.nim && valgrind --leak-check=full --show-leak-kinds=all ./tests/testclient

Yet another, maybe better way is to pass -d:nimAllocStats and use getAllocStats() and check stats.allocCount == stats.deallocCount

@nitely nitely changed the title Run tests with valgrind mem checker [CI] Run tests with valgrind mem checker May 16, 2024
@nitely
Copy link
Owner Author

nitely commented May 17, 2024

blocked by nim-lang/Nim#23615

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