Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [patch] [ia64] No start when GDB built with  -lmcheck
Date: Sun, 16 Aug 2009 21:19:00 -0000	[thread overview]
Message-ID: <20090816185543.GA19581@host0.dyn.jankratochvil.net> (raw)

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 <kevinb@redhat.com>
-  tdep = xmalloc (sizeof (struct gdbarch_tdep));

commit ec51d99d066d5d460b4f1722d894deeb7b4963e9
Author: Ulrich Weigand <uweigand@de.ibm.com>
305       if (!tdep->ia64_ext_type)


Thanks,
Jan

gdb/
2009-08-16  Jan Kratochvil  <jan.kratochvil@redhat.com>

	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;


             reply	other threads:[~2009-08-16 18:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-16 21:19 Jan Kratochvil [this message]
2009-08-17 18:50 ` Tom Tromey
2009-08-25 14:18   ` Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090816185543.GA19581@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox