LiteLDev / LegacyScriptEngine

A plugin engine for running LLSE plugins on LeviLamina
GNU General Public License v3.0
49 stars 8 forks source link

[Bug]: Source actor becomes a wild pointer when Actor falls to die in onMobHurt #157

Closed panjj95 closed 3 months ago

panjj95 commented 3 months ago

Describe the bug

Source actor becomes a wild pointer when Actor falls to die in onMobHurt.

To Reproduce

mc.listen('onMobHurt', ()=>{})

Expected behavior

It works fine.

Screenshots

No response

Platform

Windows 10

BDS Version

1.21.3.01

LeviLamina Version

0.13.4

LegacyScriptEngine Version

0.8.5

Additional context

trace_2024-08-02_03-31-52.log 日志 minidump_2024-08-02_03-31-52.dmp

ShrBox commented 3 months ago

~有用SimulatedPlayer(模拟玩家)吗,看起来是一个LSE插件在onMobHurt将其中的source Entity对象转为Player对象后,调用getDevice后,LSE在调用getOrCreateUniqueID函数时出现了异常~ image


~Update: 看起来是同一个tick中调用了两次getOrCreateUniqueID导致的~ ~鉴定为我监听了hurtEffects但是没做好处理导致的~

panjj95 commented 3 months ago

有用SimulatedPlayer(模拟玩家)吗,看起来是一个LSE插件在onMobHurt将其中的source Entity对象转为Player对象后,调用getDevice后,LSE在调用getOrCreateUniqueID函数时出现了异常 image

没有用假人插件,这很难排查

ShrBox commented 3 months ago

有用SimulatedPlayer(模拟玩家)吗,看起来是一个LSE插件在onMobHurt将其中的source Entity对象转为Player对象后,调用getDevice后,LSE在调用getOrCreateUniqueID函数时出现了异常 image

没有用假人插件,这很难排查

看看哪些QuickJs插件在onMobHurt里面调用了getDevice,把插件链接发我

panjj95 commented 3 months ago

trace_2024-08-02_14-37-08.zip

panjj95 commented 3 months ago

trace_2024-08-07_00-55-39.log 关于legacy-script-engine-lua.dll的日志 minidump_2024-08-07_00-55-39.dmp lse版本0.8.10

ShrBox commented 3 months ago

~改了下DeviceAPI令人摸不着头脑的构造函数,待会儿发0.8.11,应该不会再崩了~

panjj95 commented 3 months ago

log (2).zip

ShrBox commented 3 months ago

请尝试升级0.8.14,怀疑与 #160 同源

panjj95 commented 3 months ago

trace_2024-08-09_07-38-04.log 0.8.14,而且假死 minidump_2024-08-09_07-38-04.dmp

ShrBox commented 3 months ago

0.8.15已经将EntityAPI, PlayerAPI以及DeviceAPI的存储内容改为ActorRuntimeID,尝试升级0.8.15

panjj95 commented 3 months ago

0.8.15已经将EntityAPI, PlayerAPI以及DeviceAPI的存储内容改为ActorRuntimeID,尝试升级0.8.15

server-latest.log

2 server-latest (1).log

ShrBox commented 3 months ago

请尝试升级0.8.16,理论上已经修复了此问题

panjj95 commented 3 months ago

请尝试升级0.8.16,理论上已经修复了此问题

server-latest.log

ShrBox commented 3 months ago

试试0.8.17

panjj95 commented 3 months ago

trace_2024-08-11_10-48-53.zip

ShrBox commented 3 months ago

trace_2024-08-11_10-48-53.zip

此错误已经不属于该Issue的范围,故关闭此Issue 看了下,是BlockSource访问冲突了,不知道咋回事

panjj95 commented 3 months ago

试试0.8.17

4.zip 日志 trace_2024-08-12_01-50-13.zip

ShrBox commented 3 months ago

此问题已在0.8.18彻底解决