-
Notifications
You must be signed in to change notification settings - Fork 2
Behaviour
The LeakSanitizer allows you to adjust its behaviour using a set of variables.
Since version
- 1.6 they can be set as environment variables
- 1.11 the C API for the behavioral variables is deprecated (find its documentation here)
Indicates whether to print in a human-readable format.
Type: Boolean
Default value: true
Whether to print to the standard output stream.
Type: Boolean
Default value: false
Whether to print the output using ANSI escape codes.
Type: Boolean
Default value: true
Whether to terminate the program once an invalid action is detected.
Type: Boolean
Default value: true
Whether to check for invalid memory deallocations.
Type: Boolean
Default value: true
Whether to issue a warning when deallocating a null pointer.
Type: Boolean
Default value: false
Whether to activate the statistical bookkeeping.
The C API for the statistics is only functional if either this variable is set to true
or LSAN_AUTO_STATS
is set to a valid time interval.
Type: Boolean
Default value: false
Defines the number of lines for a callstack to print.
Type: Non-negative integral number
Default value: 20
Whether to print the callstack of the exit point.
Might lead to strange callstacks since calling exit
may optimize the stack for never returning from that function.
Type: Boolean
Default value: false
Since: v1.7
Whether to print the binary file names associated with a particular call frame within stacktraces.
Type: Boolean
Default value: true
Since: v1.8
Whether to always print function names within stacktraces, even if debug symbols are available.
Type: Boolean
Default value: true
Since: v1.8
Whether to use relative paths where appropriate.
Type: Boolean
Default value: true
Since: v1.8
Whether to issue a warning when allocating zero bytes of memory.
Type: Boolean
Default value: false
Since: v1.8
The time interval for printing the statistics automatically.
Implicitly sets LSAN_STATS_ACTIVE
to true
.
Types: Time interval, non-negative integral number (interpreted as seconds)
Default value: None
Since: v1.11
Whether to print errors and warnings related to the suppression system.
This might be helpful in order to write your own suppression files.
Type: Boolean
Default value: false
Since: v1.11
Whether to print the stacktraces of indirectly leaked memory allocations.
Type: Boolean
Default value: false
Since: v1.11
Whether to print the stacktraces of memory leaks to which a pointer was found.
Type: Boolean
Default value: true
Since: v1.11
List of additional suppression files to be considered.
Type: File list
Default value: None
Since: v1.11
List of additional system library files to be considered.
Type: File list
Default value: None
Since: v1.11
Boolean variables can be assigned a number, they are interpreted as in the programming language C.
They can also be assigned (case-insensitive): true
and false
.
File lists consist of file paths separated by :
.
Time intervals are defined as non-negative integral number, which may immediately be followed by the time unit, of which are supported:
-
ns
: nanoseconds -
us
: microseconds -
ms
: milliseconds -
s
: seconds -
m
: minutes -
h
: hours
Copyright (C) 2022 - 2025 mhahnFr.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.