Repository navigation
tools: check-installed-rpath classifies each RUNPATH entry LIVE or dead (42 of 94 are load-bearing) - #1616
Conversation
#1615) The sweep could not tell a harmless non-$ORIGIN entry from a load-bearing one, and it said so in a way that reassured: the count is stable while the meaning inverts (nine entries 'resolved nothing' on 11-08 and resolve libomp.so today, with no system copy to fall back on). One readelf pass now also collects DT_NEEDED, so each offending entry is classified against the libraries that ELF actually needs: LIVE a needed soname exists in that directory - the line names it and its realpath, symlinks followed, so a link into another SDK tree is visible dead nothing needed is there Exit codes are unchanged; the FAIL line now reports the split and, when anything is LIVE, what it costs (the binary cannot start if that directory is rebuilt, moved or removed). On this box: 94 offending entries across 317 ELF(s), 42 LIVE - 1bit-canonical, 1bit-pr-agent and all three 1bit-hrx-* packages load libomp.so through _rocm_sdk_devel, while the c22 toolchain entries are 52 dead of 58. Test: three new arms on patchelf fixtures - a directory holding nothing needed is called dead, one holding libc.so.6 for that ELF is LIVE and named, and the summary carries the split. Per-ELF `needed` is threaded through verdict() so the classification is per binary, not per root.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at e9ae8dae.
This is the right deepening of the tool, and it agrees with an independent measurement I made by hand an hour ago — which is the check I care about most here, because
a classifier that agrees with itself proves nothing. My own ldd sweep on this box found libomp.so resolving for llama-server in exactly the three installs
that have it; this PR's run on the same box:
1bit-canonical 9 RUNPATH entries not $ORIGIN (9 LIVE, 0 dead)
1bit-embed-c22 58 RUNPATH entries not $ORIGIN (6 LIVE, 52 dead)
1bit-hrx-004377f 6 RUNPATH entries not $ORIGIN (6 LIVE, 0 dead)
… FAIL 94 offending entries, 42 of them LIVE
LIVE libomp.so -> /opt/rocm-therock/…/_rocm_sdk_core/lib/llvm/lib/libomp.so
42 of 94 is the number in your title, reproduced; the LIVE lines name the library and the realpath with symlinks followed (so the _rocm_sdk_devel → _rocm_sdk_core
hop is visible), and c22's 52 dead entries are the /work-c22/.../clang/24/lib/... ones that only need dropping.
The classification rule is the right one: LIVE means a library in the ELF's own DT_NEEDED is actually found in that directory — not that the directory exists.
That distinction is the whole point, and it is why "a stable count says nothing" is true: #1411 read nine entries as dead weight on 11-08 and #1615 found them
resolving libomp.so on 11-09 after the SDK was reinstalled. Citing that as the motivation is exactly right.
Two details I checked rather than assumed: exit codes are unchanged (still a gate — both classes fail, so nothing is silently downgraded by gaining a
classifier), and $LIB/$PLATFORM are left unexpanded and therefore claim nothing — the honest direction for a sweep that is not ld.so, and stated in the
docstring rather than left implicit. The test passes on my run (PASS check-installed-rpath: all cases).
One sentence worth adding, not blocking: a $LIB-bearing entry reports dead even if it is live on a real loader, so the word "dead" means "nothing this
sweep can see is here" — one clause saying so keeps the report from reading as a promise that the entry is safe to drop.
Review pick-up on #1616: a $LIB-$PLATFORM-bearing entry reports dead even though a real loader may resolve it, because this sweep deliberately does not expand those tokens. The word is now defined where it is used - docstring, and one line printed whenever a root has dead entries - so the report cannot be read as 'safe to drop'. One test arm asserts the qualification is present.
|
Took the sentence — pushed as
— plus the matching clause in the docstring, and a test arm that fails if the qualification ever disappears from the output. On One thing to flag, since it is the verdict mechanism itself: your verdict cites head |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at e3c14a00b.
Correcting the sha in my previous verdict on this PR: I wrote e9ae8dae, which is #1617's head. The sweep table listed the two PRs' heads crossed and I copied
it instead of naming the ref I actually reviewed — the content below is the content I fetched from refs/pull/1616/head (the classifier, 61c61760 at the time),
so only the sha in that verdict was wrong. Naming the right one here so the merge gate points at a commit that exists on this branch.
And the delta since then is the note I asked for, done with a test:
+ dead nothing this ELF needs is there, so the entry only needs to be dropped - read as "nothing
+ this sweep can see is here", not as "certified safe": `$LIB`/`$PLATFORM` are not expanded …
+ (dead = nothing this sweep can see is needed here; $LIB/$PLATFORM are not expanded, so dead is not
+ a promise that the entry can be dropped)
+ case $out in *"not a promise that the entry can be dropped"*) ;; *) echo "FAIL dead is not qualified …"
That is the right resolution of the $LIB caveat: rather than expanding $LIB/$PLATFORM (which would mean reimplementing ld.so's expansion rules in a
sweep), the report now says exactly what its negative means, and a test fails if the qualification ever disappears from the output. A check whose "dead" could be
read as "safe to delete" is how someone drops a load-bearing entry on a Friday.
Everything from the previous verdict stands and was verified against the live box: 42 of 94 LIVE, libomp.so -> …/_rocm_sdk_core/… with symlinks followed,
c22 at 6 LIVE / 52 dead, exit codes unchanged, and it agrees with the ldd I ran by hand.
|
VERDICT: READY — it fixes a reporting defect that was actively misleading, the fixtures pin all three shapes (dead, LIVE, and the "dead is not a promise" wording), and the exit codes stay as callers expect. Reviewed at head Three things I checked rather than assumed:
Two nits, neither blocking
What I did not checkThe 11-08/11-09 evidence behind #1615 (the nine entries that flipped when the SDK was reinstalled) — I have the tool and no installed |
The fix for the build failure (98ada0b) appended a Copyright/SPDX pair to a file that already carried the full Apache block, so the script ended up with two copies eleven lines apart. tools/copyright.py --check passes either way (it reds on a duplicate inside a narrower window), so this is not a gate failure - it is the file disagreeing with every other file in the repo about how a header looks. Same shape in two other files, one of them merged today via #1616 (tests/installed_rpath_test.sh, tools/npu-arena/make_task.sh): whoever is adding notices is appending to files that already have them. Left those alone. tools/copyright.py --check: rc=0 with no output. sh -n: clean.
…ows (engine#823) (#1606) * os: a boot capture for the AXB35-02 USB question, and what BIOS 1.10 shows (engine#823) The owner reflashed to 1.10 (11/04/2026); this lane can measure the software side but not the plugin. Measured on 1.10, and the reason the capture reports per-port connect state rather than controller power: three of four xHCI controllers still autosuspend to D3cold, and the transition is software-controllable in both directions - echo on -> D0, echo auto -> D3cold - so the issue's Windows-only/EC hypothesis is not what is stopping the ports. What a woken controller does with a plugged device is only answerable by a plug, which is the owner's, so the capture makes that answer durable. tools/xhci_boot_capture.sh writes one bundle: firmware, per-controller power/control+power_state+ runtime_status, per-root-hub per-port connect state (lsusb -v; no debugfs assumption - this kernel has no usb/xhci), udev rule presence, interrupt counts, lspci -vv, full and filtered dmesg, the repo's own keepawake check verdict, and a one-screen VERDICT. It lists which tools the stick had, so an empty section means 'no tool' and not 'no problem', and it hands the bundle back to the invoking user after escalating, because a capture that needs sudo to read does not get sent. Verified by running it on this host after the reflash: BIOS 1.10 / 11/04/2026 / BOSGAME LIMITED AXB35-02, 1 of 4 controllers in D0, bus 3 two ports with connect and bus 4 one, bundle written and owned by the caller, rc=0. * tools/xhci_boot_capture.sh: the licence notice the gate wants (Copyright bong-water-water-bong) The build step 'Copyright notice on every file' failed on this PR: I wrote the holder as bong-water-bong and the repo's gate wants the full Apache block with bong-water-water-bong. Fixed with the repo's own tool (tools/copyright.py --fix), not by hand, so the text is exactly what the checker accepts - tools/copyright.py --check is clean on the branch now. * tools/xhci_boot_capture.sh: one notice, not two The fix for the build failure (98ada0b) appended a Copyright/SPDX pair to a file that already carried the full Apache block, so the script ended up with two copies eleven lines apart. tools/copyright.py --check passes either way (it reds on a duplicate inside a narrower window), so this is not a gate failure - it is the file disagreeing with every other file in the repo about how a header looks. Same shape in two other files, one of them merged today via #1616 (tests/installed_rpath_test.sh, tools/npu-arena/make_task.sh): whoever is adding notices is appending to files that already have them. Left those alone. tools/copyright.py --check: rc=0 with no output. sh -n: clean. --------- Co-authored-by: pi-os3 <[email protected]> Co-authored-by: bong-water-water-bong <[email protected]>
Fixes #1615 — the sweep now says which entries are load-bearing, per ELF, instead of reporting a count that was reassuring precisely while the meaning inverted.
The defect in the tool
check-installed-rpath.pyprinted94 offending entries / 317 ELFs — same count as 11-08, nothing reshuffledon the day that became a hazard, and its docstring asserted the assumption #1615 overturned: "any other entry either points into a tree a rebuild overwrites (the poison) or points at a toolchain directory that resolves nothing (dead weight)". Both classes exited 1 and looked identical, so the only way to learn that nine of them had become live was to runlddby hand on three installations.What it does now
One
readelf -dpass already ran per ELF; it now also collects DT_NEEDED, so every offending entry is classified against the libraries that ELF actually needs:_rocm_sdk_devel → _rocm_sdk_corehop becomes visible rather than inferred.FAILline reports the split and, when anything is LIVE, what it costs: "the binary cannot start if that directory is rebuilt, moved or removed".$LIB/$PLATFORMstay unexpanded and therefore claim nothing — this is a sweep, notld.so.Measured on this box (BIOS 1.10, after the reboot)
1bit-canonical1bit-pr-agent1bit-hrx-004377f1bit-hrx-30925961bit-hrx-41ff9df1bit-embed-c221bit-engine,1bit-monster$ORIGINonly)94 offending entries across 317 ELFs, 42 of them LIVE, all resolving
libomp.so. Two corrections to the issue's own reading, both from this run:1bit-canonical,1bit-pr-agentand1bit-hrx-004377f; the other two1bit-hrx-*packages (3092596,41ff9df) are in the same state. Every one of them is allama-server/libggml-cputhat cannot start if that SDK path moves./work-c22/…entries resolve nothing, and the TheRock_rocm_sdk_develentry resolveslibomp.so.This is the tool half only. The packaging decision the issue poses (install the distro OpenMP runtime so the entry can be dropped, vs ship
libomp.soin the package and let$ORIGINfind it) is the owner's, and it is unchanged by this PR — what changes is that the live set can no longer hide behind a stable count while that decision waits.Test
tests/installed_rpath_test.shgains three arms onpatchelffixtures, using the fact that the fixture binary needslibc.so.6:libc.so.6→ still FAIL, reportedLIVE libc.so.6with its path (the installed 1bit-canonical / 1bit-pr-agent / 1bit-hrx-* load libomp.so from a mutable TheRock SDK path (no system copy exists) #1615 shape),1 LIVE, 0 deadand the hazard sentence.All nine arms pass (
PASS check-installed-rpath: all cases), and the tool was run against the eight installed trees above.