Skip to content

Skip non-log os_signpost entries in OsTraceRelayReceiver::next - #5

Merged
Derrors merged 1 commit into
masterfrom
fix/os-trace-relay-skip-unreadable
Dec 5, 2026
Merged

Derrors merged 1 commit into
masterfrom
fix/os-trace-relay-skip-unreadable

Conversation

@Derrors

@Derrors Derrors commented Dec 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Found during real-hardware regression on iPhone 15 Pro Max (iOS 27.2.1): opening Safari emits 160+ 0x02-framed non-log entries (e.g. os_signpost intervals) in 12 seconds whose level byte is outside {0, 1, 2, 0x10, 0x11}, causing OsTraceRelayReceiver::next() to return Err(UnexpectedResponse("unknown log level byte value")) and prematurely kill log capture streams.
  • Skip valid-framed non-log entries cleanly inside OsTraceRelayReceiver::next() (length prefix keeps the stream in step), skip structurally malformed entries up to 64 consecutively before erroring, and include the hex byte value in LogLevel::try_from error strings.
  • Add unit test receiver_skips_non_log_signposts_and_caps_malformed_bursts.

Verification

  • cargo fmt -p idevice -- --check
  • cargo clippy -p idevice --features full --lib --tests -- -D warnings
  • cargo test -p idevice --features full --lib (98/98)
  • Real device (iPhone 15 Pro Max, iOS 27.2.1) streaming while opening Safari: 1,079,830 lines, 0 errors (down from 164 errors / stream exit).

🤖 Generated with Claude Code

Real iOS 27.2.1 devices (e.g. WebKit/Safari loading a page) emit frequent
0x02-framed os_signpost / non-log activity entries whose level byte is outside
the five os_log levels (0, 1, 2, 0x10, 0x11). Previously OsTraceRelayReceiver::next
returned Err(UnexpectedResponse("unknown log level byte value")), terminating
callers' log capture loops within seconds.

Skip valid-framed non-log entries unconditionally (the length-prefixed framing
keeps the stream in step), skip structurally malformed single entries up to 64
in a row before failing, include the hex byte in TryFrom<u8> errors, and add a
unit test covering both an 80-signpost burst and a 64-malformed run.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Derrors
Derrors merged commit 953b899 into master Dec 5, 2026
2 checks passed
@Derrors
Derrors deleted the fix/os-trace-relay-skip-unreadable branch December 5, 2026 10:00
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