debug(phase2): 插桩 llc worker 打印 system 返回码,定位 ClassArrayTest 固定 llc 失败误报

This commit is contained in:
TermiNexus committed 2026-08-19 20:48:01 +08:00
1 parent f5b3e46543
commit f3c94917e5
1 file changed
+20 -2
+20 -2
View File
@@ -512,11 +512,25 @@ def _llc_task_worker(arg: t.CPtr) -> t.CPtr:
task: LlcTask | t.CPtr = (LlcTask | t.CPtr)(arg)
if task is None:
return t.CPtr(0)
#region debug-point LLC0
stdio.printf("[LLC-DBG] worker 开始 sha1=%s cmd=%s\n",
(task.ModuleSha1 if task.ModuleSha1 is not None else "?"),
(task.LlcCmd if task.LlcCmd is not None else "?"))
#endregion
if task.OptCmd is not None:
if stdlib.system(task.OptCmd) != 0:
opt_rc: int = stdlib.system(task.OptCmd)
#region debug-point LLC1
stdio.printf("[LLC-DBG] opt rc=%d\n", opt_rc)
#endregion
if opt_rc != 0:
task.Result = 1
return t.CPtr(0)
if stdlib.system(task.LlcCmd) != 0:
llc_rc: int = stdlib.system(task.LlcCmd)
#region debug-point LLC2
stdio.printf("[LLC-DBG] llc rc=%d sha1=%s\n", llc_rc,
(task.ModuleSha1 if task.ModuleSha1 is not None else "?"))
#endregion
if llc_rc != 0:
task.Result = 1
else:
task.Result = 0
@@ -569,6 +583,10 @@ def run_llc_parallel(tasks: bytes, task_count: int, max_threads: int) -> int:
tsk2: LlcTask | t.CPtr = (LlcTask | t.CPtr)(t.CVoid(
t.CUInt64T(tasks) + t.CSizeT(batch_start + j) * slot_size, t.CPtr))
if tsk2 is not None and tsk2.Result != 0:
#region debug-point LLC3
stdio.printf("[LLC-DBG] 失败槽 Result=%d sha1=%s\n", tsk2.Result,
(tsk2.ModuleSha1 if tsk2.ModuleSha1 is not None else "?"))
#endregion
fb: str = VLogger.fmt_buf()
if fb is not None:
viperlib.snprintf(fb, 1024, "llc 编译失败: %s (cmd=%s)",