Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: mallocs cause "base outside usable address space" panic when running on iOS 14 [1.16 backport] #48115

gopherbot opened this issue Sep 1, 2021 · 2 comments


Copy link

@gopherbot gopherbot commented Sep 1, 2021

@mknyszek requested issue #46860 to be considered for backport to the next 1.16 minor release.

@gopherbot Please open backport issues for 1.16 and 1.17.

I think so. This failure doesn't seem to have a reasonable workaround (use less memory?) and otherwise means iOS >=14 Go apps can just break.

@gopherbot gopherbot added the CherryPickCandidate label Sep 1, 2021
@gopherbot gopherbot added this to the Go1.16.8 milestone Sep 1, 2021
@thanm thanm removed this from the Go1.16.8 milestone Sep 9, 2021
@thanm thanm added this to the Go1.16.9 milestone Sep 9, 2021
@mknyszek mknyszek removed this from the Go1.16.9 milestone Oct 7, 2021
@mknyszek mknyszek added this to the Go1.16.10 milestone Oct 7, 2021
@thanm thanm removed this from the Go1.16.10 milestone Nov 4, 2021
@thanm thanm added this to the Go1.16.11 milestone Nov 4, 2021
@heschi heschi removed this from the Go1.16.11 milestone Dec 2, 2021
@heschi heschi added this to the Go1.16.12 milestone Dec 2, 2021
Copy link

@gopherbot gopherbot commented Dec 6, 2021

Change mentions this issue: [release-branch.go1.16] runtime: set iOS addr space to 40 bits with incremental pagealloc

@toothrot toothrot removed this from the Go1.16.12 milestone Dec 9, 2021
@toothrot toothrot added this to the Go1.16.13 milestone Dec 9, 2021
@cherrymui cherrymui added CherryPickApproved and removed CherryPickCandidate labels Dec 15, 2021
Copy link

@gopherbot gopherbot commented Dec 22, 2021

Closed by merging 169be8e to release-branch.go1.16.

gopherbot pushed a commit that referenced this issue Dec 22, 2021
…ncremental pagealloc

In iOS <14, the address space is strictly limited to 8 GiB, or 33 bits.
As a result, the page allocator also assumes all heap memory lives in
this region. This is especially necessary because the page allocator has
a PROT_NONE mapping proportional to the size of the usable address
space, so this keeps that mapping very small.

However starting with iOS 14, this restriction is relaxed, and mmap may
start returning addresses outside of the <14 range. Today this means
that in iOS 14 and later, users experience an error in the page
allocator when a heap arena is mapped outside of the old range.

This change increases the ios/arm64 heapAddrBits to 40 while
simultaneously making ios/arm64 use the 64-bit pagealloc implementation
(with reservations and incremental mapping) to accommodate both iOS
versions <14 and 14+.

Once iOS <14 is deprecated, we can remove these exceptions and treat
ios/arm64 like any other arm64 platform.

This change also makes the BaseChunkIdx expression a little bit easier
to read, while we're here.

For #46860.
Fixes #48115.

Change-Id: I13865f799777739109585f14f1cc49d6d57e096b
Trust: Michael Knyszek <>
Run-TryBot: Michael Knyszek <>
TryBot-Result: Gopher Robot <>
Reviewed-by: Cherry Mui <>
Reviewed-by: Austin Clements <>
(cherry picked from commit af368da0b137116faba81ca249a8d964297e6e45)
Run-TryBot: Dmitri Shuralyov <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

6 participants