Skip to content

fix: correct bundled tar allocation limits on 32-bit Android - #497

Open
mvanhorn wants to merge 1 commit into
XayahSuSuSu:mainfrom
mvanhorn:fix/443-android-databackup-32bit-tar-limits
Open

mvanhorn wants to merge 1 commit into
XayahSuSuSu:mainfrom
mvanhorn:fix/443-android-databackup-32bit-tar-limits

Conversation

@mvanhorn

Copy link
Copy Markdown

Motivation

Backups on 32-bit Android can fail when archive validation aborts, causing newly created archives to be treated as broken and deleted. Creating the icon archive can also fail with “memory exhausted.”

The bundled tar headers hard-code 64-bit widths and limits for size_t and ptrdiff_t, including when compiling for a 32-bit ABI. Those definitions give allocation checks limits that do not match the target types.

What this changes

Derive the widths, limits, and integer literal suffixes from the compiler's target type sizes. Add a compile-only C11 target with static assertions that check the widths, limits, and literal types against the ABI without linking the checks into tar.

How it was tested

  • The transcript records ./gradlew lint test, but provides no output or exit status to establish its result.
  • The transcript records repo_lint, but provides no output or exit status to establish its result.

Fixes #443

Derive the widths, limits, and integer literal suffixes from the
compiler's target type sizes. Add a compile-only C11 target with static
assertions that check the widths, limits, and literal types against the
ABI without linking the checks into tar.

Fixes XayahSuSuSu#443
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] 应用备份失败

1 participant