lua-users home
lua-l archive

Re: Bug in cpcall

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


> I believe cpcall does some improper memory handling somewhere because
> it attempts to free an invalid pointer. The attached c code provides a
> reproducible case. The basic idea is to limit the memory usage of a
> lua_State. (Looking at the code) In my application, I don't actually
> have to call cpcall multiple times (it actually happens the first
> time).
I did not test your program yet, but I think these is a small problem
with 'my_Alloc': it may fail even when reducing the size of a block.
("Lua assumes that the allocator never fails when osize >= nsize.")
This behavior may crash the GC.
-- Roberto

AltStyle によって変換されたページ (->オリジナル) /