The address-sanitizer intercepts mlock() and makes it a no-op, because it interacts badly with the sanitizer's own use of large amounts of memory. This means that our 'memlock' test will always fail, because it checks via /proc for whether the QEMU process really locked some pages. Don't add the test when QEMU is built with asan.
Suggested-by: Pierrick Bouvier <[email protected]> Signed-off-by: Peter Maydell <[email protected]> --- tests/functional/x86_64/meson.build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/functional/x86_64/meson.build b/tests/functional/x86_64/meson.build index 05e4914c77..1ed10ad6c2 100644 --- a/tests/functional/x86_64/meson.build +++ b/tests/functional/x86_64/meson.build @@ -14,13 +14,20 @@ tests_x86_64_system_quick = [ 'cpu_model_versions', 'cpu_queries', 'mem_addr_space', - 'memlock', 'migration', 'pc_cpu_hotplug_props', 'virtio_version', 'vmstate', ] +# The address-sanitizer makes mlock() a no-op because it +# interacts badly with the sanitizer; this means the memlock +# test (which checks via /proc for whether pages were locked) +# will always fail on a sanitizer build, so don't run it. +if not get_option('asan') + tests_x86_64_system_quick += [ 'memlock' ] +endif + tests_x86_64_system_thorough = [ 'acpi_bits', 'hotplug_blk', -- 2.43.0
