Skip to content

Freeze reports name the main loop's leg, and a stall with no app frame stops splitting by instruction - #1374

Merged
GLinnik21 merged 5 commits into
mainfrom
lane/freeze-leg
Nov 13, 2026
Merged

GLinnik21 merged 5 commits into
mainfrom
lane/freeze-leg

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Field MainThreadFreeze reports (Sentry PLX-NATIVE-24/-25: one webOS TV Lite 9.1 set, four stalls in a minute) arrived with no app frame and nothing saying what the main loop was doing, and a freeze with no app frame was fingerprinted on a firmware-library offset, so one stall split into several issues by instruction.

  • The leg, in every build. A process-wide AtomicU8 holds the loop's current leg: LoopPhases::enter stores the seven heartbeat legs, and diag::spans::span stores the four span legs (scen → dev-scenarios, pump → playback-pump, land → land-results, dframe → dispatcher-frame) and restores the enclosing leg on return and on unwind. Relaxed stores only; the threadcheck labels are unchanged.
  • Recorded at probe time. The watchdog's observer thread (not the signal handler), after sending the freeze probe, appends freeze-at: seq=<n> leg=<word> to the crash log, so an unrecovered freeze still names its leg. The event-log freeze line names it too.
  • Imported strictly. freeze-at: is matched by seq within the same process, in any order against the handler's *** FREEZE lines (they are written concurrently), and only a word from the fixed eleven-word table is accepted. Tag freeze.leg.
  • Grouping. Fingerprint ["freeze", site, leg], the leg only when present. With a leg and no in-app frame, the site is the pc and lr module basenames without offsets, so one stall no longer splits by instruction. Records without a leg keep their old fingerprint.
  • PRIVACY.md names freeze.leg and its eleven words; docs/agent-reference.md describes freeze-at:.

The consent preview has never shown a freeze sample (fault and panic only); adding one needs a new heading in 12 locales and is left for separately.

Gates

  • Watchdog tests (the probe writes freeze-at: with the current leg; nothing when unsent or no leg), span tests (each loop span publishes its leg and restores the enclosing one, nested unmapped spans, unwind), importer tests (five placements, strict parse, wrong seq or other process ignored), fingerprint tests (same modules + leg group together; a leg-less record keeps its old fingerprint). Red runs recorded before each fix.
  • make test-crate C=plx_base: 272 passed. make test-crate C=plx_telemetry: 367 passed. make test-crate C=plx_screens T=consent: 62 passed. ci/check-deps.sh and ci/check-module-layers.py: green. make check-nodef: clean.
  • Reviewed once (pr-reviewer): one MAJOR (four of the eleven legs were unwritable, so a pump stall read results), fixed in the fourth and fifth commits.
  • Full gates: this PR's CI.

🤖 Generated with Claude Code

GLinnik21 and others added 5 commits November 13, 2026 14:35
…-at: at probe time

A shipping build published no leg label (threadcheck only), so a freeze report said nothing
about what the loop was doing. LoopPhases::enter now stores the leg's code in one relaxed
AtomicU8 in every build; LoopPhase::word() is the single table the writer and the importer
share. On a probe the observer thread appends freeze-at: seq=<n> leg=<word> to the crash log
(when the probe was sent and a leg is known) and the event-log line gains the leg.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…y freezes by module

The importer reads freeze-at: seq=<n> leg=<word> (same process, matching probe number, a word
from LoopPhase's fixed table only; either order against the *** FREEZE record, since the
observer thread and the stuck thread write them concurrently). A freeze with a leg gets the
freeze.leg tag, the leg as a third fingerprint element, and, when it has no frame in the app's
own image, the pc and lr module basenames (libfoo.so>libbar.so) instead of a firmware offset,
so one stall stops splitting by instruction. A record without a leg keeps its old fingerprint.
PRIVACY.md names the tag and the eleven words.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ts do not remove each other's file

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Only LoopPhases::enter wrote the leg cell, and the heartbeat marks that call it
enter seven of the eleven legs. The other four (scen, pump, land, dframe) are
reached only through FRAMEDROP spans, whose watchdog label exists under
threadcheck alone, so a freeze inside the playback pump (the Starfish/ACB
suspect) was reported as the enclosing `results` leg and fingerprinted with it.

diag::spans::span now stores the span's leg in the cell, armed or not, and a
Drop guard (LegScope) restores the previous leg on return or unwind. The
span-to-leg mapping is unconditional and stays in base. A load and two relaxed
stores for the four names, nothing for any other span.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…al lock

The span guard restores what it found, which is "none yet" when no leg has been
entered, so the spans test could store that between the default-legs test's
store and its is_some() read. Both tests now hold testlock::serial().

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit fb3b3ff into main Nov 13, 2026
26 of 28 checks passed
@GLinnik21
GLinnik21 deleted the lane/freeze-leg branch November 13, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant