lua-users home
lua-l archive

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


Thanks to everyone for the help.  The problem was indeed stack
corruption. With LUA_USE_APICHECK defined I found two places where the
stack was growing too big.  I'm surprised that we didn't have more
problems with this sooner.  I'm going to leave the define in for a while
just in case there are any more.  Is there anyway though of modifing lua
so that it automatically grows the stack if it needs to?

> -----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 17:34
> To: Lua list
> Subject: Re: Help: Crash in garbage collection
> 
> > 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?
> 
> Yes.
> 
> 
> > Also GCthreshold = 2712903, as does "totalbytes" is this a bad
thing,
> it
> > seems like it might be.
> 
> No problem here, I guess.
> 
> 
> > 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.
> 
> It looks like memory corruption. Can you reproduce this bug
> consistently?
> 
> 
> -- Roberto