Blame SOURCES/gdb-6.5-last-address-space-byte-test.patch

4416f5
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
4416f5
From: Fedora GDB patches <invalid@email.com>
4416f5
Date: Fri, 27 Oct 2017 21:07:50 +0200
4416f5
Subject: gdb-6.5-last-address-space-byte-test.patch
4416f5
4416f5
;; Testcase for deadlocking on last address space byte; for corrupted backtraces.
4416f5
;;=fedoratest
4416f5
4416f5
diff --git a/gdb/testsuite/gdb.base/largecore-last-address-lock.exp b/gdb/testsuite/gdb.base/largecore-last-address-lock.exp
4416f5
new file mode 100644
4416f5
--- /dev/null
4416f5
+++ b/gdb/testsuite/gdb.base/largecore-last-address-lock.exp
4416f5
@@ -0,0 +1,49 @@
4416f5
+# Copyright 2006 Free Software Foundation, Inc.
4416f5
+
4416f5
+# This program is free software; you can redistribute it and/or modify
4416f5
+# it under the terms of the GNU General Public License as published by
4416f5
+# the Free Software Foundation; either version 2 of the License, or
4416f5
+# (at your option) any later version.
4416f5
+#
4416f5
+# This program is distributed in the hope that it will be useful,
4416f5
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
4416f5
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4416f5
+# GNU General Public License for more details.
4416f5
+#
4416f5
+# You should have received a copy of the GNU General Public License
4416f5
+# along with this program; if not, write to the Free Software
4416f5
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4416f5
+
4416f5
+if $tracelevel then {
4416f5
+    strace $tracelevel
4416f5
+}
4416f5
+
4416f5
+# Get things started.
4416f5
+
4416f5
+gdb_exit
4416f5
+gdb_start
4416f5
+
4416f5
+# i386 (32-bit) only: gdb with Red Hat largecore patch did lock up:
4416f5
+# https://enterprise.redhat.com/issue-tracker/?module=issues&action=view&tid=103263
4416f5
+# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=210614
4416f5
+
4416f5
+# i386: Bug exists when the `target_xfer_memory' condition
4416f5
+# `(memaddr + len < region->hi)' operates on 64-bit operands on
4416f5
+# largecore-patched with 32-bit addresses and so it can get `false' with
4416f5
+# arbitrary `len'.
4416f5
+
4416f5
+# x86_64: The bug is not present as the operands and calculations have the same
4416f5
+# bit size.  Would would still need to pass there the highest address
4416f5
+# (`memaddr == 0xffffffffffffffff') but we would need to pass `len == 0'
4416f5
+# to make the condition `(memaddr + len < region->hi)' false.
4416f5
+# `len == 0' would get caught eariler.
4416f5
+
4416f5
+# Error in the success case is immediate.
4416f5
+set timeoutold ${timeout}
4416f5
+set timeout 10
4416f5
+
4416f5
+gdb_test "x/xb 0xffffffff" \
4416f5
+         "Cannot access memory at address 0xffffffff" \
4416f5
+         "Read the last address space byte"
4416f5
+
4416f5
+set timeout ${timeoutold}