Files
mint-linux/CRASH-NOTES.md
T

50 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# MINT HOOK FAILED — Proton 崩溃分析
## 结论
hook DLL 成功被 Proton 加载,但在**初始化阶段**(`DllMain` → `init` → `patch()`)发生
`EXCEPTION_ACCESS_VIOLATION (0xc0000005)`,crash 落在 native `X3DAudio1_7.dll` 内部。
不是缺 DLL、不是 WINEDLLOVERRIDES、不是 MinGW runtime 问题。
## 符号化结果(debug 构建 `hook-debug-symbolized.dll`,image base 0x180000000)
| RVA | 包含函数 | 含义 |
|---|---|---|
| `+0x521f15` | `std::thread::spawnhook::run_spawn_hooks` (+0x165) | **崩溃点**:首个线程 spawn 时的 std spawn-hooks 钩子,`usize::saturating_add` 内联叶子帧 |
| `+0x57bff` | `repak::ext::ReadExt::read_array::<Block>`(`patch()` 里 `PakBuilder` 读 `mods_P.pak`) | 读 pak 阶段 |
| `+0x54351` | `crossbeam_channel::Sender<tracing_appender::Msg>::drop` | tracing_appender **non_blocking 日志 worker** 的 channel 析构 |
| `+0x15966` | `D3DPERF_QueryRepeatFrame`(proxy_dll 导出 thunk,hook/src/lib.rs:12) | DLL 导出面 |
| `+0x2c221` | `tracing_subscriber::fmt::Timings` extension `get` | 日志 subscriber 初始化 |
## 指向
5 个点全部落在**初始化序列**:`proxy_dll!([x3daudio1_7, d3d9], init)` 的 `init` →
`patch()` → `mint_lib::setup_logging(bin_dir/mint_hook.log)`(`tracing_appender::non_blocking`)
→ 读 `Content/Paks/mods_P.pak` → patternsleuth 解析 → `hooks::initialize()`。
崩溃点 `run_spawn_hooks` 说明:**hook 在 DllMain(LoadLibrary,持 loader lock)期间
spawn 了线程**(tracing_appender 日志 worker,或 tokio/tokio-console 相关)。
Windows/Proton 下 loader lock 内 spawn 线程是经典 AV/死锁源 —— 游戏主进程首次
`LoadLibrary("x3daudio1_7")` 时触发 `init`,此时 spawn 线程在 Proton Experimental 下崩。
## 修复方向(按优先级)
1. **延迟日志/线程初始化**:`patch()` 里不要在 `init`(DllMain 上下文)里
`setup_logging`/spawn 任何线程;把 non_blocking guard 的创建挪到
`hooks::initialize` 里真正进入游戏线程之后(如 `FEngineLoop::Init`/tick 钩子首次触发时)。
2. 若 tokio 相关线程也在 init 期创建,同样挪出 DllMain 上下文。
3. 上游 issue:https://github.com/trumank/mint/issues/307 (Linux 使用场景)。
## 复现符号化
```bash
# 带符号 DLL(本 release 附件 hook-debug-symbolized.dll,debug=2 构建,代码布局与发布版一致)
x86_64-w64-mingw32-addr2line -Cfipe hook-debug-symbolized.dll \
0x180521f15 0x180057bff 0x180054351 0x180015966 0x18002c221
# 或用仓库里的通用脚本
python3.12 symbolize_hook.py hook-debug-symbolized.dll 0x521f15 0x57bff 0x54351 0x15966 0x2c221
```
## 临时恢复游戏
```bash
mv "/data/SteamLibrary/steamapps/common/Deep Rock Galactic/FSD/Binaries/Win64/x3daudio1_7.dll" \
"/data/SteamLibrary/steamapps/common/Deep Rock Galactic/FSD/Binaries/Win64/x3daudio1_7.dll.disabled"
# Steam 启动参数恢复 -disablemodding,去掉 WINEDLLOVERRIDES="x3daudio1_7=n,b"
```