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

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