lua-users home
lua-l archive

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


This seems very strange to me but i have seen it repeatedly now.  I have
embedded lua into a cgi to act as a simple templating engine and the cgi
is execute approx 500k times a day but once a day - it cores. Looking at
the trace with gdb always points to the same point - the realloc call.

#6  0x24bfc in luaM_realloc (L=0x907c8, block=0x0, size=89) at lmem.c:141
#7  0x275d4 in luaS_newlstr (L=0x907c8,

lmem.c:141  is very simple realloc call.

In this case since it is a new string it is passing NULL which should make
realloc perform just like malloc.  I checked the archives and saw mention
of somebody having the same problem in 03/2001 but no resolution.

The things i don't understand are 1. the infrequency that it occurs with
and 2. the fact that it always points to the realloc.  Sometimes the trace
is different leading up to the realloc but it always fails on the realloc.
I could imagine that if there was a gc problem and you were passing
address that had already been freed that this would cause serious
problems but not passing NULL.

I am using ...
solaris 2.8
gcc 2.95.2
lua 4.0

Any hints, pointers, tips, expressions of sympathy would be greatly
appreciated.

thanks,

derek