3

我有一个使用最新 lua 通道的 Lua 脚本。我有以下
脚本

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  

我的问题是:

现在,当我从我的应用程序(在 Windows 上)执行它时,我在执行它时遇到了崩溃,以下是崩溃时的调用堆栈。

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++  

任何人都可以帮助我尝试帮助我。由于包含和加载 lanes.configure() 似乎会导致此问题 可能是我做错了什么或任何建议可能会有所帮助。如果您需要更多信息,请告诉我。

非常感谢。

问候,
马尤尔

4

0 回答 0