Skip to content

fix: retain native debug symbols#988

Open
ovitrif wants to merge 15 commits into
masterfrom
fix/sigabrt-crash-982
Open

fix: retain native debug symbols#988
ovitrif wants to merge 15 commits into
masterfrom
fix/sigabrt-crash-982

Conversation

@ovitrif

@ovitrif ovitrif commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Refs #982

Related

This PR keeps native debug symbols in Android release artifacts so production native crashes can be symbolicated cleanly.

Description

The production SIGABRT from mainnet 2.2.0 / build 181 symbolicates into libbitkitcore.so, around the native on-chain address-info lookup path. The runtime guard is in synonymdev/bitkit-core#95; this PR consumes the published native-symbol package releases and hardens Android release symbol handling.

This PR:

  • Bumps bitkit-core-android to 0.1.70, published from fix: publish android debug symbols bitkit-core#99 with Android native debug metadata and 16 KB LOAD-alignment validation.
  • Bumps ldk-node-android to 0.7.0-rc.48, published from fix: publish android debug symbols ldk-node#84 with Android native debug metadata and 16 KB LOAD-alignment validation.
  • Bumps vss-client-android to 0.5.17, published from fix: publish android debug symbols vss-rust-client-ffi#13 with Android native debug metadata and 16 KB LOAD-alignment validation.
  • Keeps the Android foreground-service guard from fix: core signal abort crash #989.
  • Configures mainnet release builds to request full native debug symbols.
  • Makes just release remove stale symbol archives, build the mainnet APK/AAB, and validate app/build/outputs/native-debug-symbols/mainnetRelease/native-debug-symbols.zip before release use.
  • Updates scripts/create-native-debug-symbols.sh so it validates libbitkitcore.so, libldk_node.so, and libvss_rust_client_ffi.so for the release ABIs before reporting success.
  • Documents the release workflow: keep the canonical native-debug-symbols.zip filename, attach it to GitHub/internal release storage, upload it to Play for the exact version/build, and verify Play lists native debug symbols after upload.

Upstream packages:

Preview

N/A

QA Notes

Manual Tests

  • 1. release symbols: Ran scripts/create-native-debug-symbols.sh against stripped native libs before the upstream package releases and verified it refused to create a fake archive.
  • 2. release docs: Verified README and .agents/commands/release.md tell the releaser to keep native-debug-symbols.zip in GitHub/internal storage, upload it to Play for the exact version/build, and treat Play Console listing as upload verification.
  • 3. release: Ran just release after consuming the published core, LDK, and VSS artifacts. It exited 0 and validated app/build/outputs/native-debug-symbols/mainnetRelease/native-debug-symbols.zip.
  • 4. release: Upload the mainnet AAB to Play, then upload native-debug-symbols.zip for the exact version/build in App bundle explorer -> Downloads -> Assets. Verify Play lists the native debug symbols after upload.
  • 5. mainnet regression: Foreground sync -> Activity: wallet data loads without a native crash.
  • 6. mainnet regression: Receive -> copy/show on-chain address -> return Home: receive flow still works.
  • 7. mainnet regression: Send -> prepare on-chain send with standard fee: fee estimate and confirmation flow still works.

Automated Checks

  • Unit tests added earlier in this PR cover native release symbol retention, the release recipe native symbol archive check, the release command native symbols upload step, and the stripped-library guard in app/src/test/java/to/bitkit/build/NativeReleaseConfigTest.kt.
  • Passed: ./gradlew testDevDebugUnitTest --tests to.bitkit.build.NativeReleaseConfigTest.
  • Passed: sh -n scripts/create-native-debug-symbols.sh.
  • Passed after final upstream package publish: GITHUB_TOKEN=$GITHUB_PAT just compile.
  • Passed after final upstream package publish: GITHUB_TOKEN=$GITHUB_PAT just test.
  • Passed after final upstream package publish: GITHUB_TOKEN=$GITHUB_PAT just lint.
  • Passed after final upstream package publish: GITHUB_TOKEN=$GITHUB_PAT just release; produced native-debug-symbols.zip at 210 MB.
  • just lint still prints two pre-existing detekt warnings in AppViewModel.kt and SupportScreen.kt, but exits successfully.

@ovitrif ovitrif changed the title fix: bump bitkit-core dependency fix: address prod sigabrt #982 Jun 3, 2026
@ovitrif ovitrif self-assigned this Jun 3, 2026
@ovitrif ovitrif added this to the 2.3.0 milestone Jun 3, 2026
@ovitrif ovitrif changed the title fix: address prod sigabrt #982 fix: native code abort signal crash Jun 3, 2026
@ovitrif ovitrif force-pushed the fix/sigabrt-crash-982 branch from e52d1d4 to f64bc5a Compare June 3, 2026 20:11
@ovitrif ovitrif force-pushed the fix/sigabrt-crash-982 branch from f64bc5a to 008aa9c Compare June 3, 2026 22:44
@ovitrif ovitrif changed the title fix: native code abort signal crash chore: retain native debug symbols Jun 3, 2026
@ovitrif ovitrif marked this pull request as draft June 3, 2026 22:50
@ovitrif ovitrif mentioned this pull request Jun 3, 2026
3 tasks
@ovitrif ovitrif requested review from ben-kaufman and piotr-iohk June 4, 2026 13:18
@ovitrif ovitrif changed the title chore: retain native debug symbols fix: create native symbols zip Jun 4, 2026
@ovitrif ovitrif marked this pull request as ready for review June 4, 2026 14:19
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@ovitrif ovitrif changed the title fix: create native symbols zip fix: native code abort signal crash Jun 4, 2026
@ovitrif

This comment was marked as outdated.

ben-kaufman

This comment was marked as resolved.

@ovitrif ovitrif modified the milestones: 2.3.0, 2.4.0 Jun 4, 2026
@ovitrif ovitrif marked this pull request as draft June 4, 2026 18:08
@ovitrif

This comment was marked as outdated.

@ovitrif ovitrif marked this pull request as ready for review June 5, 2026 05:44
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@synonymdev synonymdev deleted a comment from chatgpt-codex-connector Bot Jun 5, 2026
@ovitrif ovitrif changed the title fix: native code abort signal crash fix: retain native debug symbols Jun 5, 2026
@ovitrif ovitrif requested a review from ben-kaufman June 9, 2026 21:05

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24257037c4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

readelf_bin=$(find_readelf)

has_debug_metadata() {
"$readelf_bin" -S "$1" | grep -Eq '\.(symtab|debug_|gnu_debugdata)'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require full DWARF symbols before accepting fallback archives

Fresh evidence after the prior fix: this predicate now treats .gnu_debugdata or a bare .symtab as sufficient debug metadata. When AGP does not emit native-debug-symbols.zip and the fallback validates merged/stripped release libraries that still retain only mini debug data or symbol-table-only sections, just release can still publish an archive that does not satisfy the debugSymbolLevel = "FULL" goal and will leave native crashes without file/line symbolication. Please require .debug_* DWARF sections for this release path, or explicitly downgrade the build/config/docs to SYMBOL_TABLE-only.

Useful? React with 👍 / 👎.

variant="mainnetRelease"
output="app/build/outputs/native-debug-symbols/$variant/native-debug-symbols.zip"
output_dir=$(dirname "$output")
required_libs="libbitkitcore.so libldk_node.so libvss_rust_client_ffi.so"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This validator still skips libpaykit.so. The release APK includes Paykit via implementation(libs.paykit), and the resolved artifact ships jni/arm64-v8a/libpaykit.so and jni/armeabi-v7a/libpaykit.so, but required_libs only checks bitkitcore, ldk-node, and VSS. Could we validate every copied .so, or add libpaykit.so to this required set, so just release cannot pass with incomplete Paykit symbols?

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.

2 participants