Lua Lanes crash

I have a Lua script that uses lay lanes. I have the 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:

Now when I execute it from my application (in windows) I get a crash when it is executed, the next is the call stack during the 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 anyone help me try to help me. As enabling and loading lanes.configure () seems to be causing this issue. Maybe I am doing something wrong or any suggestion could help. If you need more information, let me know.

Many thanks.


Best regards, Mayur

+3


source to share





All Articles