Skip to content

Conversation

@robertkirkman
Copy link
Member

@robertkirkman robertkirkman commented Oct 29, 2025

tar -C "$TERMUX_PREFIX_CLASSICAL" -N "$TERMUX_BUILD_TS_FILE" --exclude='tmp' -cf - . | \

@robertkirkman robertkirkman changed the title fix(main/openjdk-{17,21,25}): patch TMP_BUFFER_LEN to be relative t… fix(main/openjdk-{17,21,25}): patch TMP_BUFFER_LEN to be relative to the build-time length of @TERMUX_PREFIX@/tmp Oct 29, 2025
@robertkirkman robertkirkman marked this pull request as draft October 29, 2025 10:25
@robertkirkman
Copy link
Member Author

more changes may be necessary, please wait

…o the build-time length of `@TERMUX_PREFIX@/tmp`

- Fixes termux#27045

- It is also necessary to hardcode `char* tmpdir = "@TERMUX_PREFIX@/tmp";` because OpenJDK has an internal hostbuild that will crash at build-time if it is not also redirected to use `@TERMUX_PREFIX@/tmp` instead of `/tmp` simultaneously
  - This is OK because `@TERMUX_PREFIX@/tmp` is already a directory excluded from packaging globally, so it is safe to use as a tmpdir at build-time of anything

https://github.com/termux/termux-packages/blob/f7d37694465b0c2985a573df8992ec08a1873f16/scripts/build/termux_step_copy_into_massagedir.sh#L5

- The crash is only easily reproducible in the 32-bit ARM build of `openjdk-25`, but the same code exists possibly-dormant in every OpenJDK, so should be patched in all
@robertkirkman robertkirkman marked this pull request as ready for review October 30, 2025 11:23
@robertkirkman robertkirkman marked this pull request as draft October 30, 2025 11:24
@robertkirkman robertkirkman changed the title fix(main/openjdk-{17,21,25}): patch TMP_BUFFER_LEN to be relative to the build-time length of @TERMUX_PREFIX@/tmp fix(main/openjdk-{17,21,25}): fix multiple crashes Oct 30, 2025
@robertkirkman
Copy link
Member Author

robertkirkman commented Oct 31, 2025

Status update:

  • After 30 hours of bisecting, 2 commits which break OpenJDK on 32-bit ARM Android have been found in between OpenJDK 23 and OpenJDK 24 and successful workarounds for them written and applied here to OpenJDK 25.

  • It is believed that there are at least 2 other commits which also break OpenJDK on 32-bit ARM Android in other ways that are not yet found.

    • One of the commits is believed to be introduced somewhere in between OpenJDK 17 and OpenJDK 21
      • and there is also believed to be a follow-up commit that unbreaks it somewhere in between OpenJDK 21 and OpenJDK 22
    • The other commit is believed to be introduced somewhere in between OpenJDK 21 and OpenJDK 22
      • (and current bisecting progress indicates that it seems to be somewhere shortly after, not before or the same as, the commit that unbreaks the commit that broke OpenJDK 21)

I am currently building and testing hundreds of intermediate development commits of OpenJDK for 32-bit ARM Android in order to bisect the remaining two commits that are currently unknown, working backwards from newer to older OpenJDKs until all commits broken on 32-bit ARM Android are precisely identified and then reverted or worked around.

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]: 32-bit ARM build of openjdk-25 has Illegal instruction (also, unpatched TMP_BUFFER_LEN discovered)

1 participant