|
From: Naveen K. <g_n...@ya...> - 2004-09-14 21:44:12
|
Hi all,
Below(far below) is my previous post regarding
this. On further investigation I found that the "spin"
in VG_(st_basetype) [vg_symtypes.c] was because
type = type->u.t_typedef.type = SymType pointer passed
in the below function. Hence the spin forever.
SymType *VG_(st_basetype)(SymType *type, Bool
do_resolve)
{
while (type->kind == TyTypedef || (do_resolve &&
type->kind == TyUnresolved)) {
if (do_resolve)
resolve(type);
if (type->kind == TyTypedef)
{
type = type->u.t_typedef.type;
}
}
return type;
}
The symbol that was being parsed below had already
been parsed previously and I found that the
type->u.t_typedef.type was being set in
VG_(st_mktypedef) [vg_symtypes.c] which in turn was
being called from structDef [vg_stabs.c].
So I do a simple check before calling st_mktypedef
from structDef so that recursion is avoided as shown
below. After making the below change I find that the
program in question could executed by valgrind(and
already it has found some problems!!!).
static SymType *structDef(StabTypeTab *tab, SymType
*def, Bool isstruct, Char *name)
{
static const Bool debug = False;
SymType *ref = structRef(tab, NULL, isstruct,
name);
if (debug)
VG_(printf)("defining %s ref for %s %p -> %p\n",
isstruct ? "struct" : "union", name,
ref, def);
if( ref != def)
def = VG_(st_mktypedef)(ref, name,
VG_(st_basetype)(def, False));
VG_(st_setname)(def, name);
return def;
}
I am not sure if the above is the correct thing to do
but it works and I hope it would atleast shed some
light and pave the way for correcting it.
Thanks
Naveen
--- Nicholas Nethercote <nj...@ca...> wrote:
> On Thu, 9 Sep 2004, Naveen Kumar wrote:
>
> > I had posted earlier about valgrind stalling but
> > since nobody seemed to have encountered it I
> decided
> > to try investigating myself. I turned on some of
> the
> > debug flags and added some printf statements at
> some
> > points in the code. I find that valgrind is going
> into
> > an infinite loop in one place. These are the debug
> > statements before it stalls
> >
> > initSym(si=0xB02ED020, tab=0xB02FD120,
> sym=0xB17416F8,
> > kind=128, name=0xB0AC6C46
> "msgbuf:Tt(0,27)=xsmsgbuf:",
> > val=0)
> >
> > initSym name="msgbuf" type=Tt(0,27)=xsmsgbuf:
> > initSym: before base type
> >
> > I added the following printfs in vg_stabs.c
> > VG_(printf)("initSym: before base type\n");
> > base = VG_(st_basetype)(sym->type, False);
> > VG_(printf)("initSym: after base type\n");
> >
> > As can be seen from the logs I dont get anything
> > printed after "..before base type..". It is just
> > spinning in VG_(st_basetype).
>
> Can you file a bug report for this please?
>
> Thanks.
>
> N
>
>
>
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
|