@@ -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