From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2452 invoked by alias); 20 Mar 2011 18:49:09 -0000 Received: (qmail 2441 invoked by uid 22791); 20 Mar 2011 18:49:08 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,LOTS_OF_MONEY,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,TW_JC,TW_UU,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 20 Mar 2011 18:49:00 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2KImo2A014081 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 20 Mar 2011 14:48:50 -0400 Received: from host1.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p2KImlF2031652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 Mar 2011 14:48:49 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p2KImlxJ030851; Sun, 20 Mar 2011 19:48:47 +0100 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p2KImj4s030845; Sun, 20 Mar 2011 19:48:45 +0100 Date: Mon, 21 Mar 2011 10:09:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Regression: graceful unwind termination when we'd need unavailable/uncollect memory or registers to unwind further Message-ID: <20110320184845.GA30084@host1.jankratochvil.net> References: <201102221834.42413.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201102221834.42413.pedro@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00947.txt.bz2 Hi Pedro, on a testfile from the Fedora patchset there is a regression, IMO a valid one: e67dca4a095f4db1022fd0753ef0bda3873dc1bc is the first bad commit commit e67dca4a095f4db1022fd0753ef0bda3873dc1bc Author: Pedro Alves Date: Fri Mar 18 18:52:28 2011 +0000 gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. [...] :040000 040000 6bdd3071cc91073d64ffd2a1030c44ce2b1956b9 a4487e736a1087aee5d5b5207cee5a56ae936f42 M gdb bisect run success http://pkgs.fedoraproject.org/gitweb/?p=gdb.git;a=blob_plain;f=gdb-6.8-bz457187-largefile-test.patch;hb=f15/master = This file is included in this mail. (gdb) x/i 0x400078 0x400078: hlt PASS: gdb.arch/i386-biarch-core.exp: .text is readable -> (gdb) x/i 0x400078 PC not available FAIL: gdb.arch/i386-biarch-core.exp: .text is readable The core file does not have accessible registers. It was not a goal of the testcase, it tests something else. But it has found this unrelated regression. I believe one should be able to evaluate PC-indepenent expressions even if PC is not available. Even the first part is regressing (although it stays PASS->PASS): (gdb) core-file gdb.arch/i386-biarch-core.core [New LWP 6901] warning: Couldn't recognize general-purpose registers in core file. Core was generated by `./bad'. Program terminated with signal 11, Segmentation fault. warning: Couldn't recognize general-purpose registers in core file. #0 0x00000000 in ?? () -> (gdb) core-file gdb.arch/i386-biarch-core.core [New LWP 6901] warning: Couldn't recognize general-purpose registers in core file. PC register is not available The core file reason is not displayed while it could be, I have tried the following patch does not help in this case: [patch 3/3] Display core reasons even during thread error http://sourceware.org/ml/gdb-patches/2011-02/msg00675.html Thanks, Jan --- /dev/null 2009-04-19 14:49:00.974648389 +0200 +++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.exp 2009-04-19 16:30:12.000000000 +0200 @@ -0,0 +1,61 @@ +# This testcase is part of GDB, the GNU debugger. + +# Copyright 2009 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Test ability to load an elf64-i386 core file. The provided core file was +# elf64-x8664 one but it got binary patched to i386: +# Elf32_Ehdr.e_machine @0x12..0x13 +# Elf64_Ehdr.e_machine @0x12..0x13 +# #define EM_386 3 /* Intel 80386 */ +# #define EM_X86_64 62 /* AMD x86-64 architecture */ +# patch @0x12: 0x3E -> 0x03 + +if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then { + verbose "Skipping i386-biarch-core test." + return +} + +set testfile "i386-biarch-core" +set corebz2uufile ${srcdir}/${subdir}/${testfile}.core.bz2.uu +set corefile ${objdir}/${subdir}/${testfile}.core +# Entry point of the original executable. +set address 0x400078 + +if {[catch "system \"uudecode -o - ${corebz2uufile} | bzip2 -dc >${corefile}\""] != 0} { + untested "failed uudecode or bzip2" + return -1 +} +file stat ${corefile} corestat +if {$corestat(size) != 102400} { + untested "uudecode or bzip2 produce invalid result" + return -1 +} + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir + +# Wrongly built GDB complains by: +# "..." is not a core dump: File format not recognized +# As the provided test core has 64bit PRSTATUS i386 built GDB cannot parse it. +# This is just a problem of the test care, real-world elf64-i386 file will have +# 32bit PRSTATUS. One cannot prepare elf64-i386 core file from elf32-i386 by +# objcopy as it corrupts the core file beyond all recognition. +# "\r\nCore was generated by `\[^\r\n\]*'\\.\r\nProgram terminated with signal 11, Segmentation fault\\.\r\n.*" +gdb_test "core-file ${corefile}" + +gdb_test "x/i $address" "\r\n\[ \t\]*$address:\[ \t\]*hlt\[ \t\]*" ".text is readable" --- /dev/null 2009-04-19 14:49:00.974648389 +0200 +++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.S 2009-04-19 14:52:28.000000000 +0200 @@ -0,0 +1,22 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2009 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + .globl _start +_start: + hlt --- /dev/null 2009-04-19 14:49:00.974648389 +0200 +++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.core.bz2.uu 2009-04-19 15:02:12.000000000 +0200 @@ -0,0 +1,13 @@ +begin 600 i386-biarch-core.core.bz2 +M0EIH.3%!629361`P1\P`!)?_____\9'@"8Q)6P380'9@'&#`0D@``"``%(`` +M@`#`"!<(L`%F"(:$GH13::F-)M&D&U,AD:`--#)M0&FT0XR9--,)D9`P(Q-& +M",(-&F``02)%38HT]0T`&AH```'H@``T^>9T*(,("&)SE`>`9@+GP=[,N)KB +M'I8BL(L]N5TCY\%V]/?DB.BN*UZ'U@]TN7-]UJ5\_%0QTT<*086#%MHT7XVJ +M9D"+C!"2*L:8D1XPD!`--M@*XT1H5RFYN&)(!0P0#:`I:;2;$5M&\*9"0@%: +MK@X[T()M)9N7`D$VA!^63)%,;@8LT`(7\K&[7G;U:"B6'!GG+46ALOZF.2F- +M!@>C*%86X$-]C2`KE;HG)UL(913VR2G]0BD:J=Z_`G@S,`W%.8RMS-#5P:J0 +MAJ2\8&X?@DE;UF68QHM<,D`('::J65/S:PAG*R-09["8DBI)'V]Y.[(/AM*L +M"X_O^V;%FY.S6Q]FM=D37>5F,%4-F1ZF#,CFJVU;H*^IT<(%