[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: core dump on realloc?
- From: Roberto Ierusalimschy <rieru@...>
- Date: Tue, 8 Jan 2002 11:00:24 -0600 (CST)
On Tue, 8 Jan 2002, Derek Gottfrid wrote:
> 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.
>
> [...]
>
> I am using ...
> solaris 2.8
> gcc 2.95.2
> lua 4.0
This may also be a bug in the system malloc library. The old Sun-OS did
not even accept realloc(NULL), maybe solaris still has sporadig bugs
with this case.
-- Roberto