lua-users home
lua-l archive

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


On Thu, May 29, 2008 at 6:18 AM, Patrick Donnelly
<batrick.donnelly@gmail.com> wrote:
> I've been desperately trying to track down a problem that arose while
> working on Nmap's scripting engine. I had a userdata that I pushed
> onto the stack, and later (while it was still on the stack), it was
> finalized unexpectedly. I've tried hard to reproduce the problem into


I don't have time to look at all your logic but a couple things stuck out.

1. Check the return value of lua_call().

2. Instead of printing "hereX", print out the value of lua_gettop() so
you can see what is happening to the stack.  This seems like the most
likely problem.  Your user data is probably getting removed from the
stack and subsequently collected.

-- 
// Chris