Skip to content

Fix memory leaks in unit tests - #1661

Closed
nmuggli wants to merge 1 commit into
OpenPrinting:2.4.xfrom
nmuggli:fix-mem-leak
Closed

Fix memory leaks in unit tests#1661
nmuggli wants to merge 1 commit into
OpenPrinting:2.4.xfrom
nmuggli:fix-mem-leak

Conversation

@nmuggli

@nmuggli nmuggli commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

./configure --enable-debug --enable-sanitizer --enable-unit-tests
make -j libs
make unittests

./configure --enable-debug --enable-sanitizer --enable-unit-tests
make -j libs
make unittests
@michaelrsweet michaelrsweet self-assigned this Aug 4, 2026
@michaelrsweet michaelrsweet added the wontfix This will not be worked on label Aug 4, 2026
@michaelrsweet

Copy link
Copy Markdown
Member

This is a known ASAN "feature" on Linux; you need to set ASAN_OPTIONS to "leak_check_at_exit=false" in the environment to suppress these (bogus) memory leak reports since we don't care about them on exit - the OS reclaims all memory and explicitly freeing strings/arrays/etc. is both unnecessary and inefficient. Other platforms that implement the address sanitizer do not have this feature, BTW, just Linux...

If you look at the CI jobs you'll notice that we set the ASAN_OPTIONS environment variable for this reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants