lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I've had to do a rebuild of the app, and now the crash has moved. It's
now in lgc.c

propagatemark()
	case LUA_TTABLE:
traversetable()
->      if (!weakkey) markvalue(g, gkey(n));

The value of g going in to this function looks a little dubious.
strt.nuse = 1363, size = 2048, sweepstrgc = 2048.  You said sweepstrgc
cannot be more than size, but can it be equal?

Also GCthreshold = 2712903, as does "totalbytes" is this a bad thing, it
seems like it might be.

Unfortunately this is a windows app, so I can't use valgrind.  I had a
look at Memory Validator but it didn't flag anything up, maybe I wasn't
using it right.  It kind of looks like memory corruption being that it
moves, but I'm suspiciois of that totalbytes count...

Oh, yes, this is essentially a standard lua 5.1 installation.  It's got
bitlib compiled in, and a tiny bit of added functionality to tell some
external code of when a library is "required", but that's it.

Thanks for the help,

Tom


> -----Original Message-----
> From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-
> bounces@bazar2.conectiva.com.br] On Behalf Of Roberto Ierusalimschy
> Sent: 16 October 2009 14:22
> To: Lua list
> Subject: Re: Help: Crash in garbage collection
> 
> > I have a problem that I've been tearing my hair out over for the
past
> > day or so.  We have an application that saves out data in a lua
> > parseable file.  This has been working for a good few months, but we
> > have found a file that under some as yet unknown condition will
crash
> in
> > lua when saving.  The crash occurs in sweeplist() at the line:
> >
> >   while ((curr = *p) != NULL && count-- > 0) {
> >     if (curr->gch.tt == LUA_TTHREAD)  /* sweep open upvalues of each
> > thread */
> >
> > This is called from singlestep, case GCSsweepstring.  I have noticed
> > that g->sweepstrgc is larger than g->strt.nuse.  Is that a bad thing
> as
> > it seems to me like it would be.  If so, how would it get into such
a
> > state?
> 
> There should be no problem in sweepstrgc being large than nuse; it
> cannot be larger than strt.size. However, strt.size is usually (but
not
> necessarily) larger than strt.nuse. Can you get all these values
(nuse,
> strt.size, and sweepstrgc) after the crash?
> 
> Are you using a standard Lua instalation? What version? Any extra C
> libraries?  Can you use a tool for checking memory corruption (e.g.,
> valgrind)?
> 
> -- Roberto