From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5803 invoked by alias); 16 Aug 2009 18:55:57 -0000 Received: (qmail 5793 invoked by uid 22791); 16 Aug 2009 18:55:57 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 16 Aug 2009 18:55:49 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7GItlY5008197 for ; Sun, 16 Aug 2009 14:55:47 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7GItl8W026628 for ; Sun, 16 Aug 2009 14:55:47 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7GItjmF003519 for ; Sun, 16 Aug 2009 14:55:46 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n7GItiDE020399 for ; Sun, 16 Aug 2009 20:55:44 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n7GIthUR020382 for gdb-patches@sourceware.org; Sun, 16 Aug 2009 20:55:43 +0200 Date: Sun, 16 Aug 2009 21:19:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] [ia64] No start when GDB built with -lmcheck Message-ID: <20090816185543.GA19581@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) 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: 2009-08/txt/msg00222.txt.bz2 Hi, build GDB with -lmcheck (valgrind would be similar) to get: $ gdb -nx -ex r --args ./gdb -nx -ex r true ... Program received signal SIGSEGV, Segmentation fault. 0x40000000002725c0 in init_regcache_descr (gdbarch=0x6000000000114660) at regcache.c:132 132 descr->sizeof_register[i] = TYPE_LENGTH (descr->register_type[i]); (gdb) p i $1 = 128 (gdb) p descr->register_type[i] $2 = (struct type *) 0x9393939393939393 #0 ia64_ext_type (gdbarch=0x6000000000114660) at ia64-tdep.c:303 303 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); (gdb) n 305 if (!tdep->ia64_ext_type) (gdb) p tdep->ia64_ext_type $2 = (struct type *) 0x9393939393939393 (gdb) l 300 static struct type * 301 ia64_ext_type (struct gdbarch *gdbarch) 302 { 303 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); 304 305 if (!tdep->ia64_ext_type) 306 tdep->ia64_ext_type 307 = arch_float_type (gdbarch, 128, "builtin_type_ia64_ext", 308 floatformats_ia64_ext); 309 The two conflictin lines: commit c342e22343e36692fce21de338d3175cc33a3dc2 Author: Kevin Buettner - tdep = xmalloc (sizeof (struct gdbarch_tdep)); commit ec51d99d066d5d460b4f1722d894deeb7b4963e9 Author: Ulrich Weigand 305 if (!tdep->ia64_ext_type) Thanks, Jan gdb/ 2009-08-16 Jan Kratochvil Fix ia64 start crash when GDB built with -lmcheck. * ia64-tdep.c (ia64_gdbarch_init): Allocate TDEP as cleared. --- gdb/ia64-tdep.c 30 Jul 2009 16:29:53 -0000 1.195 +++ gdb/ia64-tdep.c 16 Aug 2009 18:30:21 -0000 @@ -3671,7 +3671,7 @@ ia64_gdbarch_init (struct gdbarch_info i if (arches != NULL) return arches->gdbarch; - tdep = xmalloc (sizeof (struct gdbarch_tdep)); + tdep = xzalloc (sizeof (struct gdbarch_tdep)); gdbarch = gdbarch_alloc (&info, tdep); tdep->sigcontext_register_address = 0;