did you consider that lua_setglobal pops the top value from the stack?
To be honest… no. I had others problems (that i'd sum it up by «stack thrashing»). I've smoked out them, using the very handy function given in the PiL. Thank you for the helping.