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.17 backport] #48116

Closed
gopherbot opened this issue Sep 1, 2021 · 3 comments
Labels
CherryPickApproved
Milestone

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 1, 2021

@mknyszek requested issue #46860 to be considered for backport to the next 1.17 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.17.1 milestone Sep 1, 2021
@thanm thanm removed this from the Go1.17.1 milestone Sep 9, 2021
@thanm thanm added this to the Go1.17.2 milestone Sep 9, 2021
@mknyszek mknyszek removed this from the Go1.17.2 milestone Oct 7, 2021
@mknyszek mknyszek added this to the Go1.17.3 milestone Oct 7, 2021
@thanm thanm removed this from the Go1.17.3 milestone Nov 4, 2021
@thanm thanm added this to the Go1.17.4 milestone Nov 4, 2021
@heschi heschi removed this from the Go1.17.4 milestone Dec 2, 2021
@heschi heschi added this to the Go1.17.5 milestone Dec 2, 2021
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Dec 6, 2021

Change https://golang.org/cl/369737 mentions this issue: [release-branch.go1.17] runtime: set iOS addr space to 40 bits with incremental pagealloc

@mknyszek
Copy link
Contributor

@mknyszek mknyszek commented Dec 7, 2021

Hey release team! :) Please feel free to submit this one once it's approved.

@toothrot toothrot removed this from the Go1.17.5 milestone Dec 9, 2021
@toothrot toothrot added this to the Go1.17.6 milestone Dec 9, 2021
@cherrymui cherrymui added CherryPickApproved and removed CherryPickCandidate labels Dec 15, 2021
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Dec 22, 2021

Closed by merging 1242f43 to release-branch.go1.17.

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 #48116.

Change-Id: I13865f799777739109585f14f1cc49d6d57e096b
Reviewed-on: https://go-review.googlesource.com/c/go/+/344401
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
(cherry picked from commit af368da0b137116faba81ca249a8d964297e6e45)
Reviewed-on: https://go-review.googlesource.com/c/go/+/369737
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved
Projects
None yet
Development

No branches or pull requests

6 participants