@samitouri / QOSamiQemu / commits / 558e1d7a15

tests/functional/x86_64: Disable memlock test for asan builds

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 <pierrick.bouvier@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-ID: <20260309104545.1550888-1-peter.maydell@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>

Peter Maydell committed Mar 9, 2026 at 10:45 UTC 558e1d7a15e36cae8918e4c75677ed13c19936e3
1 file changed +8 -1
tests/functional/x86_64/meson.build
+8 -1
@@ -14,13 +14,20 @@ tests_x86_64_system_quick = [
14 'cpu_model_versions',
15 'cpu_queries',
16 'mem_addr_space',
17 - 'memlock',
17 'migration',
18 'pc_cpu_hotplug_props',
19 'virtio_version',
20 'vmstate',
21 ]
22
23 +# The address-sanitizer makes mlock() a no-op because it
24 +# interacts badly with the sanitizer; this means the memlock
25 +# test (which checks via /proc for whether pages were locked)
26 +# will always fail on a sanitizer build, so don't run it.
27 +if not get_option('asan')
28 + tests_x86_64_system_quick += [ 'memlock' ]
29 +endif
30 +
31 tests_x86_64_system_thorough = [
32 'acpi_bits',
33 'hotplug_blk',