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

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