Tower of Trample 1F~10F 整合版
-
https://pan.baidu.com/s/178it-rddubVEZKvXBSSZMw?pwd=szfe
密码:southplus@流星奔月
我换了一个版本去试我的存档,依旧出现报错,您在第二层投降后就会触发这个错误,您可以尝试看看,后续还有地七层的女医生也会触发这个错误,但是我觉得第二层能修复那么同时后续也可以修复了 -
@柑橘味
为什么报错信息只有 <main>:0:这个游戏内置了 239_Acezon - F12 Fix.rb 和 313_▼ Backtrace.rb,它们包裹了 rgss_main。当 SystemStackError 从最底层的 Game_Interpreter Fiber 冒泡到顶层时,Ruby 1.9 的 sysstack_error 预分配异常对象在跨 Fiber 展开时调用栈被重置为 {0239}:37 / <main>:0。
我们刚才通过钩子抓到了它爆栈前最后一刻的真实轨迹: Event 2 (Yvonne) $\rightarrow$ call_event(16, 1) $\rightarrow$ call_event(16, 2) $\rightarrow$ call_event(16, 4) $\rightarrow$ call_event(18, 1) $\rightarrow$ call_event(18, 5) $\rightarrow$ call_event(19, 9) $\rightarrow$ call_event(19, 11),此时 @depth = 12,Ruby 调用栈层数 caller.size = 251!
为什么 @depth = 12 就会把栈撑爆?(三大因素叠加):因素 A(MKXP-Z Android 的 64 位 Fiber 机器栈只有 60KB): 在 mkxp-z-android/app/jni/ruby193/cont.c 第 50 行: #define FIBER_MACHINE_STACK_ALLOCATION_SIZE (0x10000)(即 64 KB,扣除 4KB 保护页 RB_PAGE_SIZE 后,每个 Fiber 实际可用的 C 机器栈只有 60 KB!而在 64 位 ARM64 下,每个栈帧比 32 位 x86 大一倍以上)。
因素 B(Game_Interpreter 的子事件共用同一个根 Fiber): RPG Maker VX Ace 的 Game_Interpreter#setup 虽然会创建 @fiber = Fiber.new { run },但 Yanfly - Call Event (call_event) 和 command_117 在调用子事件时,写的是:child = Game_Interpreter.new(@depth + 1)
child.setup(event.list, ...)
child.run # <--- 注意!直接同步调用了 child.run,根本没走 [email protected]!
加上该游戏用 134_Script Block Eval.rb 把每次 command_355(包含 call_event(...))都包了一层 C 级的 eval(script),所有 12 层嵌套的 Game_Interpreter 和 12 层 C 级 rb_f_eval 全部压在最外层同一个 60 KB 的 Fiber C 机器栈上!
因素 C(中文整合版新增的 343_TOT relationships and collection 20261009.rb 叠加了大量 alias): 这个 5.3 万行的中文整合版收集/回想脚本,在 Game_Interpreter 的 execute_command 上叠了 4 层 alias、在 command_355 上叠了 4 层 alias、在 run 上叠了 3 层 alias。导致每嵌套一层 call_event,Ruby 栈帧增加约 20 层 + 1 层 C eval。 我们实测在当前手机的 60KB Fiber 栈中,嵌套 call_event 只要达到 11~12 层就会必然触发 SystemStackError!不仅二层擦鞋小游戏(depth=12)必炸,六层/七层任何 call_event 嵌套超过 11 层的剧情也全都必炸!我打算根治 你等下次更新吧
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login

