Official link: https://valgrind.org/
Valgrind Home
Valgrind is an instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail. You can also use Valgrind to build new tool
valgrind.org
Install:
sudo apt install valgrind # Ubuntu, Debian, etc.
sudo yum install valgrind # RHEL, CentOS, Fedora, etc.
sudo pacman -Syu valgrind # Arch, Manjaro, Garuda, etc
내부적으로 GDB를 사용하기 때문에 addr2line같은 것들이 제대로 동작해야 한다.
이전 포스팅에서 추가했던 secure compile option들을 넣으면 안된다.
대신 -g를 추가하여 debugging이 가능하도록 해야 한다.
https://bluelimn.tistory.com/entry/secure-compile
secure compile
checksec를 통해 secure compile 정보를 알 수 있다. https://github.com/slimm609/checksec.sh GitHub - slimm609/checksec.sh: Checksec.sh Checksec.sh. Contribute to slimm609/checksec.sh development by creating an account on GitHub. github.com 우선 3
bluelimn.tistory.com
ref: https://stackoverflow.com/questions/5134891/how-do-i-use-valgrind-to-find-memory-leaks
valgrind --leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--verbose \
--log-file=valgrind-out.txt \
./executable exampleParam1
'Programming > linux왕초보' 카테고리의 다른 글
secure compile (0) | 2023.04.02 |
---|---|
REPO_URL 수정하여 local에서 repo 사용 (0) | 2022.08.23 |
[Linux] print file path (0) | 2021.12.22 |
[python] read file, write file (0) | 2021.12.15 |
ssh사용 시 diffie-hellman-group1-sha1 관련 (0) | 2018.01.30 |
pthread min, max priority on linux (0) | 2017.06.12 |
use vim like as source insight (0) | 2016.04.06 |
[ubuntu] change default shell (0) | 2016.03.22 |
GDB를 사용한 CORE 파일의 분석 (0) | 2016.02.05 |
kernel make menuconfig error (0) | 2016.01.21 |