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

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