<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src, branch dev.typealias</title>
<subtitle>github.com: golang/go
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/'/>
<entry>
<title>[dev.typealias] all: merge go1.8.3 into dev.typealias</title>
<updated>2017-06-14T17:53:57+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2017-06-14T17:53:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=8a5ef1501dee0715093e87cdc1c9b6becb81c882'/>
<id>8a5ef1501dee0715093e87cdc1c9b6becb81c882</id>
<content type='text'>
352996a381 (tag: go1.8.3) [release-branch.go1.8] go1.8.3
bb5055d6f1 [release-branch.go1.8] doc: document go1.8.3
439c0c8be8 [release-branch.go1.8] cmd/compile: don't move spills to loop exits where the spill is dead
e396667ba3 [release-branch.go1.8] cmd/compile: zero ambiguously live variables at VARKILLs
daf6706f37 [release-branch.go1.8] runtime: use pselect6 for usleep on linux/386
958c64bbab [release-branch.go1.8] runtime: use pselect6 for usleep on linux/amd64 and linux/arm
195e20a976 [release-branch.go1.8] cmd/compile: ignore types when considering tuple select for CSE
f55bc1c4eb [release-branch.go1.8] net/http: update bundled http2 for gracefulShutdownCh lock contention slowdown
51f508bb4a [release-branch.go1.8] cmd/compile: fix s390x unsigned comparison constant merging rules
243dee1737 [release-branch.go1.8] cmd/go: if we get a C compiler dwarf2 warning, try without -g
a43c0d2dc8 [release-branch.go1.8] runtime: don't corrupt arena bounds on low mmap
1054085dcf [release-branch.go1.8] cmd/compile: fix store chain in schedule pass
18a13d373a [release-branch.go1.8] runtime: doubly fix "double wakeup" panic
6efa2f22ac [release-branch.go1.8] database/sql: ensure releaseConn is defined before a possible close
fb9770f09b [release-branch.go1.8] runtime: print debug info on "base out of range"
b6a8fc8d8c [release-branch.go1.8] doc: remove mentions of yacc tool
59870f9e19 (tag: go1.8.2) [release-branch.go1.8] go1.8.2
c9688ddb6b [release-branch.go1.8] doc: document go1.8.2 and go1.7.6
38d35f49e7 [release-branch.go1.8] crypto/elliptic: fix carry bug in x86-64 P-256 implementation.

Change-Id: I2aa0eab7a990d24e25809fb13ce6cb031104f474
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
352996a381 (tag: go1.8.3) [release-branch.go1.8] go1.8.3
bb5055d6f1 [release-branch.go1.8] doc: document go1.8.3
439c0c8be8 [release-branch.go1.8] cmd/compile: don't move spills to loop exits where the spill is dead
e396667ba3 [release-branch.go1.8] cmd/compile: zero ambiguously live variables at VARKILLs
daf6706f37 [release-branch.go1.8] runtime: use pselect6 for usleep on linux/386
958c64bbab [release-branch.go1.8] runtime: use pselect6 for usleep on linux/amd64 and linux/arm
195e20a976 [release-branch.go1.8] cmd/compile: ignore types when considering tuple select for CSE
f55bc1c4eb [release-branch.go1.8] net/http: update bundled http2 for gracefulShutdownCh lock contention slowdown
51f508bb4a [release-branch.go1.8] cmd/compile: fix s390x unsigned comparison constant merging rules
243dee1737 [release-branch.go1.8] cmd/go: if we get a C compiler dwarf2 warning, try without -g
a43c0d2dc8 [release-branch.go1.8] runtime: don't corrupt arena bounds on low mmap
1054085dcf [release-branch.go1.8] cmd/compile: fix store chain in schedule pass
18a13d373a [release-branch.go1.8] runtime: doubly fix "double wakeup" panic
6efa2f22ac [release-branch.go1.8] database/sql: ensure releaseConn is defined before a possible close
fb9770f09b [release-branch.go1.8] runtime: print debug info on "base out of range"
b6a8fc8d8c [release-branch.go1.8] doc: remove mentions of yacc tool
59870f9e19 (tag: go1.8.2) [release-branch.go1.8] go1.8.2
c9688ddb6b [release-branch.go1.8] doc: document go1.8.2 and go1.7.6
38d35f49e7 [release-branch.go1.8] crypto/elliptic: fix carry bug in x86-64 P-256 implementation.

Change-Id: I2aa0eab7a990d24e25809fb13ce6cb031104f474
</pre>
</div>
</content>
</entry>
<entry>
<title>[release-branch.go1.8] cmd/compile: don't move spills to loop exits where the spill is dead</title>
<updated>2017-05-24T15:44:39+00:00</updated>
<author>
<name>Keith Randall</name>
<email>khr@golang.org</email>
</author>
<published>2017-05-24T05:55:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=439c0c8be85f93306460d82ad12b47c56ee53420'/>
<id>439c0c8be85f93306460d82ad12b47c56ee53420</id>
<content type='text'>
We shouldn't move a spill to a loop exit where the spill itself
is dead.  The stack location assigned to the spill might already
be reused by another spill at this point.

The case we previously handled incorrectly is the one where the value
being spilled is still live, but the spill itself is dead.

Fixes #20472

Patching directly on the release branch because the spill moving code has
already been rewritten for 1.9. (And it doesn't have this bug.)

Change-Id: I26c5273dafd98d66ec448750073c2b354ef89ad6
Reviewed-on: https://go-review.googlesource.com/44033
Run-TryBot: Keith Randall &lt;khr@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Cherry Zhang &lt;cherryyz@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We shouldn't move a spill to a loop exit where the spill itself
is dead.  The stack location assigned to the spill might already
be reused by another spill at this point.

The case we previously handled incorrectly is the one where the value
being spilled is still live, but the spill itself is dead.

Fixes #20472

Patching directly on the release branch because the spill moving code has
already been rewritten for 1.9. (And it doesn't have this bug.)

Change-Id: I26c5273dafd98d66ec448750073c2b354ef89ad6
Reviewed-on: https://go-review.googlesource.com/44033
Run-TryBot: Keith Randall &lt;khr@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Cherry Zhang &lt;cherryyz@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[release-branch.go1.8] cmd/compile: zero ambiguously live variables at VARKILLs</title>
<updated>2017-05-24T15:23:47+00:00</updated>
<author>
<name>Keith Randall</name>
<email>khr@golang.org</email>
</author>
<published>2017-05-23T22:19:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=e396667ba31b971a892bf48229071aed93da1499'/>
<id>e396667ba31b971a892bf48229071aed93da1499</id>
<content type='text'>
This is a redo of CL 41076 backported to the 1.8 release branch.
There were major conflicts, so I had to basically rewrite it again
from scratch.  The way Progs are allocated changed.  Liveness analysis
and Prog generation got reordered.  Liveness analysis changed from
running on gc.BasicBlock to ssa.Block.  All that makes the logic quite
a bit different.

Please review carefully.

From CL 41076:

At VARKILLs, zero a variable if it is ambiguously live.
After the VARKILL anything this variable references
might be collected. If it were to become live again later,
the GC will see references to already-collected objects.

We don't know a variable is ambiguously live until very
late in compilation (after lowering, register allocation, ...),
so it is hard to generate the code in an arch-independent way.
We also have to be careful not to clobber any registers.
Fortunately, this almost never happens so performance is ~irrelevant.

There are only 2 instances where this triggers in the stdlib.

Fixes #20029

Change-Id: Ibb757eec58ee07f40df5e561b19d315684dc4bda
Reviewed-on: https://go-review.googlesource.com/43998
Run-TryBot: Keith Randall &lt;khr@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Matthew Dempsky &lt;mdempsky@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a redo of CL 41076 backported to the 1.8 release branch.
There were major conflicts, so I had to basically rewrite it again
from scratch.  The way Progs are allocated changed.  Liveness analysis
and Prog generation got reordered.  Liveness analysis changed from
running on gc.BasicBlock to ssa.Block.  All that makes the logic quite
a bit different.

Please review carefully.

From CL 41076:

At VARKILLs, zero a variable if it is ambiguously live.
After the VARKILL anything this variable references
might be collected. If it were to become live again later,
the GC will see references to already-collected objects.

We don't know a variable is ambiguously live until very
late in compilation (after lowering, register allocation, ...),
so it is hard to generate the code in an arch-independent way.
We also have to be careful not to clobber any registers.
Fortunately, this almost never happens so performance is ~irrelevant.

There are only 2 instances where this triggers in the stdlib.

Fixes #20029

Change-Id: Ibb757eec58ee07f40df5e561b19d315684dc4bda
Reviewed-on: https://go-review.googlesource.com/43998
Run-TryBot: Keith Randall &lt;khr@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Matthew Dempsky &lt;mdempsky@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[release-branch.go1.8] runtime: use pselect6 for usleep on linux/386</title>
<updated>2017-05-23T23:21:19+00:00</updated>
<author>
<name>Austin Clements</name>
<email>austin@google.com</email>
</author>
<published>2017-05-23T21:54:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=daf6706f374f7895bbabf812c1ffa08516cadf82'/>
<id>daf6706f374f7895bbabf812c1ffa08516cadf82</id>
<content type='text'>
Commit 4dcba023c6 replaced select with pselect6 on linux/amd64 and
linux/arm, but it turns out the Android emulator uses linux/386. This
makes the equivalent change there, too.

Fixes #20409 more.

Change-Id: If542d6ade06309aab8758d5f5f6edec201ca7670
Reviewed-on: https://go-review.googlesource.com/44011
Run-TryBot: Austin Clements &lt;austin@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
(cherry picked from commit ecad34a40ea390ddf5ba2da8f3c3f2c5f15297c8)
Reviewed-on: https://go-review.googlesource.com/44002
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Chris Broadfoot &lt;cbro@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 4dcba023c6 replaced select with pselect6 on linux/amd64 and
linux/arm, but it turns out the Android emulator uses linux/386. This
makes the equivalent change there, too.

Fixes #20409 more.

Change-Id: If542d6ade06309aab8758d5f5f6edec201ca7670
Reviewed-on: https://go-review.googlesource.com/44011
Run-TryBot: Austin Clements &lt;austin@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
(cherry picked from commit ecad34a40ea390ddf5ba2da8f3c3f2c5f15297c8)
Reviewed-on: https://go-review.googlesource.com/44002
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Chris Broadfoot &lt;cbro@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[release-branch.go1.8] runtime: use pselect6 for usleep on linux/amd64 and linux/arm</title>
<updated>2017-05-23T23:21:13+00:00</updated>
<author>
<name>Austin Clements</name>
<email>austin@google.com</email>
</author>
<published>2017-05-18T20:56:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=958c64bbabfea5888913a5e3fdb371f79f45d2b9'/>
<id>958c64bbabfea5888913a5e3fdb371f79f45d2b9</id>
<content type='text'>
Android O black-lists the select system call because its libc, Bionic,
does not use this system call. Replace our use of select with pselect6
(which is allowed) on the platforms that support targeting Android.
linux/arm64 already uses pselect6 because there is no select on arm64,
so only linux/amd64 and linux/arm need changing. pselect6 has been
available since Linux 2.6.16, which is before Go's minimum
requirement.

Fixes #20409.

Change-Id: Ic526b5b259a9e01d2f145a1f4d2e76e8c49ce809
Reviewed-on: https://go-review.googlesource.com/43641
Run-TryBot: Austin Clements &lt;austin@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
(cherry picked from commit 4dcba023c62d7f7968abc54fa5d38d2bf11412ba)
Reviewed-on: https://go-review.googlesource.com/44001
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Chris Broadfoot &lt;cbro@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Android O black-lists the select system call because its libc, Bionic,
does not use this system call. Replace our use of select with pselect6
(which is allowed) on the platforms that support targeting Android.
linux/arm64 already uses pselect6 because there is no select on arm64,
so only linux/amd64 and linux/arm need changing. pselect6 has been
available since Linux 2.6.16, which is before Go's minimum
requirement.

Fixes #20409.

Change-Id: Ic526b5b259a9e01d2f145a1f4d2e76e8c49ce809
Reviewed-on: https://go-review.googlesource.com/43641
Run-TryBot: Austin Clements &lt;austin@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
(cherry picked from commit 4dcba023c62d7f7968abc54fa5d38d2bf11412ba)
Reviewed-on: https://go-review.googlesource.com/44001
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Chris Broadfoot &lt;cbro@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[release-branch.go1.8] cmd/compile: ignore types when considering tuple select for CSE</title>
<updated>2017-05-23T21:25:37+00:00</updated>
<author>
<name>Todd Neal</name>
<email>todd@tneal.org</email>
</author>
<published>2017-04-24T15:20:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=195e20a9768468d580231e62e37e6fb0525ed20e'/>
<id>195e20a9768468d580231e62e37e6fb0525ed20e</id>
<content type='text'>
Fixes #20097

Change-Id: I3c9626ccc8cd0c46a7081ea8650b2ff07a5d4fcd
Reviewed-on: https://go-review.googlesource.com/41505
Run-TryBot: Todd Neal &lt;todd@tneal.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
Reviewed-on: https://go-review.googlesource.com/43997
Run-TryBot: Chris Broadfoot &lt;cbro@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #20097

Change-Id: I3c9626ccc8cd0c46a7081ea8650b2ff07a5d4fcd
Reviewed-on: https://go-review.googlesource.com/41505
Run-TryBot: Todd Neal &lt;todd@tneal.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
Reviewed-on: https://go-review.googlesource.com/43997
Run-TryBot: Chris Broadfoot &lt;cbro@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[release-branch.go1.8] net/http: update bundled http2 for gracefulShutdownCh lock contention slowdown</title>
<updated>2017-05-23T20:37:03+00:00</updated>
<author>
<name>Brad Fitzpatrick</name>
<email>bradfitz@golang.org</email>
</author>
<published>2017-05-23T20:12:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=f55bc1c4ebea3feffed484b7fa8cddb4cd07c1c3'/>
<id>f55bc1c4ebea3feffed484b7fa8cddb4cd07c1c3</id>
<content type='text'>
This updates the bundled x/net/http2 repo to git rev 186fd3fc (from
the net repo's release-branch.go1.8) for:

    [release-branch.go1.8] http2: fix lock contention slowdown due to gracefulShutdownCh
    https://golang.org/cl/43459

Fixes #20302

Change-Id: Ia01a44c6749292de9c16ca330bdebe1e52458b18
Reviewed-on: https://go-review.googlesource.com/43996
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Chris Broadfoot &lt;cbro@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This updates the bundled x/net/http2 repo to git rev 186fd3fc (from
the net repo's release-branch.go1.8) for:

    [release-branch.go1.8] http2: fix lock contention slowdown due to gracefulShutdownCh
    https://golang.org/cl/43459

Fixes #20302

Change-Id: Ia01a44c6749292de9c16ca330bdebe1e52458b18
Reviewed-on: https://go-review.googlesource.com/43996
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Chris Broadfoot &lt;cbro@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[release-branch.go1.8] cmd/compile: fix s390x unsigned comparison constant merging rules</title>
<updated>2017-05-23T20:03:07+00:00</updated>
<author>
<name>Michael Munday</name>
<email>munday@ca.ibm.com</email>
</author>
<published>2017-04-17T16:29:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=51f508bb4aab97e7d0401e78804916453dd77e4c'/>
<id>51f508bb4aab97e7d0401e78804916453dd77e4c</id>
<content type='text'>
On s390x unsigned integer comparisons with immediates require the immediate
to be an unsigned 32-bit integer. The rule was checking that the immediate
was a signed 32-bit integer.

This CL also adds a test for comparisons that could be turned into compare
with immediate or equivalent instructions (depending on architecture and
optimizations applied).

Cherry-pick of CL 40433 and CL 40873.

Fixes #19940.

Reviewed-on: https://go-review.googlesource.com/40931
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;

Change-Id: I3daaeaa40d7637bd4421e6b8d37ea4ffd74448ce
Reviewed-on: https://go-review.googlesource.com/43994
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On s390x unsigned integer comparisons with immediates require the immediate
to be an unsigned 32-bit integer. The rule was checking that the immediate
was a signed 32-bit integer.

This CL also adds a test for comparisons that could be turned into compare
with immediate or equivalent instructions (depending on architecture and
optimizations applied).

Cherry-pick of CL 40433 and CL 40873.

Fixes #19940.

Reviewed-on: https://go-review.googlesource.com/40931
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;

Change-Id: I3daaeaa40d7637bd4421e6b8d37ea4ffd74448ce
Reviewed-on: https://go-review.googlesource.com/43994
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[release-branch.go1.8] cmd/go: if we get a C compiler dwarf2 warning, try without -g</title>
<updated>2017-05-23T20:03:04+00:00</updated>
<author>
<name>Brad Fitzpatrick</name>
<email>bradfitz@golang.org</email>
</author>
<published>2017-05-03T17:50:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=243dee1737c82340064d166abd589dae5f4f0b38'/>
<id>243dee1737c82340064d166abd589dae5f4f0b38</id>
<content type='text'>
Backport of CL 38072

Fixes #14705

Reviewed-on: https://go-review.googlesource.com/42500
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;

Change-Id: Ia6ce2a41434aef2f8745a6a862ea66608b1e25f7
Reviewed-on: https://go-review.googlesource.com/43995
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Backport of CL 38072

Fixes #14705

Reviewed-on: https://go-review.googlesource.com/42500
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;

Change-Id: Ia6ce2a41434aef2f8745a6a862ea66608b1e25f7
Reviewed-on: https://go-review.googlesource.com/43995
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[release-branch.go1.8] runtime: don't corrupt arena bounds on low mmap</title>
<updated>2017-05-23T19:42:57+00:00</updated>
<author>
<name>Austin Clements</name>
<email>austin@google.com</email>
</author>
<published>2017-05-22T19:53:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=a43c0d2dc83bc4f5baa0a91be28078fa892e5111'/>
<id>a43c0d2dc83bc4f5baa0a91be28078fa892e5111</id>
<content type='text'>
Cherry-pick of CL 43870.

If mheap.sysAlloc doesn't have room in the heap arena for an
allocation, it will attempt to map more address space with sysReserve.
sysReserve is given a hint, but can return any unused address range.
Currently, mheap.sysAlloc incorrectly assumes the returned region will
never fall between arena_start and arena_used. If it does,
mheap.sysAlloc will blindly accept the new region as the new
arena_used and arena_end, causing these to decrease and make it so any
Go heap above the new arena_used is no longer considered part of the
Go heap. This assumption *used to be* safe because we had all memory
between arena_start and arena_used mapped, but when we switched to an
arena_start of 0 on 32-bit, it became no longer safe.

Most likely, we've only recently seen this bug occur because we
usually start arena_used just above the binary, which is low in the
address space. Hence, the kernel is very unlikely to give us a region
before arena_used.

Since mheap.sysAlloc is a linear allocator, there's not much we can do
to handle this well. Hence, we fix this problem by simply rejecting
the new region if it isn't after arena_end. In this case, we'll take
the fall-back path and mmap a small region at any address just for the
requested memory.

Fixes #20259.

Change-Id: Ib72e8cd621545002d595c7cade1e817cfe3e5b1e
Reviewed-on: https://go-review.googlesource.com/43954
Run-TryBot: Austin Clements &lt;austin@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Chris Broadfoot &lt;cbro@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cherry-pick of CL 43870.

If mheap.sysAlloc doesn't have room in the heap arena for an
allocation, it will attempt to map more address space with sysReserve.
sysReserve is given a hint, but can return any unused address range.
Currently, mheap.sysAlloc incorrectly assumes the returned region will
never fall between arena_start and arena_used. If it does,
mheap.sysAlloc will blindly accept the new region as the new
arena_used and arena_end, causing these to decrease and make it so any
Go heap above the new arena_used is no longer considered part of the
Go heap. This assumption *used to be* safe because we had all memory
between arena_start and arena_used mapped, but when we switched to an
arena_start of 0 on 32-bit, it became no longer safe.

Most likely, we've only recently seen this bug occur because we
usually start arena_used just above the binary, which is low in the
address space. Hence, the kernel is very unlikely to give us a region
before arena_used.

Since mheap.sysAlloc is a linear allocator, there's not much we can do
to handle this well. Hence, we fix this problem by simply rejecting
the new region if it isn't after arena_end. In this case, we'll take
the fall-back path and mmap a small region at any address just for the
requested memory.

Fixes #20259.

Change-Id: Ib72e8cd621545002d595c7cade1e817cfe3e5b1e
Reviewed-on: https://go-review.googlesource.com/43954
Run-TryBot: Austin Clements &lt;austin@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Chris Broadfoot &lt;cbro@golang.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
