Skip to main content

Using the Valgrind error manager for file descriptor tracking

K.3.201 | Day 1 | 16:25 - 16:50 | Speakers: Alexandra Petlanova Hajkova

Using the Valgrind error manager for file descriptor tracking
A picture of a devroom at FOSDEM 2024
Open in browser
Get involved in the conversation!Join the chat

Notes

Abstract

The valgrind error manager makes it easy for valgrind tools to report issues that can include execution backtraces for multiple events, integrate with gdb, generate xml reports and lets users suppress specific issues. The valgrind error manager contains a fast unwinder which can be used to detect "equivalent" issues.

For valgrind 3.23.0 we introduced "core errors" which are tool independent and can be used to report on core events for resources that are explicitly created and destroyed. We used this to add errors when using file descriptors that can be reported by any valgrind tool by using --track-fds=yes. This allows reporting on bad use of file descriptors, file descriptors that are double closed, used after closing, and file descriptors that "leak". Because these are "normal" valgrind errors all these events can be reported in the xml output, suppressed by the user, intercepted by gdb and integrated in CI runs with --error-exitcode.

For Valgrind 3.24.0 we added bad file descriptor usage errors.

Speakers

Alexandra Petlanova Hajkova

Notice: The placeholder video image is licensed under CC BY-SA 4.0. The original image can be found hereChanges made to the image are: Cropped the image to a new ratio, part of the image was cut off.