aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-04-18 17:01:09 +0200
committerTom de Vries <tdevries@suse.de>2024-04-18 17:01:09 +0200
commitb0c431de3f04e5e97cff0ec917dd457696efd43e (patch)
tree82d1c07b2cbec7157ac8107830cdd9e0e46760d1 /gdb/testsuite/gdb.python
parent523e454fab831e07c83a648c5d07370375a1c376 (diff)
downloadgdb-b0c431de3f04e5e97cff0ec917dd457696efd43e.zip
gdb-b0c431de3f04e5e97cff0ec917dd457696efd43e.tar.gz
gdb-b0c431de3f04e5e97cff0ec917dd457696efd43e.tar.bz2
[gdb/testsuite] Use allocator_may_return_null=1 in two test-cases
Simon reported [1] that recent commit 06e967dbc9b ("[gdb/python] Throw MemoryError in inferior.read_memory if malloc fails") introduced AddressSanitizer allocation-size-too-big errors in the two test-cases affected by this commit. Fix this by suppressing the error in the two test-cases using allocator_may_return_null=1. Tested on aarch64-linux. Approved-By: Tom Tromey <tom@tromey.com> [1] https://sourceware.org/pipermail/gdb-patches/2024-April/208171.html
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r--gdb/testsuite/gdb.python/py-inferior.exp10
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.python/py-inferior.exp b/gdb/testsuite/gdb.python/py-inferior.exp
index 4c19e25..e74fbfd 100644
--- a/gdb/testsuite/gdb.python/py-inferior.exp
+++ b/gdb/testsuite/gdb.python/py-inferior.exp
@@ -27,7 +27,15 @@ if { [gdb_compile_pthreads ${srcdir}/${subdir}/${srcfile} ${binfile} executable
}
# Start with a fresh gdb.
-clean_restart ${testfile}
+save_vars { env(ASAN_OPTIONS) } {
+ # The call to gdb.selected_inferior().read_memory (0, 0xffffffffffffffff)
+ # triggers address sanitizer. Suppress the error, leaving us with just
+ # this warning:
+ # WARNING: AddressSanitizer failed to allocate 0xffffffffffffffff bytes
+ set_sanitizer ASAN_OPTIONS allocator_may_return_null 1
+
+ clean_restart ${testfile}
+}
switch [get_endianness] {
little { set python_pack_char "<" }