Skip to content

Commit bcdd5e1

Browse files
committed
ci: lldb 的 -o 在第一个错误后就不往下走了 —— 崩溃诊断要用 -k
上一轮加的三条命令(register read / image lookup $lr / bt all)一条都没执行: --batch 模式下 lldb 在第一个报错的 -o 之后放弃余下的,而在 PC=0 处读寄存器就是 报错。-k 是「进程崩溃时执行」的那一组,正对这个场景。 ⚠️ 同时把 DYLD_PRINT_INITIALIZERS 的输出写进文件再读:管进 tail 会和 shell 自己 对信号的报告交错,而最后几行 —— 说明当时在跑哪个初始化器的那几行 —— 正是被冲掉 的那些。
1 parent 629f733 commit bcdd5e1

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,18 +297,28 @@ jobs:
297297
# One CI cycle that prints a backtrace is worth several that do not.
298298
if ! ./art/openkal-same-source > out.log 2>&1; then
299299
echo "--- how far the loader got ---"
300-
DYLD_PRINT_INITIALIZERS=1 DYLD_PRINT_APIS=1 \
301-
./art/openkal-same-source 2>&1 | tail -25 || true
300+
# ⚠️ To a file, then read. Piping into `tail` interleaves dyld's
301+
# output with the shell's own report of the signal, and the last
302+
# lines — the ones that say which initializer was running — are the
303+
# ones that get lost.
304+
DYLD_PRINT_INITIALIZERS=1 ./art/openkal-same-source > dyld.log 2>&1 || true
305+
tail -40 dyld.log
302306
echo "--- it did not run; what the debugger saw ---"
303307
# ⭐ `lr` IS THE DATUM. A jump to address 0 leaves no frame to
304308
# unwind, so `bt` says only "frame #0: 0x0" — which is the symptom
305309
# restated. The link register still holds the return address of
306310
# whoever made that call, and `image lookup` turns it into a name.
311+
# ⚠️ `-k` AND NOT `-o`. In `--batch` lldb abandons the remaining
312+
# `-o` commands after the first one that errors, and reading
313+
# register state at a PC of 0 errors — so the three commands that
314+
# would have said something never ran. `-k` is the list lldb
315+
# executes WHEN THE PROCESS CRASHES, which is the case at hand.
307316
lldb --batch \
317+
-k 'register read pc lr sp fp x8 x9 x16 x17' \
318+
-k 'image lookup --address $lr' \
319+
-k 'thread backtrace all' \
320+
-k 'image list -o -f' \
308321
-o run \
309-
-o 'register read pc lr sp fp x8 x9 x16 x17' \
310-
-o 'image lookup --address $lr' \
311-
-o 'bt all' \
312322
-- ./art/openkal-same-source 2>&1 | tail -70 || true
313323
echo "--- the image's own dependencies ---"
314324
otool -L art/openkal-same-source || true

0 commit comments

Comments
 (0)