debug(phase2): 细化插桩区分 CreateProcessA 卡点与 join 等待行为
This commit is contained in:
1 parent
70c88107ce
commit
c68eb22052
1 file changed
+15
@@ -532,13 +532,22 @@ def _run_cmd_wait(cmd: str) -> int:
|
||||
sa.bInheritHandle = 1
|
||||
si.cb = win32process.STARTUPINFOA.__sizeof__()
|
||||
# create_flags=0:子进程继承父控制台(输出直接显示,同 system 语义)
|
||||
#region debug-point LLC4
|
||||
stdio.printf("[LLC-DBG] cp: 调用 CreateProcessA\n")
|
||||
#endregion
|
||||
ok: int = win32process.CreateProcessA(
|
||||
t.CPtr(0), cmd_line, t.CPtr(0), t.CPtr(0), 1, 0,
|
||||
t.CPtr(0), t.CPtr(0), t.CPtr(c.Addr(si)), t.CPtr(c.Addr(pi)))
|
||||
stdlib.free(cmd_line)
|
||||
#region debug-point LLC5
|
||||
stdio.printf("[LLC-DBG] cp: CreateProcessA 返回 ok=%d pid=%d\n", ok, pi.dwProcessId)
|
||||
#endregion
|
||||
if ok == 0:
|
||||
return -1
|
||||
win32sync.WaitForSingleObject(pi.hProcess, w32.win32base.INFINITE)
|
||||
#region debug-point LLC6
|
||||
stdio.printf("[LLC-DBG] cp: 等待完成\n")
|
||||
#endregion
|
||||
exit_code: t.CUInt32T = 0
|
||||
win32process.GetExitCodeProcess(pi.hProcess, t.CPtr(c.Addr(exit_code)))
|
||||
w32.win32base.CloseHandle(pi.hProcess)
|
||||
@@ -614,7 +623,13 @@ def run_llc_parallel(tasks: bytes, task_count: int, max_threads: int) -> int:
|
||||
while j < batch_n:
|
||||
th_j: vthreading.Thread | t.CPtr = (vthreading.Thread | t.CPtr)(t.CPtr(c.Deref(
|
||||
t.CUInt64T(t.CUInt64T(th_ptrs) + t.CSizeT(j) * 8, t.CPtr))))
|
||||
#region debug-point LLC7
|
||||
stdio.printf("[LLC-DBG] join 前 %d\n", j)
|
||||
#endregion
|
||||
th_j.join(600000)
|
||||
#region debug-point LLC8
|
||||
stdio.printf("[LLC-DBG] join 后 %d alive=%d\n", j, th_j.is_alive())
|
||||
#endregion
|
||||
th_j.close()
|
||||
j += 1
|
||||
# 本批结果检查
|
||||
|
||||
Reference in new issue
Block a user