nim-hyperx icon indicating copy to clipboard operation
nim-hyperx copied to clipboard

[CI] Run tests with valgrind mem checker

Open nitely opened this issue 1 year ago • 1 comments

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 avatar May 16 '24 04:05 nitely

blocked by https://github.com/nim-lang/Nim/issues/23615

nitely avatar May 17 '24 02:05 nitely