This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: gdb/638: Seg fault in mk_cv_type of gdbtypes.c on Solaris
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 8 Aug 2002 01:08:00 -0000
- Subject: Re: gdb/638: Seg fault in mk_cv_type of gdbtypes.c on Solaris
- Reply-to: Daniel Jacobowitz <drow at mvista dot com>
The following reply was made to PR gdb/638; it has been noted by GNATS.
From: Daniel Jacobowitz <drow@mvista.com>
To: john.carter@tait.co.nz
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/638: Seg fault in mk_cv_type of gdbtypes.c on Solaris
Date: Wed, 7 Aug 2002 21:00:13 -0400
On Thu, Aug 08, 2002 at 12:55:37AM -0000, john.carter@tait.co.nz wrote:
>
> >Number: 638
> >Category: gdb
> >Synopsis: Seg fault in mk_cv_type of gdbtypes.c on Solaris
> >Confidential: no
> >Severity: serious
> >Priority: medium
> >Responsible: unassigned
> >State: open
> >Class: sw-bug
> >Submitter-Id: net
> >Arrival-Date: Wed Aug 07 17:58:00 PDT 2002
> >Closed-Date:
> >Last-Modified:
> >Originator: John Carter
> >Release: 5.2.1
> >Organization:
> >Environment:
> Solaris UltraSparc 2.5.1
> >Description:
> gdb segfaults and core dumps whilst trying to load a core file.
>
> Inspecting the core produced by gdb shows that it occurs at
> /gdb-5.2.1/gdb/gdbtypes.c:420
>
> Looking at the code ....
> make_cv_type (int cnst, int voltl, struct type *type, struct type **typeptr)
> {
> register struct type *ntype; /* New type */
> register struct type *tmp_type = type; /* tmp type */
> struct objfile *objfile;
>
> ntype = TYPE_CV_TYPE (type);
>
> while (ntype != type)
> {
> if ((TYPE_CONST (ntype) == cnst) && <<<<<==SEGFAULT HERE
> (TYPE_VOLATILE (ntype) == voltl))
> {
> if (typeptr == 0)
> return ntype;
> else if (*typeptr == 0)
> {
> *typeptr = ntype; /* Tracking alloc, and we have new type. */
> return ntype;
> }
> }
> tmp_type = ntype;
> ntype = TYPE_CV_TYPE (ntype);
> }
> ===============================
>
> At that point ntype was zero, but type wasn't.
>
> The bug is perhaps not here, this is perhaps just the symptom.
> >How-To-Repeat:
> Unfortunately can't narrow it down much at this stage.
If you can reproduce this (sounds like you can?) could you try a CVS
snapshot of GDB? See http://sources.redhat.com/gdb/. I believe this
is fixed now, but I'm not quite sure.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer