(lua31) lua2c - c2lua overflow problems...

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

(lua31) lua2c - c2lua overflow problems...

David Jeske-2
Here is a trace of possibly useful information:

The top level C code does:

lua_beginblock();
lua_dofile("init.lua");
lua_endblock();

In the lua code, there are nested dofile()s.

Then, there is a call to this function:

-- default object type..
function hz_register_objtype(name, obj) 
	if (obj ~= nil) then
		obj.parent = world_object;
		
		if (object_types[name] ~= nil) then
			print("Object type [".. name .."] exists,
redifining.");
		else
			print("Object type [".. name .."] defined.");
		end;

		object_types[name] = obj;
		srvobj_types[name] = obj;
		C_sprite_addtype(name,obj);
	end;
end

Which calls 'C_sprite_addtype'. C_sprite_addtype is a registered C
function. Inside that, it calls back into lua doing 'next' calls to walk
lua tables. That's where it says it is having trouble. There are
lua_beginblock()/endblock() pairs in C_sprite_addtype().


Here is the log with stack traces:
-----------------------------------
init_map
Starting Lua [lua\init.lua]
dofile(lua\util.lua)	
Util.lua!!!	
error in _old_dofile()!	
[init.lua]: loading objects	
dofile(lua\game.lua)	
error in _old_dofile()!	
dofile(lua\init_map.lua)	
error in _old_dofile()!	
dofile(lua\objects.lua)	
dofile(lua\visrep.lua)	
error in _old_dofile()!	
dofile(lua\obj_tnk.lua)	
Object type [mainship] defined.	
**** LUA ERROR **** 'Lua2C - C2Lua overflow'
Active Stack:
	function next [in file (C)]
	function C_sprite_addtype [in file (C)]
	function hz_register_objtype at line 18 [in file lua\objects.lua]
	main of lua\obj_tnk.lua at line 297
	function _old_dofile [in file (C)]
	function dofile at line 25 [in file lua\init.lua]
	main of lua\objects.lua at line 38
	function _old_dofile [in file (C)]
	function dofile at line 25 [in file lua\init.lua]
	main of lua\init.lua at line 324
****
**** LUA ERROR **** 'error calling next() builtin Lua function'
Active Stack:
	function C_sprite_addtype [in file (C)]
	function hz_register_objtype at line 18 [in file lua\objects.lua]
	main of lua\obj_tnk.lua at line 297
	function _old_dofile [in file (C)]
	function dofile at line 25 [in file lua\init.lua]
	main of lua\objects.lua at line 38
	function _old_dofile [in file (C)]
	function dofile at line 25 [in file lua\init.lua]
	main of lua\init.lua at line 324
****
dofile(lua\obj_bse.lua)	
Object type [Base] defined.	
**** LUA ERROR **** 'Lua2C - C2Lua overflow'
Active Stack:
	function next [in file (C)]
	function C_sprite_addtype [in file (C)]
	function hz_register_objtype at line 18 [in file lua\objects.lua]
	main of lua\obj_bse.lua at line 32
	function _old_dofile [in file (C)]
	function dofile at line 25 [in file lua\init.lua]
	main of lua\objects.lua at line 39
	function _old_dofile [in file (C)]
	function dofile at line 25 [in file lua\init.lua]
	main of lua\init.lua at line 324
****
**** LUA ERROR **** 'error calling next() builtin Lua function'
Active Stack:
	function C_sprite_addtype [in file (C)]
	function hz_register_objtype at line 18 [in file lua\objects.lua]
	main of lua\obj_bse.lua at line 32
	function _old_dofile [in file (C)]
	function dofile at line 25 [in file lua\init.lua]
	main of lua\objects.lua at line 39
	function _old_dofile [in file (C)]
	function dofile at line 25 [in file lua\init.lua]
	main of lua\init.lua at line 324
****
dofile(lua\obj_flg.lua)	
Object type [flag] defined.	
**** LUA ERROR **** 'Lua2C - C2Lua overflow'
Active Stack:
	function C_sprite_addtype [in file (C)]
	function hz_register_objtype at line 18 [in file lua\objects.lua]
	main of lua\obj_flg.lua at line 50
	function _old_dofile [in file (C)]
	function dofile at line 25 [in file lua\init.lua]
	main of lua\objects.lua at line 41
	function _old_dofile [in file (C)]
	function dofile at line 25 [in file lua\init.lua]
	main of lua\init.lua at line 324
****
dofile(lua\obj_expl.lua)	
Object type [explosion] defined.	
**** LUA ERROR **** 'Lua2C - C2Lua overflow'
Active Stack:
	function C_sprite_addtype [in file (C)]
	function hz_register_objtype at line 18 [in file lua\objects.lua]
	main of lua\obj_expl.lua at line 63
	function _old_dofile [in file (C)]
	function dofile at line 25 [in file lua\init.lua]
	main of lua\objects.lua at line 42
	function _old_dofile [in file (C)]
	function dofile at line 25 [in file lua\init.lua]
	main of lua\init.lua at line 324
****
dofile(lua\obj_proj.lua)	
Object type [bullet] defined.	
**** LUA ERROR **** 'Lua2C - C2Lua overflow'
Active Stack:
	function C_sprite_addtype [in file (C)]
	function hz_register_objtype at line 18 [in file lua\objects.lua]
	main of lua\obj_proj.lua at line 27
	function _old_dofile [in file (C)]
	function dofile at line 25 [in file lua\init.lua]
	main of lua\objects.lua at line 43
	function _old_dofile [in file (C)]
	function dofile at line 25 [in file lua\init.lua]
	main of lua\init.lua at line 324
****
dofile(lua\initobj.lua)	
error in _old_dofile()!	
[init.lua]: loading complete	
setup game sprites	
table: 007A3C3C	
0 entries.	
table: 007A3C3C	
0 entries.	
setup_game() finished


-- 
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + [hidden email]