Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A GitHub action allowing you to check for memory leaks on your binaries, libraries and unit tests.

NotificationsYou must be signed in to change notification settings

Ximaz/valgrind-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

A GitHub Action for checking your memory management usingValgrind.

This Action will check for :

  • unfree'd memory,
  • invalidread orwrite operations,
  • unclose'd file descriptors (files and sockets),
  • invalid usage offree,delete,delete [] orrealloc,
  • uninitialisedsyscall params,
  • overlaps between sources and destinations formemcpy,memmove, etc...,
  • fishy arguments (possibly negative values) forunsigned expected,
  • memory allocation with a size of0,
  • invalid alignment values.

If you want to have more details about the errors this Action supports, you cancheck the4.2. Explanation of error messages from Memcheck section.

Usage

-uses:Ximaz/valgrind-action@v1.2.0with:# Either absolute or reative path to the binary you want to check the# memory on.binary_path:""# A string containing all the arguments to pass the the binary when it# gets checked by Valgrind.## Default: ""binary_args:""# The value of the `LD_LIBRARY_PATH` environment variable so that the# binary can be executed with your custom libraries, if any.## Default: ""ld_library_path:""# Redzone size used by Valgrind. It represents the blocks that Valgrind# will check before, and after any allocated pointer so that it will# look if you're trying to operate on those bytes, which you are not# supposed to.## Default: 16redzone_size:16# Whether or not to track unclosed file descriptors.# Default: truetrack_file_descriptors:true# Whether or not to treat error as warning. This implies that, if set# to true, then the action will not exit with an error status, even if# Valgrind found issues during the binary execution. Also, this implies# that in your workflow summary, you will see warning annotations# instead of error ones.## Default: falsetreat_error_as_warning:false# Valgrind suppressions. If specified, the content will be written into# a local file which will be passed to Valgrind. It represents a set of# specific checks to avoid. For instance, you can avoid checks for a# specific function, inside a specific program or library, etc...# Foe more detail, you can check the `2.5. Suppressing errors` section# on the Valgrind's documentation :# https://valgrind.org/docs/manual/manual-core.html## For each found error by Valgrind, a generated suppression will be# logged inside your workflow's logs. That way, you will be able to see# if any dependency, unrelated to your implementation, is faulty for# not free'ing it's own memory or file descriptors.## Generally, you want to avoid using this because you may tend to use# it badly in order to suppress errors about your own implemnetations,# so be careful.## Default: ""## The example below showcases how to avoid checking for the `free`# function, inside the `main` function.valgrind_suppressions:|            {                DontCheckFreeInMain                Memcheck:Free                fun:free                fun:main            }# Whether or not Valgrind should be verbose. It may be useful in case# you want to debug things.## Default: falseverbose:false# Limit the amount of time Valgrind runs before stopping the binary,# specified in floating point with an optional suffix. A duration of 0# disables the timeout.## This can be useful to test or bound a long-running process.## Optional suffix:# - 's' for seconds (the default)# - 'm' for minutes# - 'h' for hours# - 'd' for days## Default: 0stimeout:0s

[8]ページ先頭

©2009-2025 Movatter.jp