user2004264
user2004264

Reputation: 51

Lua Lanes crashes application

I have a Lua script which useslatest lua lanes. I have following script made
for

local lanes = require "lanes"  
lanes.configure()  
require "helper_interfaces"  
--require "assert"  
local cleanup  
local error_func =  function(err)  
                     return debug.traceback(err)  
                    end

local function sample(n)  
   -- set_finalizer(cleanup)  
   local success, result = xpcall(m.usb_lua_printlog("hi\r\n"), error_func)  
   print(success, result)  
   return 2*n  
end

--lanes.configure()  
EnablePrintLog()  
--PrintLog("hi")  
usb_lua_printlog("hi\r\n")  
local lanes_gen = assert(lanes.gen)  
local lanes_linda = assert(lanes.linda)  

--while (true) do  
a1 = lanes_gen("*", { globals =  { ["m"] = require "UsbTestApp" } }, sample)(1)  
a1:join()  
--set_debug_threadname("first")  
while true do  
  str = a1.status  
  --thread_gc(a1)  
  if str == "done" or str == "cancelled" or str == "error" then  
     usb_lua_wait(1000)  
     break  
  end    
end  

my problem is :

Now When I execute it from my Application (On windows) I get the crash while executing it, following is the Call stack while crash.

UsbTestApp.exe!_CrtIsValidHeapPointer(const void * pUserData)  Line 2036    C++  
UsbTestApp.exe!_free_dbg_nolock(void * pUserData, int nBlockUse)  Line 1322 + 0x9         bytes C++  
UsbTestApp.exe!_free_dbg(void * pUserData, int nBlockUse)  Line 1265 + 0xd bytes        C++>  
UsbTestApp.exe!free(void * pUserData)  Line 49 + 0xb bytes  C++  
UsbTestApp.exe!_luaL_loadbuffer()  + 0x42 bytes C  
UsbTestApp.exe!_luaM_realloc_()  + 0x23 bytes   C  
UsbTestApp.exe!_luaH_free()  + 0x2b bytes   C  
UsbTestApp.exe!_luaC_separateudata()  + 0x95d bytes C  
UsbTestApp.exe!_luaC_freeall()  + 0x4ce bytes   C  
UsbTestApp.exe!_luaC_fullgc()  + 0x4f bytes C  
UsbTestApp.exe!_lua_gc()  + 0x3f bytes  C  
UsbTestApp.exe!USB_LUA_TEST_EXECUTE_SCRIPT(lua_State * ulState)  Line 579 + 0xd     bytes   C++  
UsbTestApp.exe!USB_LUA_TEST_SCRIPT_RUN(lua_State * ulState)  Line 461 + 0x9 bytes       C++  
UsbTestApp.exe!_luaD_precall()  + 0x193 bytes   C  
UsbTestApp.exe!_luaD_call()  + 0x3c bytes   C  
UsbTestApp.exe!_lua_pcall()  + 0xd1 bytes   C  
UsbTestApp.exe!_luaD_rawrunprotected()  + 0x53 bytes    C  
UsbTestApp.exe!_luaD_pcall()  + 0x3e bytes  C  
UsbTestApp.exe!_lua_cpcall()  + 0x2f bytes  C  
UsbTestApp.exe!USB_LUA_CREATE_NEW_LUA_STATE(LUA_Script * luaScript)  Line 304 + 0x15       bytes    C++  
UsbTestApp.exe!UsbTestSuiteLIThread(void * lpParam)  Line 162 + 0x9 bytes   C++  

Can Anybody help me try to help me. As include and loading of the lanes.configure() seems to cause this problem May be I am doing something wrong or any suggestion might help. In case if you need more info let me know.

Thanks a lot.

Regards,
Mayur

Upvotes: 3

Views: 477

Answers (0)

Related Questions