syscall.Getpagesize returns wrong page size on aarch64

Bug #1661222 reported by Edward Vielmetti on 2017-02-02
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
golang-1.6 (Ubuntu)
Michael Hudson-Doyle
golang-defaults (Ubuntu)

Bug Description

syscall.Getpagesize returns wrong page size on aarch64.

The code at exercises the issue.

This is fixed upstream at 1.8 with

Downstream, this affects Docker and Kubernetes on aarch64, specifically at for Docker (overlay2 filesystem).

Please consider a backport of the page size fix to 1.6 version of Go that is part of 16.04 LTS.



root@docker-build-test:/mnt/src/vielmetti/go-pagesize-test# lsb_release -rd
Description: Ubuntu 16.04.1 LTS
Release: 16.04

root@docker-build-test:/mnt/src/vielmetti/go-pagesize-test# apt-cache policy golang
  Installed: 2:1.6-1ubuntu4
  Candidate: 2:1.6-1ubuntu4
  Version table:
 *** 2:1.6-1ubuntu4 500
        500 xenial/main arm64 Packages
        100 /var/lib/dpkg/status

What I expected to happen:

C.getpagesize()) and syscall.Getpagesize() return the same value

What happened instead:

On aarch64,

✗ go reports correct pagesize
   (in test file go-pagesize-test.bats, line 3)
     `[ "$status" -eq 0 ]' failed
     OS page size = 4096 ; go reports 65536

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: golang 2:1.6-1ubuntu4
ProcVersionSignature: Ubuntu 4.4.0-38.57-generic 4.4.19
Uname: Linux 4.4.0-38-generic aarch64
ApportVersion: 2.20.1-0ubuntu2.5
Architecture: arm64
Date: Thu Feb 2 11:44:31 2017
PackageArchitecture: all
 PATH=(custom, no user)
SourcePackage: golang-defaults
UpgradeStatus: No upgrade log present (probably fresh install)

Michael Hudson-Doyle (mwhudson) wrote :

I had a quick look at this and it doesn't backport cleanly to 1.6. Can I ask why you are interested in this? I have a PPA (and soon a snap) with newer versions of Go and using those is probably easier than backporting this change...

If Go 1.8 would be available via a PPA that would obviate the need for a fix to Go 1.6.

@mwhudson - when you are ready to test the PPA I am very interested in giving it a spin on a dedicated ARMv8 test server. has
1.8~rc3 already, will have 1.8 when that's done. I could add the patch to
the 1.7 in that PPA too (but not today)

On 11 February 2017 at 05:38, Edward Vielmetti <email address hidden>

> @mwhudson - when you are ready to test the PPA I am very interested in
> giving it a spin on a dedicated ARMv8 test server.
> --
> You received this bug notification because you are subscribed to golang
> in Ubuntu.
> Title:
> syscall.Getpagesize returns wrong page size on aarch64
> To manage notifications about this bug go to:
> 1661222/+subscriptions

Thanks Michael. I see that 1.8 release is out, and will look forward to seeing that when it's ready on your archive.

Michael Hudson-Doyle (mwhudson) wrote :

1.8 final is in my PPA now.

Adam Conrad (adconrad) wrote :

We only ship kernels with one page size on arm64. While backporting the *correct* (dynamic query) fix might be a bit too painful, we should at least consider changing the static value to be "usually correct" (ie: 4k).

Changed in
status: Unknown → New
affects: golang (Ubuntu) → golang-1.6 (Ubuntu)
Changed in golang-1.6 (Ubuntu):
status: New → Invalid
Changed in golang-defaults (Ubuntu):
status: New → Fix Released
dann frazier (dannf) wrote :

With the changes staged at ppa:mwhudson/devirt (1.6.2-0ubuntu5~16.04.4~ppa1):

dannf@d05-3:~/go-pagesize-test$ make
bats go-pagesize-test.bats
 ✓ go reports correct pagesize

1 test, 0 failures

Changed in golang-defaults (Ubuntu Xenial):
status: New → Invalid
Changed in golang-1.6 (Ubuntu Xenial):
status: New → In Progress
assignee: nobody → Michael Hudson-Doyle (mwhudson)

Hello Edward, or anyone else affected,

Accepted golang-1.6 into xenial-proposed. The package will build now and be available at in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at . Thank you in advance!

Changed in golang-1.6 (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-xenial

The test I ran was with

`golang-1.6/xenial-proposed,now 1.6.2-0ubuntu5~16.04.4 all [installed,automatic]`

on an arm64 system. The test code is at

With this version, I get the following results on a Cavium ThunderX based Packet Type 2A system:

# make
bats go-pagesize-test.bats
 ✓ go reports correct pagesize

1 test, 0 failures

tags: added: verification-done-xenial
removed: verification-needed-xenial
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package golang-1.6 - 1.6.2-0ubuntu5~16.04.4

golang-1.6 (1.6.2-0ubuntu5~16.04.4) xenial; urgency=medium

  * Add d/patches/0004-arm64-better-guessed-page-size.patch to fix problems
    seen with docker on arm64 systems. (LP: #1661222)

 -- Michael Hudson-Doyle <email address hidden> Wed, 19 Jul 2017 10:56:27 +1200

Changed in golang-1.6 (Ubuntu Xenial):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for golang-1.6 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Changed in
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.