From: Evgeny Vereshchagin Date: Wed, 30 Jan 2019 01:19:45 +0000 (+0100) Subject: tests: ignore memory leaks in dbus-daemon X-Git-Tag: v241-rc2~2^2~1 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fsystemd.git;a=commitdiff_plain;h=d56db495de3b189c60f43ea802271b6fecccc4f2 tests: ignore memory leaks in dbus-daemon Otherwise, the test fails on Fedora 28 with ``` Jan 30 01:42:35 systemd-testsuite dbus-daemon[61]: [system] Successfully activated service 'org.freedesktop.systemd1' Jan 30 01:42:35 systemd-testsuite systemd[61]: dbus.service: Kernel keyring access prohibited, ignoring. Jan 30 01:42:35 systemd-testsuite systemd[61]: dbus.service: Executing: /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: ================================================================= Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: ==61==ERROR: LeakSanitizer: detected memory leaks Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: Direct leak of 72 byte(s) in 1 object(s) allocated from: Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: #0 0x7f21f9e29088 in __interceptor_realloc (/usr/lib64/libasan.so.5+0xef088) Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: #1 0x7f21f9b1b23c (/lib64/libdbus-1.so.3+0x3323c) Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: #2 0x240000001b () Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: Direct leak of 16 byte(s) in 1 object(s) allocated from: Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: #0 0x7f21f9e29088 in __interceptor_realloc (/usr/lib64/libasan.so.5+0xef088) Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: #1 0x7f21f9b1b23c (/lib64/libdbus-1.so.3+0x3323c) Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: #2 0x7ffffffff () Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: SUMMARY: AddressSanitizer: 88 byte(s) leaked in 2 allocation(s). ``` The leaks were reported and fixed in https://bugs.freedesktop.org/show_bug.cgi?id=107320. --- diff --git a/test/test-functions b/test/test-functions index cb83761a6c3..057be62e890 100644 --- a/test/test-functions +++ b/test/test-functions @@ -485,19 +485,27 @@ check_asan_reports() { ret=$(($ret+1)) fi - journald_report=$(find "$root" -name "systemd-journald.asan.log*" -exec cat {} \;) - if [[ ! -z "$journald_report" ]]; then + journald_report=$(find "$root" -name "systemd-journald.asan.log*" -exec cat {} \;) + if [[ ! -z "$journald_report" ]]; then printf "%s" "$journald_report" ret=$(($ret+1)) - fi + fi - pids=$("$BUILD_DIR/journalctl" -D "$root/var/log/journal" | perl -alne 'print $1 if /\[(\d+)\]:\s*SUMMARY:\s+\w+Sanitizer/') - if [[ ! -z "$pids" ]]; then + pids=$( + "$BUILD_DIR/journalctl" -D "$root/var/log/journal" | perl -alne ' + BEGIN { + %services_to_ignore = ( + "dbus-daemon" => undef, + ); + } + print $2 if /\s(\S*)\[(\d+)\]:\s*SUMMARY:\s+\w+Sanitizer/ && !exists $services_to_ignore{$1}' + ) + if [[ ! -z "$pids" ]]; then ret=$(($ret+1)) for pid in $pids; do "$BUILD_DIR/journalctl" -D "$root/var/log/journal" _PID=$pid --no-pager done - fi + fi fi return $ret @@ -1582,7 +1590,7 @@ test_run() { else dwarn "can't run systemd-nspawn, skipping" fi - fi + fi fi return 0 }