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

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