Debugging memory issues with Valgrind and GDB - DevConf.CZ 2023

preview_player
Показать описание
Speaker(s): Alexandra Petlanova Hajkova

Buffer overflows, memory leaks, and similar memory issues plague many C and C++ programs. Valgrind is a sophisticated utility for finding low-level programming errors, particularly involving memory use. The GNU Project Debugger (GDB), is a popular tool for use with C/C++ and other languages. We'll show how in the latest Fedora distro they can be used together and how you can get debuginfo for all your system libraries automatically.

I'll show how to use Valgrind and GDB together. It used to be a bit cumbersome to setup them up together. But through recent work upstream and in Fedora it's possible to run gdb as normal, type target valgrind, and start debugging the program which now automatically runs under valgrind inside Gdb. We'll demo finding and debugging memory issues like undefined memory, accessing freed memory and memory leaks all from gdb using the information valgrind provides.

Рекомендации по теме