go/src
Austin Clements 336dad2a07 runtime: fix check for vacuous page boundary rounding
sysUnused (e.g., madvise MADV_FREE) is only sensible to call on
physical page boundaries, so scavengelist rounds in the bounds of the
region being released to the nearest physical page boundaries.
However, if the region is smaller than a physical page and neither the
start nor end fall on a boundary, then rounding the start up to a page
boundary and the end down to a page boundary will result in end < start.
Currently, we only give up on the region if start == end, so if we
encounter end < start, we'll call madvise with a negative length and
the madvise will fail.

Issue #16644 gives a concrete example of this:

    start = 0x1285ac000
    end   = 0x1285ae000 (1 8K page)

This leads to the rounded values

    start = 0x1285b0000
    end   = 0x1285a0000

which leads to len = -65536.

Fix this by giving up on the region if end <= start, not just if
end == start.

Fixes #16644.

Change-Id: I8300db492dbadc82ac1ad878318b36bcb7c39524
Reviewed-on: https://go-review.googlesource.com/27230
Reviewed-by: Keith Randall <khr@golang.org>
2016-08-17 14:04:16 +00:00
..
archive archive/tar: preallocate slice from paxHeaders 2016-08-16 02:46:50 +00:00
bufio all: use SeekStart, SeekCurrent, SeekEnd 2016-05-06 00:10:41 +00:00
builtin
bytes bytes: add examples 2016-08-16 01:33:32 +00:00
cmd cmd/compile: handle e == T comparison more efficiently 2016-08-17 01:12:23 +00:00
compress compress/flate: document HuffmanOnly 2016-07-25 23:20:40 +00:00
container container/list: silence vet warnings 2016-08-16 14:35:37 +00:00
context context: add test for WithDeadline in the past 2016-07-26 14:53:38 +00:00
crypto crypto/cipher, math/big: fix example names 2016-08-16 14:36:32 +00:00
database/sql database/sql: deflake TestPendingConnsAfterErr and fix races, panics 2016-06-28 21:37:53 +00:00
debug debug/pe: handle files with no string table 2016-06-19 05:18:09 +00:00
encoding encoding/json: add example for RawMessage marshalling 2016-08-16 00:22:47 +00:00
errors
expvar expvar: slightly expand documentation for Var's String method 2016-05-19 04:20:47 +00:00
flag flag: recognize "0s" as the zero value for a flag.Duration 2016-05-31 23:45:47 +00:00
fmt fmt: properly handle early io.EOF Reads in readRune.readByte 2016-07-16 19:14:58 +00:00
go go/build: introduce go1.8 build tag 2016-08-17 01:42:00 +00:00
hash hash/crc64: Use slicing by 8. 2016-05-18 14:38:04 +00:00
html html/template: update security model link 2016-06-23 04:30:07 +00:00
image image/gif: accept an out-of-bounds transparent color index. 2016-04-29 00:01:22 +00:00
index/suffixarray
internal internal/trace: err if binary is not supplied for old trace 2016-06-16 16:22:03 +00:00
io io: use SeekStart, SeekCurrent, and SeekEnd in io.Seeker documentation 2016-05-29 06:52:45 +00:00
log
math crypto/cipher, math/big: fix example names 2016-08-16 14:36:32 +00:00
mime mime/multipart: sort header keys to ensure reproducible output 2016-05-16 22:55:16 +00:00
net net: simplify internal dtoi and xtoi funcs 2016-08-17 03:12:29 +00:00
os os/exec: fix nit found by vet 2016-08-16 00:44:45 +00:00
path path/filepath: fix typo in comment 2016-07-07 02:59:09 +00:00
reflect reflect: clear tflag on new types 2016-08-16 16:58:15 +00:00
regexp regexp: add some tests that were fixed in #12980 2016-08-16 18:36:43 +00:00
runtime runtime: fix check for vacuous page boundary rounding 2016-08-17 14:04:16 +00:00
sort
strconv strconv: clarify doc for Atoi return type 2016-06-28 18:16:25 +00:00
strings strings: add special cases for Join of 2 and 3 strings 2016-08-16 00:33:15 +00:00
sync sync: document that RWMutex read locks may not be held recursively 2016-05-31 00:22:56 +00:00
syscall syscall: mksyscall_windows.go: put path separator in suffix for matching GOROOT 2016-08-17 05:57:30 +00:00
testing testing: respect benchtime on very fast benchmarks 2016-08-10 19:44:08 +00:00
text text/template: fix Parse when called twice with empty text 2016-08-16 23:49:42 +00:00
time all: fix "result not used" vet warnings 2016-08-16 14:15:10 +00:00
unicode unicode: upgrade to version 9.0.0 2016-06-28 15:08:11 +00:00
unsafe
vendor/golang_org/x/net all: rename vendored golang.org/x/net packages to golang_org 2016-07-13 18:35:40 +00:00
Make.dist
all.bash
all.bat
all.rc
androidtest.bash all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
bootstrap.bash all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash build: unset GOBIN during build 2016-05-19 18:40:53 +00:00
make.bat build: unset GOBIN during build 2016-05-19 18:40:53 +00:00
make.rc build: unset GOBIN during build 2016-05-19 18:40:53 +00:00
naclmake.bash
nacltest.bash all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
race.bash
race.bat
run.bash build: unset GOBIN during build 2016-05-19 18:40:53 +00:00
run.bat build: unset GOBIN during build 2016-05-19 18:40:53 +00:00
run.rc build: unset GOBIN during build 2016-05-19 18:40:53 +00:00