LiteLDev / LeviLamina

A lightweight, modular and versatile mod loader for Minecraft Bedrock Edition, formerly known as LiteLoaderBDS
https://levimc.org/software/levilamina
GNU Lesser General Public License v3.0
1.14k stars 117 forks source link

PlayerListPacket->SerializedSkin 析构异常 #1144

Closed EpsilonZunsat closed 1 year ago

EpsilonZunsat commented 1 year ago

异常模块

LiteLoader (本体)

操作系统

Windows 11

LiteLoader 版本

LiteLoaderBDS 2.12.0-dev.0+8f35f0e

BDS 版本

Version 1.19.72.01(ProtocolVersion 575)

发生了什么?

构造PlayerListPacket,Packet在发送时造成崩溃。 使用新SDK编译,使用Loopbacksender方式发包依旧造成崩溃。 使用老SDK(两周前)编译Loopbacksender方法将可以在新版本中使用并且不报错。 通过两个玩家账号的对照均产生崩服

复现此问题的步骤

Code to reproduce

Event::PlayerChatEvent::subscribe([](const Event::PlayerChatEvent&ev) {
         auto pl = ev.mPlayer;
     auto& pl1 = *pl;
     auto pkt = PlayerListPacket();
     pkt.type = PlayerListPacketType::Add;
     auto ple = PlayerListEntry(pl1);
     ple.uuid = mce::UUID();
     ple.name = "fffff";
     pkt.emplace(ple.clone());
     pl->sendNetworkPacket(pkt);
         return true;
         });

有关的日志/输出

StackTrace_20230322_19-56-47.zip

[Crashed!]
-- Unhandled Exception in -> ntdll.dll
-- Exception Code: 0xC0000374
-- C++ STL Exception detected!]

[StackTrace] Function RtlIsZeroMemory at 0x7FF9F881BD00  [ntdll.dll<6.2.22621.1344>
[StackTrace] Function _misaligned_access at 0x7FF9F8824A50  [ntdll.dll<6.2.22621.1344>]
[StackTrace] Function RtlGetCurrentServiceSessionId at 0x7FF9F874ABA0  [ntdll.dll<6.2.22621.1344>]
[StackTrace] Function RtlFreeHeap at 0x7FF9F874AAB0  [ntdll.dll<6.2.22621.1344>]
[StackTrace] Function free_base at 0x7FF9F5F037D0  [ucrtbase.dll<6.2.22621.608>]
[StackTrace] Function operator delete at 0x7FF6EC243920  [bedrock_server_mod.exe<1.19.72.01>]
[StackTrace] Function SerializedSkin::~SerializedSkin at 0x7FF6EAD2F0E0  [bedrock_server_mod.exe<1.19.72.01>]
[StackTrace] Function PlayerListEntry::~PlayerListEntry at 0x7FF6EAF23170  [bedrock_server_mod.exe<1.19.72.01>]
[StackTrace] Function PlayerListPacket::~PlayerListPacket at 0x7FF973BB4E20 [TestPlugin]

插件列表

KawaiiNahida commented 1 year ago

崩溃日志已手动清理,初步判断为结构体内容异常导致内存释放时异常

dreamguxiang commented 1 year ago

fixed