Issue #1072: add LSAN_DO_LEAK_CHECK
macro
#1073
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is just a proposal, but the general ideas are ready do be reviewed:
The motivation in the decision to close issue 293 is to call lsan explicitly and early. As a possible future extension, lsan could be runnable upon request from Python system_tests (via skmanage, for example)?
The disadvantage of this is that it will become impossible to start an lsan-enabled router multiple times in the same process (which is what (currently disabled) cpp_system tests do, (when run with lsan)). Whether such ability is (or might be in the future) valuable regarding improved testability is up to a discussion. From what I observed so far, it is not very promising avenue.
Other projects (like CPython) usually have some special leak-checking mode that is enabled with sanitizers. For example, python has an allocation list that collects all allocations so that they can be then orderly freed upon exit, if lsan is watching. This seems a bit too much like a silly workaround and waste of effort on first sight, but it gives them the ability to use this to fix leaks that happen during regular runtime (if you fix all leaks, then you will naturally fix also the important ones).