CRASH: 掉落/交易生成旗标缺 finally,异常可泄漏全局附魔 mixin #2

Closed
opened 2026-11-15 15:58:06 +00:00 by layue13 · 2 comments
Owner

调研编号:

现象

MobRecipeLoader / VillagerTradesLoader / makeCustomDrops 置 isInGenerationProcess=true 后只在正常路径清 false,无 try/finally。旗标为真时 EnchantmentHelperMixin 把附魔 Random 换成共享 FastRandom,并改若干实体 mixin 行为。

危害类与优先级

  • 危害类:CRASH → 标签 type/defect
  • 优先级:p3(仅生成中途未捕获异常时泄漏;正常路径会清旗标)

证据(生效源码)

  • 载体:TDLM/Mobs-Info + 分支 origin/master + pin/commit 21174e0cd0310843706de770a7854737b5b32b84(submodule upstream)
  • 位置:src/main/java/com/kuba6000/mobsinfo/loader/MobRecipeLoader.java:379
  • 关键原文:
isInGenerationProcess = true;
// ... 正常结束路径才:
isInGenerationProcess = false;
  • applied 树路径:补丁层;该处无覆盖补丁,生效=upstream@21174e0cd0310843706de770a7854737b5b32b84
  • 上游状态:未修

触发与复现

  • 触发条件:启动/重载生成掉落表时中途抛出未捕获异常且进程继续。
  • 静态推演:缺具体会外逸的实体构造器实例;形状成立。
  • 未验证(仅形状相同——此时本 issue 是候选)
  • 包内相关性:模块 Mobs-Info/sides client,server/默认配置可达:未证

落点

  • 主仓:TDLM/Mobs-Info → MobRecipeLoader.java:379;VillagerTradesLoader;makeCustomDrops

范式

引证

  1. 不可点开:源在 submodule upstream@21174e0cd0310843706de770a7854737b5b32b84;mirror 可点开 —

来源

  • 线索类型:内部代码审查(无外部报障)
  • 可解析指针:upstream@21174e0cd031 / src/main/java/com/kuba6000/mobsinfo/loader/MobRecipeLoader.java:379
  • 来源标签:origin/scan
**调研编号**: ## 现象 MobRecipeLoader / VillagerTradesLoader / makeCustomDrops 置 isInGenerationProcess=true 后只在正常路径清 false,无 try/finally。旗标为真时 EnchantmentHelperMixin 把附魔 Random 换成共享 FastRandom,并改若干实体 mixin 行为。 ## 危害类与优先级 - 危害类:`CRASH` → 标签 `type/defect` - 优先级:`p3`(仅生成中途未捕获异常时泄漏;正常路径会清旗标) ## 证据(生效源码) - 载体:`TDLM/Mobs-Info` + 分支 `origin/master` + pin/commit `21174e0cd0310843706de770a7854737b5b32b84`(submodule upstream) - 位置:`src/main/java/com/kuba6000/mobsinfo/loader/MobRecipeLoader.java:379` - 关键原文: ```java isInGenerationProcess = true; // ... 正常结束路径才: isInGenerationProcess = false; ``` - applied 树路径:补丁层;该处无覆盖补丁,生效=upstream@21174e0cd0310843706de770a7854737b5b32b84 - 上游状态:未修 ## 触发与复现 - 触发条件:启动/重载生成掉落表时中途抛出未捕获异常且进程继续。 - 静态推演:缺具体会外逸的实体构造器实例;形状成立。 - 未验证(仅形状相同——此时本 issue 是候选) - 包内相关性:模块 `Mobs-Info`/sides `client,server`/默认配置可达:未证 ## 落点 - 主仓:`TDLM/Mobs-Info` → `MobRecipeLoader.java:379;VillagerTradesLoader;makeCustomDrops` ## 范式 - 命中范式:[C1 服务端稳定性](https://git.potatolab.uk/TDLM/mc-defect-patterns/src/commit/5c71fe760eaf11509476cc892da1e76ad0912b46/crash/C1-%E6%9C%8D%E5%8A%A1%E7%AB%AF%E7%A8%B3%E5%AE%9A%E6%80%A7.md) - 扫描按 C1/G5 形状记 needs_human;建议 try/finally。 ## 引证 1. 不可点开:源在 submodule upstream@21174e0cd0310843706de770a7854737b5b32b84;mirror 可点开 — https://git.nest.potatolab.uk:8443/upstream/Mobs-Info/src/commit/21174e0cd0310843706de770a7854737b5b32b84/src/main/java/com/kuba6000/mobsinfo/loader/MobRecipeLoader.java#L379-L379 ## 来源 - 线索类型:内部代码审查(无外部报障) - 可解析指针:upstream@21174e0cd031 / src/main/java/com/kuba6000/mobsinfo/loader/MobRecipeLoader.java:379 - 来源标签:origin/scan
layue13 added the
priority
p3
area/serverorigin/scanarea/lifecycle
type
defect
labels 2026-11-15 15:58:06 +00:00
layue13 added the
resolution
fixed
label 2026-11-15 16:29:04 +00:00
Author
Owner

已修:MobRecipeLoader / VillagerTradesLoader / makeCustomDrops 用 try/finally 清 isInGenerationProcess;witherSkeleton 临时映射一并在 finally 移除。patches/0001,layer commit 822f610。

已修:MobRecipeLoader / VillagerTradesLoader / makeCustomDrops 用 try/finally 清 isInGenerationProcess;witherSkeleton 临时映射一并在 finally 移除。patches/0001,layer commit 822f610。
Author
Owner

最终生效:layer commit b2027f7(patches/0001-fix-clear-generation-flag-in-finally.patch);applyPatches 已复验。

最终生效:layer commit b2027f7(patches/0001-fix-clear-generation-flag-in-finally.patch);applyPatches 已复验。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TDLM/Mobs-Info#2