tests/functional/x86_64/meson.build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
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>
---
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
On 09/03/2026 11.45, Peter Maydell wrote:
> 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>
> ---
> 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',
Reviewed-by: Thomas Huth <thuth@redhat.com>
On 3/9/26 4:39 AM, Thomas Huth wrote: > On 09/03/2026 11.45, Peter Maydell wrote: >> 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> >> --- >> tests/functional/x86_64/meson.build | 9 ++++++++- >> 1 file changed, 8 insertions(+), 1 deletion(-) >> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
© 2016 - 2026 Red Hat, Inc.