Skip to content

Stabilize Android Harness ASan and view lifecycle tests - #1530

Draft
mrousavy wants to merge 1 commit into
mainfrom
fix/harness-recycling-lifecycle-race
Draft

Stabilize Android Harness ASan and view lifecycle tests#1530
mrousavy wants to merge 1 commit into
mainfrom
fix/harness-recycling-lifecycle-race

Conversation

@mrousavy

@mrousavy mrousavy commented Aug 25, 2026

Copy link
Copy Markdown
Member

What changed

  • wait for exact native onDropView and prepareForRecycle completion before asserting lifecycle state
  • use fresh hybridRef callbacks as native prop-commit barriers
  • publish lifecycle completion across threads with Android atomics and an iOS lock
  • keep Default coverage on API 36 while running the legacy x86_64 ASan row on API 33
  • give the 20 x 32 async HybridObject stress test an explicit 120-second deadline and the Android Harness job a 150-second outer timeout, without reducing its workload

Why

Harness rerender completion acknowledges the JavaScript render boundary, not the later Fabric mount transaction and ViewManager lifecycle work. The failing ASan job read the old prepare-for-recycle count during that gap. ASan widened the scheduling window, but the missing native completion barrier was a real race in the test and could also affect Default.

Separate zero-test failures were legacy ASan app_process startup crashes before Nitro loaded. API 33 plus NDK r29 contains both sides of Android's x86_64 sanitizer seccomp fix. Later Android versions are outside maintained ASan compatibility and exhibited stochastic startup crashes, so Default remains on API 36 while the legacy sanitizer row uses API 33.

Evidence:

The sanitizer run also exposed that the intentionally heavy async stress test inherited a 1.5-second helper deadline. Its workload is preserved, but its deadline now reflects sanitizer execution time.

Validation

  • full local Android Harness suite: 544/544 passed
  • focused local native view Harness suite: 8/8 passed
  • Android Debug assembly with CI minSdk 26
  • workspace TypeScript typecheck and targeted ESLint
  • Kotlin and Swift format lint
  • GitHub Actions workflow validation with actionlint
  • modified iOS Swift module compilation
  • API 33 configuration probe: https://github.com/mrousavy/nitro/actions/runs/32908462719

Follow-up to https://github.com/mrousavy/nitro/actions/runs/32504719667/job/96842180991?pr=1524.

Repeated Android Harness validation

All final-matrix Default and ASan jobs passed in three sequential workflow_dispatch runs:

@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nitro-docs Ready Ready Preview Aug 25, 2026 11:06pm

Request Review

@mrousavy
mrousavy force-pushed the fix/harness-recycling-lifecycle-race branch from abb9999 to 611ab2d Compare August 25, 2026 22:46
@mrousavy mrousavy changed the title Fix Harness native view lifecycle race Stabilize Android Harness ASan and view lifecycle tests Aug 25, 2026
@mrousavy

Copy link
Copy Markdown
Member Author

That kinda seems like a workaround, not a stable fix

@mrousavy
mrousavy marked this pull request as draft August 25, 2026 23:37
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.

[BUG] seccomp issues with asan on x86_64 API 27

1 participant