lua-users home
lua-l archive

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


> -----Original Message-----
> From: owner-lua-l@tecgraf.puc-rio.br
> [mailto:owner-lua-l@tecgraf.puc-rio.br]On Behalf Of Roberto
> Ierusalimschy
> Sent: Friday, June 29, 2001 7:41 AM
> To: Multiple recipients of list
> Subject: Re: code causing seg fault
>
>
> > The fault is at
> > line 258 in ltable.c (in luaH_set):
> >
> >       while (othern->next != mp) othern = othern->next;  /*
> find previous */
> >
> > othern is NULL. mp->key is also all zeros.
>
> That is strange. mp->key shouldn't be all zeros (if the tag is zero, the
> value should be a valid TString pointer).

Can you think of any condition that would cause this to happen?

> > My guess is that I am causing Lua to attempt to
> > access an already-deleted C++ pointer
>
> The only place where Lua accesses "user" pointers is when calling C
> functions, but it is not common to delete them. Lua never accesses an
> userdata (I hope).

Yes, I do not think the function pointers are being deleted. I do
occaisionally delete C++ objects from Lua, using special wrapper functions
(via toLua). I don't think that would cause a problem unless toLua
seperately tried to free the data again...

Any other ideas?

Eric