From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14604 invoked by alias); 3 Aug 2012 21:02:31 -0000 Received: (qmail 14595 invoked by uid 22791); 3 Aug 2012 21:02:30 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,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; Fri, 03 Aug 2012 21:02:08 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q73L28u9006360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 3 Aug 2012 17:02:08 -0400 Received: from host2.jankratochvil.net (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q73L24g8002723 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 3 Aug 2012 17:02:07 -0400 Date: Fri, 03 Aug 2012 21:02:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFC: one approach to fixing PR 14100 Message-ID: <20120803210203.GA21083@host2.jankratochvil.net> References: <87r4rpqnng.fsf@fleche.redhat.com> <877gtgneto.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877gtgneto.fsf@fleche.redhat.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: 2012-08/txt/msg00126.txt.bz2 On Fri, 03 Aug 2012 18:02:59 +0200, Tom Tromey wrote: > * dwarf2-frame.c (dwarf2_frame_cache): Set *this_cache at > return only. > * frame-unwind.h (frame_sniffer_ftype): Document prologue > cache initialization constraint. FYI I got now the assertion from ppc64 gdb.threads/watchpoint-fork.exp. That is without this patch: #5 0x00000000103e071c in internal_error (file=0x1065c308 "frame.c", line=2396, string=0x1065c2e8 "%s: Assertion `%s' failed.") at utils.c:882 #6 0x00000000103f12f4 in frame_cleanup_after_sniffer (arg=0x100106162f0) at frame.c:2396 #7 0x00000000101dcfc4 in do_my_cleanups (pmy_chain=0x1077cee8, old_chain=0x1060c5f0) at cleanups.c:155 #8 0x00000000101dd0b4 in do_cleanups (old_chain=0x1060c5f0) at cleanups.c:177 #9 0x0000000010279cf0 in throw_exception (exception=...) at exceptions.c:227 #10 0x00000000103f1fe4 in frame_unwind_find_by_frame (this_frame=0x100106162f0, this_cache=0x10010616308) at frame-unwind.c:123 (gdb) p ex $2 = {reason = RETURN_ERROR, error = GENERIC_ERROR, message = 0x10010a00d50 "reading register r31 (#31): No such process."} But with this patch it gets endless crashing loop, even on x86*, this is from ppc64. This patch could not be x86* regression tested. #43574 0x00000000103539a0 in dwarf2_frame_cache (this_frame=0x10012c9fc50, this_cache=0x10012c9fc68) at dwarf2-frame.c:1225 #43575 0x0000000010353bd0 in dwarf2_frame_prev_register (this_frame=0x10012c9fc50, this_cache=0x10012c9fc68, regnum=64) at dwarf2-frame.c:1270 #43576 0x00000000103ed22c in frame_unwind_register_value (frame=0x10012c9fc50, regnum=64) at frame.c:952 #43577 0x00000000103ecbd8 in frame_register_unwind (frame=0x10012c9fc50, regnum=64, optimizedp=0xfffe35daa88, unavailablep=0xfffe35daa8c, lvalp= 0xfffe35daa94, addrp=0xfffe35daa98, realnump=0xfffe35daa90, bufferp=0xfffe35dab48 "") at frame.c:858 #43578 0x00000000103ecfd0 in frame_unwind_register (frame=0x10012c9fc50, regnum=64, buf=0xfffe35dab48 "") at frame.c:912 #43579 0x00000000103ed748 in frame_unwind_register_unsigned (frame=0x10012c9fc50, regnum=64) at frame.c:1024 #43580 0x000000001007605c in rs6000_unwind_pc (gdbarch=0x10012cbbc90, next_frame=0x10012c9fc50) at rs6000-tdep.c:3111 #43581 0x00000000102981f4 in gdbarch_unwind_pc (gdbarch=0x10012cbbc90, next_frame=0x10012c9fc50) at gdbarch.c:2839 #43582 0x000000001035848c in dwarf2_tailcall_sniffer_first (this_frame=0x10012c9fc50, tailcall_cachep=0x10012c9fd40, entry_cfa_sp_offsetp=0xfffe35dae28) at dwarf2-frame-tailcall.c:387 #43583 0x00000000103539a0 in dwarf2_frame_cache (this_frame=0x10012c9fc50, this_cache=0x10012c9fc68) at dwarf2-frame.c:1225 #43584 0x00000000103542e0 in dwarf2_frame_sniffer (self=0x1064e840, this_frame=0x10012c9fc50, this_cache=0x10012c9fc68) at dwarf2-frame.c:1403 #43585 0x00000000103f1f88 in frame_unwind_find_by_frame (this_frame=0x10012c9fc50, this_cache=0x10012c9fc68) at frame-unwind.c:112 This is because dwarf2_tailcall_sniffer_first at the end of dwarf2_frame_cache needs to have THIS_FRAME already finalized, therefore with the cache, as it needs to access the previous (unwound) frame. Thanks, Jan