Skip to content

Contain attribute updates and Android linker-path failures - #300

Merged
melekr merged 6 commits into
android/native_startupfrom
android/native_startup_safety
Aug 20, 2026
Merged

Contain attribute updates and Android linker-path failures#300
melekr merged 6 commits into
android/native_startupfrom
android/native_startup_safety

Conversation

@melekr

@melekr melekr commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds Android native-startup attributes updates, linker path safety, failure containment, and runtime attribute propagation .

Changes

Native attributes

  • Preserve managed client attributes when optional native propagation fails.
  • Prevent a native attribute exception from escaping BacktraceClient.SetAttribute(...).
  • Continue processing later entries in SetAttributes(...) after one native update fails.
  • Add a platform-specific Android containment boundary for direct Android native attribute updates.
  • Emit stable diagnostic codes containing only the failure class.
  • Do not log attribute keys, values, exception messages, filesystem paths, or submission URLs.
  • Prevent the Android containment boundary from producing a duplicate generic warning.

Loaded-library path provider

  • Treat linker-selected path discovery as optional metadata.
  • Return null after any managed provider failure.
  • Continue to extracted-library and installed-package metadata fallbacks rather than disabling native capture.

Initialization lifecycle

  • Roll back native state when the native initialization bridge returns false after it has been invoked.
  • Preserve the original setup result when rollback diagnostics fail.

ref: BT-7510
ref: BT-7511

@melekr melekr self-assigned this Aug 19, 2026
@melekr melekr changed the title Android/native startup safety Android native-startup attributes and linker path safety Aug 19, 2026
melekr added 3 commits August 20, 2026 09:19
- mark native bridge completion before JNI cleanup
- roll back partial native state when initialization returns false
- contain rollback and diagnostic failures
- cover pre-bridge rejection and false-result rollback
- add an instance-scoped native attribute writer for deterministic tests
- compile the Android client test path in ordinary Editor lanes without JNI
- verify OnOOM attempts the timestamp after the first native write fails
- assert sanitized failure diagnostics
- inspect every base DEX entry in the generated App Bundle
- require the BacktraceCrashHandler class descriptor
- report missing DEX files and missing handler packaging clearly
@melekr melekr changed the title Android native-startup attributes and linker path safety Contain attribute updates and Android linker-path Aug 20, 2026
@melekr melekr changed the title Contain attribute updates and Android linker-path Contain attribute updates and Android linker-path failures Aug 20, 2026
@melekr
melekr marked this pull request as ready for review August 20, 2026 13:36
@melekr
melekr merged commit 7a03e5c into android/native_startup Aug 20, 2026
21 of 22 checks passed
melekr added a commit that referenced this pull request Aug 21, 2026
…297)

* feat(android): add linker-based native library resolution

* fix(android): make native crash setup fail-safe and use the new resolver

* fix(android): contain crash-handler process failures

* native(android): update bundled Backtrace Android native binaries

* test(android): add resolver, ABI, environment, and interop policies test coverage

* Correct process-ABI reporting and contain native startup failures (#298)

* fix(android): report the ABI of the running process as device.abi

* feat(android): select the extracted-library directory by process ABI

* test(android): pin the native interop signatures in in-editor CI

* fix(android): query the linker first and contain metadata and ANR failures

* ci: build Android players on Unity 2022.3 and 6000.3

* ci: provide the synthetic build project with a registered scene

* Improve Android native crash startup and lifecycle reliability (#299)

* fix(android): make native library fallback resolution fail-safe

- Treat filesystem, parent-directory, and system-library-path discovery as optional enrichment so failures cannot block linker or installed-package resolution.

- Require an exact process-ABI directory match when the ABI is known and reject ambiguous candidates deterministically.

* fix(android): roll back incomplete native initialization

- Track native backend activation before JNI cleanup and disable the backend when attribute setup or cleanup fails after initialization.
- Attempt every local-reference deletion, preserve the original setup failure, and contain rollback diagnostics.

* fix(android): contain ANR JNI lifecycle failures

- Contain watchdog attach, detach, dump, and attribute failures without escaping the worker thread.

- Retry transient attachment failures and always restore error.type to Crash after a hang-report attempt.

* fix(android): make native shutdown failure-safe

- Clear native and watcher state before cleanup, then run every shutdown stage independently.

- Keep native-disable, watcher-stop, watcher-dispose, and diagnostic failures nonfatal.

* ci(android): validate IL2CPP app bundle packaging

- Compile the SDK from Assets in every Android build lane while importing only the Editor, Runtime, and Android package content.
- Add a Unity 6 ARM64 IL2CPP App Bundle build, verify the required native libraries are packaged, and identify the platform and Unity version in job names.

* Contain attribute updates and Android linker-path failures (#300)

* fix(native): handle dynamic attribute update failures

* fix(android): continue after linker path lookup failures

* feat(android): update NativeClient NativeAttributeLifecycle

* fix(android): roll back partial native initialization

- mark native bridge completion before JNI cleanup
- roll back partial native state when initialization returns false
- contain rollback and diagnostic failures
- cover pre-bridge rejection and false-result rollback

* test(android): exercise OOM attribute continuation in editor

- add an instance-scoped native attribute writer for deterministic tests
- compile the Android client test path in ordinary Editor lanes without JNI
- verify OnOOM attempts the timestamp after the first native write fails
- assert sanitized failure diagnostics

* ci(android): verify Java crash handler in app bundles

- inspect every base DEX entry in the generated App Bundle
- require the BacktraceCrashHandler class descriptor
- report missing DEX files and missing handler packaging clearly

* ci(unity): fail when PlayMode tests are not executed (#301)

- Remove empty EditMode lanes that have no corresponding test assembly.
- Validate NUnit results and require the critical Android lifecycle tests.
- Cover missing, malformed, empty, failed, and incomplete test results.
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