1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

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  (<unknown module>)
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  (<unknown module>)
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.
This commit is contained in:
Evgeny Vereshchagin 2019-01-30 02:19:45 +01:00
parent 8605a4b9eb
commit d56db495de

View File

@ -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
}