#1202·xLua

xluaL_loadbuffer之后发生crash

Author: go3kCreated Aug 28, 2025Updated Aug 18, 2026

项目刚刚从slua迁移到xlua,目前会随机发生闪退,Editor和真机下都会发生,切场景后发生几率比较大;下面是Editor闪退后的日志,DoString 执行的代码不固定。请问如何进一步排查问题?

`================================================================= Native Crash Reporting ================================================================= Got a UNKNOWN while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. =================================================================

================================================================= Managed Stacktrace: ================================================================= at <0xffffffff> at XLua.LuaDLL.Lua:xluaL_loadbuffer <0x000da> at XLua.LuaEnv:DoString <0x0008a> at LuaManager:DoTable <0x0004a> at LuaManager:Fetch <0x0004a> at MyLuaTable:.ctor <0x00042> at LuaBehaviourBase:TryGetLuaTable <0x0010a> at FakeField:GetLuaValue <0x001aa> at LuaBehaviour:PassField <0x0003a> at LuaBehaviour:PassExtras <0x0007a> at LuaBehaviourBase:PassValues <0x000b1> at LuaBehaviourBase:TryGetLuaTable <0x0018a> at LuaBehaviourBase:Awake <0x00022> at System.Object:runtime_invoke_void__this__ <0x00087> at <0xffffffff> at UnityEngine.Object:Internal_InstantiateSingle_Injected <0x00097> at UnityEngine.Object:Internal_InstantiateSingle <0x0002a> at UnityEngine.Object:Instantiate <0x000da> at Lua:CreateGoFromRes2 <0x000ba> at XLua.CSObjectWrap.LuaWrap:m_CreateGoFromRes2_xlua_st <0x001d2> at XLua.CSObjectWrap.LuaWrap:m_CreateGoFromRes2_xlua_st <0x0006a> at <0xffffffff> at XLua.LuaDLL.Lua:lua_pcall <0x000a2> at XLua.DelegateBridge:PCall <0x00042> at XLua.DelegateBridge:Gen_Delegate_Imp8 <0x0009a> at <>c__DisplayClass39_0:b__0 <0x0035e> at YooAsset.SceneOperationHandle:InvokeCallback <0x0002c> at YooAsset.ProviderBase:InvokeCompletion <0x000f2> at YooAsset.DatabaseSceneProvider:Update <0x003ba> at YooAsset.AssetSystemImpl:Update <0x0012b> at YooAsset.ResourcePackage:UpdatePackage <0x00032> at YooAsset.YooAssets:Update <0x0008a> at YooAsset.YooAssetsDriver:Update <0x0002a> at System.Object:runtime_invoke_void__this <0x00087> =================================================================`