lua-users home
lua-l archive

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


> 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