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

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