Blame SOURCES/gdb-test-pid0-core.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-test-pid0-core.patch
b2f73e
b2f73e
;; New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435).
b2f73e
;;=fedoratest
b2f73e
b2f73e
https://bugzilla.redhat.com/show_bug.cgi?id=611435
b2f73e
b2f73e
Fix:
b2f73e
Re: [RFA]corelow.c: Add tid to add_to_thread_list
b2f73e
http://sourceware.org/ml/gdb-patches/2010-08/msg00085.html
b2f73e
http://sourceware.org/ml/gdb-cvs/2010-08/msg00026.html
b2f73e
2e5bcfdef1ec3883d48c3f87a4be5c0dff25e17e
b2f73e
b2f73e
diff --git a/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu b/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu
b2f73e
new file mode 100644
b2f73e
--- /dev/null
b2f73e
+++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu
b2f73e
@@ -0,0 +1,20 @@
b2f73e
+begin 600 x86_64-pid0-core.core.bz2
b2f73e
+M0EIH.3%!629362,CA>P!$/'_____^*#EZ-A!SP36P&_:G0#=14``04A&8,'U
b2f73e
+M2*9`>$$)P`*RN"#*;#4R()IJ8C$TT&FC3$&@`T`#:C1H8C0T,@,FC,D"4T2!
b2f73e
+M"/2CU'B90]31ZAD#U`&AZF@/4:``!HT&F@!H<`#0-`-#0``#3$-&F@```#0R
b2f73e
+M``#")2FD]2>4]0TTT-!HTT--,0,"#$`R!I@AD`#1H,3&GZT.4TO$#H40/`0C
b2f73e
+M2$IRXS,<55!8T,&&,R.Z441"?J9I%G6GUA2!.[]Z"C5S[&19,%VS7E6[3"60
b2f73e
+M@`-*2G)QEQ(;?0Y<=MK]/U?Q)LB%+F37TJ9BI*46)H'*Z@V"`"$"P7]&
b2f73e
+M>XZ:JE0E<*:#1M$P3G]>VCI)(A!O$64`5$4`E$$-.``7&(09`8HO`B6K!Q^&
b2f73e
+M562%N)2+0@*HB@%D@5$%!*0!L1&0D4D6\:-$A`)`+<6D82PP*H(J(H!?F;0$
b2f73e
+M%PXB7N!2D4!44`W7"ADEQM6
b2f73e
+M8"W*_;DV<AN#,XRU]Q-J2FDAFKAQ(9A+ZK$MCY#EI8:W-(15>O9TBO5,_]1)
b2f73e
+M($Q2))#),UE,QQK)E$,3D\W.>!4)QO8A_@^Z_SXS
b2f73e
+MW+@WN)O)YO;3:I9YW-A$)N'2
b2f73e
+M,JV"N(Z:@0E#)50BSF)$T6_IN)#"Z8PLQ4UQ9]@Z'+;T]990-:Y:2`P26#!D
b2f73e
+MV+0L6"X@C9`GHAGSY7)%LWOY+E[2/>4;Q8=HV6[:&$@2$@$R29IBW)K%3"O`
b2f73e
+M9^Y0YJ&BXY1U2HTZ5)2H-V\_(.DZHWE+C#WS($(!I"3CUH2#(+(OWUV"*<<9
b2f73e
+MJ%A!J[%O.P&V%GI.`L7<1@0>,^1F\MY=V5UT,&NOG%7TTZ[03!@BHB@&)
b2f73e
+4B.Z!/,0-IZ^W_Q=R13A0D",CA>P`
b2f73e
+`
b2f73e
+end
b2f73e
diff --git a/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp b/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp
b2f73e
new file mode 100644
b2f73e
--- /dev/null
b2f73e
+++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp
b2f73e
@@ -0,0 +1,46 @@
b2f73e
+# This testcase is part of GDB, the GNU debugger.
b2f73e
+# 
b2f73e
+# Copyright 2010 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
+# Some kernel core files have PID 0 - for the idle task.
b2f73e
+
b2f73e
+if ![istarget "x86_64-*-*"] {
b2f73e
+    verbose "Skipping x86_64-pid0-core test."
b2f73e
+    return
b2f73e
+}
b2f73e
+
b2f73e
+set testfile "x86_64-pid0-core"
b2f73e
+set corebz2uufile ${srcdir}/${subdir}/${testfile}.core.bz2.uu
b2f73e
+set corefile [standard_output_file ${testfile}.core]
b2f73e
+
b2f73e
+if {[catch "system \"uudecode -o - ${corebz2uufile} | bzip2 -dc >${corefile}\""] != 0} {
b2f73e
+    untested "failed uudecode or bzip2"
b2f73e
+    return -1
b2f73e
+}
b2f73e
+file stat ${corefile} corestat
b2f73e
+if {$corestat(size) != 8798208} {
b2f73e
+    untested "uudecode or bzip2 produce invalid result"
b2f73e
+    return -1
b2f73e
+}
b2f73e
+
b2f73e
+gdb_exit
b2f73e
+gdb_start
b2f73e
+gdb_reinitialize_dir $srcdir/$subdir
b2f73e
+
b2f73e
+# Former crash was:
b2f73e
+# thread.c:884: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
b2f73e
+gdb_test "core-file ${corefile}" "Program terminated with signal (11|SIGSEGV), Segmentation fault\\.\r\n.*"