Skip to content

Fix ASan reported leaks in viewporter-test

Pekka Paalanen requested to merge pq/weston:mr/asan-viewport into main

This depends on !622 (merged).

This time I tackled viewporter-test to make it pass cleanly:

$ ASAN_OPTIONS=fast_unwind_on_malloc=0,malloc_context_size=50 \
LSAN_OPTIONS=suppressions=/home/pq/git/weston/.gitlab-ci/leak-sanitizer.supp \
./tests/test-viewporter

Viewporter-test uses desktop-shell (for no good reason) which means I got to fix ASan reports from weston-desktop-shell and weston-keyboard clients, which means fixing bits of toytoolkit too. Leaks in those clients probably do not count as CI test failing with ASan leak detection enabled, but the leak reports do clutter the output so I decided to just fix them.

This test also uses expect_protocol_error() which needed a small fix in the test harness to be able to free the test data afterwards.

I found two functions in Cairo that seem to be leaking in a way that would need to be fixed in Cairo. These I have added to a leak detection suppression file. The suppression file should be added to the CI ASan setup in the future once we are able to turn on leak detection. Until then, it must be used manually still if you want to run leak checks.

After this MR there are still 25 failing test programs, meaning that this MR fixes two: viewporter and plugin-registry.

Edited by Pekka Paalanen

Merge request reports

Loading