Fix emutls crash on macOS ARM64#23
Closed
Icehunter wants to merge 1 commit into
Closed
Conversation
Hooks __emutls_get_address to correct invalid alignment values that cause crashes on macOS ARM64. Some Android libraries use emulated TLS with alignment values that are not powers of two, which the host allocator rejects. This corrects the alignment before allocation.
Author
|
This is also related to: google/angle#103 Locally when I run everything after a build a get a substantial improvement in vibrant visuals, but i'm still fighting over some artifacts on/in water, and some leaf shading during the day. |
Member
|
Is this PR a copy of #22 ?? |
Author
|
I actually didn't see that one sorry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hooks __emutls_get_address to correct invalid alignment values that cause crashes on macOS ARM64. Some Android libraries (loaded via the mcpelauncher linker) use emulated TLS with alignment values that are not powers of two, which the host allocator rejects.
Changes
Testing
This fix is required alongside mcpelauncher-client PR minecraft-linux/mcpelauncher-client#136 for Minecraft 1.26.x on macOS ARM64.
Without this fix, the game crashes during library loading with a SIGABRT from the allocator due to non-power-of-two alignment in emulated TLS control blocks.
Tested on Apple M5 Pro, macOS 26.3, Minecraft Bedrock 1.26.10.4.
https://www.youtube.com/watch?v=lBNuIqISYa4