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