Skip to content

Crash breadcrumbs: record when SDL replaces the window's wl_surface (PLX-NATIVE-K) - #1429

Merged
GLinnik21 merged 2 commits into
mainfrom
crash/k-surface-diagnostics
Nov 17, 2026
Merged

GLinnik21 merged 2 commits into
mainfrom
crash/k-surface-diagnostics

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

What

Adds one crash breadcrumb, surface_changed, to the window ring. It is recorded when SDL's WM info returns a different non-null wl_surface than the last one seen. This holds across a background/foreground release, because the compare-only G_WL_SURFACE_SEEN survives sys_release_wayland.

This is evidence for Sentry PLX-NATIVE-K, not a fix.

Why

PLX-NATIVE-K (106 events, 29 users, still live on 0.10.0) is a SIGSEGV in wl_proxy_marshal. In all 12 sampled events the return address lies in libmali, not in our code. Symbolizing the libmali found on the dev set (by opcode, since no crashing build-id matched) places the call in display_window_buffer_wl → wl_surface.attach, reached from eglSwapBuffers, i.e. our SDL_GL_SwapWindow. The surface proxy is stale (freed), not NULL. Our code never creates or destroys that surface. The leading hypothesis is that LG's SDL fork replaces it under the live EGLSurface. Today's breadcrumbs cannot show when, or whether, that happens.

A present surface_changed proves a replacement. A missing one proves nothing, because an address reused by the allocator is invisible; the doc comments say so.

Privacy

Only the fixed label leaves the device; no pointer values. PRIVACY.md is updated.

Verification

  • Red first: both new tests failed before the change. The window-stage count was 20 instead of 21, and the A→B refresh recorded ["wm_ready","wm_ready"] with no surface_changed.
  • make test-crate C=plxnative-modules T=wayland_tests: test result: ok. 6 passed; 0 failed
  • ci/check-deps.sh: all gates green. check-module-layers: green.
  • Not run locally: the plx_telemetry crate tests (window.rs). The Mac's disk is full and the build preflight refuses, so this PR is a draft for CI to gate.
  • One review round (pr-reviewer): one MINOR (the address-reuse caveat), fixed in 2f46df9.

Follow-ups (not in this PR)

  • Crash phase on native Sentry reports: branch crash/k-phase-unverified. It is written but has never built and is known not to compile its tests yet.
  • Breadcrumbs for SDL window events, with a quiet WM re-query. Not written; the SDL_WindowEvent layout on LG's fork is unverified.

🤖 Generated with Claude Code

GLinnik21 and others added 2 commits November 17, 2026 17:37
…PLX-NATIVE-K)

Adds a surface_changed window crumb: update_wayland_info compares each non-null
surface SDL answers with against the last one it published (a compare-only address
that survives the background release) and records the change. Evidence for
PLX-NATIVE-K, not the fix.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@GLinnik21
GLinnik21 marked this pull request as ready for review November 17, 2026 16:37
@GLinnik21
GLinnik21 merged commit c6458f2 into main Nov 17, 2026
13 checks passed
@GLinnik21
GLinnik21 deleted the crash/k-surface-diagnostics branch November 17, 2026 16: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