1
0
mirror of https://github.com/golang/go synced 2024-11-19 18:54:41 -07:00
Commit Graph

34851 Commits

Author SHA1 Message Date
Ilya Tocar
1992893307 math: remove asm version of Dim
Dim performance has regressed by 14% vs 1.9 on amd64.
Current pure go version of Dim is faster and,
what is even more important for performance, is inlinable, so
instead of tweaking asm implementation, just remove it.
I had to update BenchmarkDim, because it was simply reloading
constant(answer) in a loop.
Perf data below:

name   old time/op  new time/op  delta
Dim-6  6.79ns ± 0%  1.60ns ± 1%  -76.39%  (p=0.000 n=7+10)

If I modify benchmark to be the same as in this CL results are even better:

name   old time/op  new time/op  delta
Dim-6  10.2ns ± 0%   1.6ns ± 1%  -84.27%  (p=0.000 n=8+10)

Updates #21913

Change-Id: I00e23c8affc293531e1d9f0e0e49f3a525634f53
Reviewed-on: https://go-review.googlesource.com/80695
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-11-30 21:00:33 +00:00
Austin Clements
fa81d6134d runtime: more specific reason for skipping GDB tests on NetBSD
Updates #22893.

Change-Id: I2cf5efb4fa6b77aaf82de5d8877c99f9aa5d519a
Reviewed-on: https://go-review.googlesource.com/81195
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-30 20:57:03 +00:00
Alberto Donizetti
ff534e2130 math/big: protect against aliasing in nat.divLarge
In nat.divLarge (having signature (z nat).divLarge(u, uIn, v nat)),
we check whether z aliases uIn or v, but aliasing is currently not
checked for the u parameter.

Unfortunately, z and u aliasing each other can in some cases cause
errors in the computation.

The q return parameter (which will hold the result's quotient), is
unconditionally initialized as

    q = z.make(m + 1)

When cap(z) ≥ m+1, z.make() will reuse z's backing array, causing q
and z to share the same backing array. If then z aliases u, setting q
during the quotient computation will then corrupt u, which at that
point already holds computation state.

To fix this, we add an alias(z, u) check at the beginning of the
function, taking care of aliasing the same way we already do for uIn
and v.

Fixes #22830

Change-Id: I3ab81120d5af6db7772a062bb1dfc011de91f7ad
Reviewed-on: https://go-review.googlesource.com/78995
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2017-11-30 20:36:54 +00:00
Hana (Hyang-Ah) Kim
5bd66e5e1e cmd/trace: compute pprof-style output per goroutine type
The trace command computes IO, Schedule, Block, and Syscall profiles
by following the unblocking links in the execution trace and summing
up the duration.  This change offers variations of those profiles
that include only selected goroutine types. The id parameter takes the
goroutine type - i.e. pc of the goroutine.

The output is available from the /goroutine view. So, users can see
where the goroutines of interest typically block.

Also, these profiles are available for download so users can use
pprof or other tools to interpret the output. This change adds links
for download of global profile in the main page.

Change-Id: I35699252056d164e60de282b0406caf96d629c85
Reviewed-on: https://go-review.googlesource.com/75710
Reviewed-by: Sameer Ajmani <sameer@golang.org>
2017-11-30 19:34:32 +00:00
Vladimir Stefanovic
6be1c09e19 cmd/compile: use soft-float routines for soft-float targets
Updates #18162 (mostly fixes)

Change-Id: I35bcb8a688bdaa432adb0ddbb73a2f7adda47b9e
Reviewed-on: https://go-review.googlesource.com/37958
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-11-30 17:37:37 +00:00
Brad Fitzpatrick
f0f62fcc46 build: add alternate output format for bootstrap.bash, as used by builders
I've been doing these tweaks by hand. I was going to write a tool in
Go for it, but it's not much additional shell here.

Fixes #22912
Updates #9797 (already closed)

Change-Id: Ia15bd9b6876e6f6a76aa9ca86b10f113095e96a3
Reviewed-on: https://go-review.googlesource.com/80895
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-30 17:37:23 +00:00
Vladimir Stefanovic
2708da0dc1 runtime/cgo, math: don't use FP instructions for soft-float mips{,le}
Updates #18162

Change-Id: I591fcf71a02678a99a56a6487da9689d3c9b1bb6
Reviewed-on: https://go-review.googlesource.com/37955
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-11-30 17:12:32 +00:00
Vladimir Stefanovic
ac987df87c runtime: implement some soft-float routines (used by GOMIPS=softfloat)
Updates #18162

Change-Id: Iee854f48b2d1432955fdb462f2073ebbe76c34f8
Reviewed-on: https://go-review.googlesource.com/37957
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-11-30 17:12:05 +00:00
Vladimir Stefanovic
12abacb555 cmd/go, cmd/dist: introduce GOMIPS environment variable
GOMIPS is a GOARCH=mips{,le} specific option, for a choice between
hard-float and soft-float. Valid values are 'hardfloat' (default) and
'softfloat'. It is passed to the assembler as
'GOMIPS_{hardfloat,softfloat}'.

Note: GOMIPS will later also be used for a choice of MIPS instruction
set (mips32/mips32r2).

Updates #18162

Change-Id: I35417db8625695f09d6ccc3042431dd2eaa756a6
Reviewed-on: https://go-review.googlesource.com/37954
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-11-30 16:57:08 +00:00
Tobias Klauser
4f5018594d cmd/go: fix typo in link action ID hash input string
Fix a typo of "packageshlib" used for generating the link action ID.

Change-Id: Id6d39830908b03de658a58661030c32c592a1da9
Reviewed-on: https://go-review.googlesource.com/80935
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
2017-11-30 16:19:05 +00:00
Than McIntosh
4435fcfd6c compiler,linker: support for DWARF inlined instances
Compiler and linker changes to support DWARF inlined instances,
see https://go.googlesource.com/proposal/+/HEAD/design/22080-dwarf-inlining.md
for design details.

This functionality is gated via the cmd/compile option -gendwarfinl=N,
where N={0,1,2}, where a value of 0 disables dwarf inline generation,
a value of 1 turns on dwarf generation without tracking of formal/local
vars from inlined routines, and a value of 2 enables inlines with
variable tracking.

Updates #22080

Change-Id: I69309b3b815d9fed04aebddc0b8d33d0dbbfad6e
Reviewed-on: https://go-review.googlesource.com/75550
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2017-11-30 14:39:19 +00:00
Cherry Zhang
dbb1d198ab cmd/compile: fix loop depth of range expression in escape analysis
ORANGE node's Right node is the expression it is ranging over,
which is evaluated before the loop. In the escape analysis,
we should walk this node without loop depth incremented.

Fixes #21709.

Change-Id: Idc1e4c76e39afb5a344d85f6b497930a488ce5cf
Reviewed-on: https://go-review.googlesource.com/80740
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2017-11-30 13:45:18 +00:00
Brad Fitzpatrick
8064f82a15 Revert "os: remove skipped test on netbsd"
This reverts commit a631daba5f.

Reason for revert: I was wrong. It still fails on the builders.

I don't know what's different about my VMWare VM, but on GCE it fails.

Change-Id: Ic6bee494b69235768bf08ba0bf59026bca41ad12
Reviewed-on: https://go-review.googlesource.com/80915
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-30 03:32:05 +00:00
Brad Fitzpatrick
ed8b7dedd3 bytes: mention strings.Builder in Buffer.String docs
Fixes #22778

Change-Id: I37f7a59c15828aa720fe787fff42fb3ef17729c7
Reviewed-on: https://go-review.googlesource.com/80815
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-30 01:46:50 +00:00
Brad Fitzpatrick
a631daba5f os: remove skipped test on netbsd
It must've been fixed since NetBSD 7.0. I can no longer reproduce it
with NetBSD 8-BETA (our new minimum NetBSD requirement).

Fixes #19293

Change-Id: I28f970ca41a53a037e1c6cddf1b7f286bda2d725
Reviewed-on: https://go-review.googlesource.com/80875
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-30 01:12:23 +00:00
Robert Griesemer
bbd15ff7c1 go/types: report error when recognizing issue #18395.
The fix (CL 79575) for #18395 is too risky at this stage of the Go 1.10
release process.

Since issue #18395 is easily recognized (but not easily fixed), report
an error instead of silently continuing. This avoids inscrutable follow
on errors.

Also, make sure all empty interfaces are "completed", and adjust
printing code to report incomplete interfaces.

For #18395.

Change-Id: I7fa5f97ff31ac9775c9a6d318fce9f526b0350cd
Reviewed-on: https://go-review.googlesource.com/80455
Reviewed-by: Alan Donovan <adonovan@google.com>
2017-11-29 23:01:29 +00:00
Robert Griesemer
98a8e52149 go/ast: improve documentation for channel directions
Fixes #22815.

Change-Id: Iaa54fa311bf2c0549a6316a0d51cc92425f5ba94
Reviewed-on: https://go-review.googlesource.com/80855
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-29 22:37:38 +00:00
Cherry Zhang
905b1c9804 cmd/vendor/golang.org/x/arch: revendor at commit dda8112
Updates #20650 (CL 45099 introduced the feature to x86).

Change-Id: If40cc9d87417a05281d8633f05cd91f6f434b136
Reviewed-on: https://go-review.googlesource.com/80843
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-29 22:23:32 +00:00
Cherry Zhang
a7dcfa6133 cmd/internal/objfile: make lookupFunc an alias type
In the x/arch repo, CL 45098 introduced SymLookup type, replacing
the unnamed function type for lookup functions. This affects the
signature of x86asm.GoSyntax. In particular, it cannot convert
one named type, namely lookupFunc, to the other without an
explicit cast. Make lookupFunc unnamed to fix.

Change-Id: I973300d29ef1dbfdbd7fc2429e89c5849e6a7329
Reviewed-on: https://go-review.googlesource.com/80842
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-29 22:22:38 +00:00
Matthew Dempsky
2f588ff08f cmd/compile: make -asmhdr work with type aliases
For "type T = U" we were accidentally emitting a #define for "U__size"
instead of "T__size".

Fixes #22877.

Change-Id: I5ed6757d697753ed6d944077c16150759f6e1285
Reviewed-on: https://go-review.googlesource.com/80759
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-29 20:40:41 +00:00
Leigh McCulloch
07a2ffaf0b doc: move single change workflow note in contribution guide
The note about the single change workflow is included in the
git-codereview installation instructions, but it has nothing to do with
installing git-codereview. This note is more relevant for when a change
is actually being made.

Change-Id: Iccb90f3b7da87fab863fa4808438cd69a21a2fce
Reviewed-on: https://go-review.googlesource.com/76317
Reviewed-by: Steve Francia <spf@golang.org>
2017-11-29 20:19:32 +00:00
Brad Fitzpatrick
79bd50852a vendor: update golang.org/x/net/nettest from upstream
Updates to x/net git rev a8b92947779 for CL 80755

Updates #22927

Change-Id: I84aad75afd954c9a6c57ad9a76328b99f1dc74a1
Reviewed-on: https://go-review.googlesource.com/80758
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-29 19:55:02 +00:00
Brad Fitzpatrick
04494f3843 net: skip unixpacket tests on netbsd/386
Updates #22927
Updates #20852

Change-Id: I3ac0f8d38375d58a77781ab0e4f78ca57b258de0
Reviewed-on: https://go-review.googlesource.com/80756
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-29 19:24:24 +00:00
Joe Tsai
9ec0c7abe1 archive/tar: use placeholder name for global PAX records
Several usages of tar (reasonably) just use the Header.FileInfo
to determine the type of the header. However, the os.FileMode type
is not expressive enough to represent "files" that are not files
at all, but some form of metadata.

Thus, Header{Typeflag: TypeXGlobalHeader}.FileInfo().Mode().IsRegular()
reports true, even though the expected result may have been false.

To reduce (not eliminate) the possibility of failure for such usages,
use the placeholder filename from the global PAX headers.
Thus, in the event the user did not handle special "meta" headers
specifically, they will just be written to disk as a regular file.

As an example use case, the "git archive --format=tgz" command produces
an archive where the first "file" is a global PAX header with the
name "global_pax_header". For users that do not explicitly check
the Header.Typeflag field to ignore such headers, they may end up
extracting a file named "global_pax_header". While it is a bogus file,
it at least does not stop the extraction process.

Updates #22748

Change-Id: I28448b528dcfacb4e92311824c33c71b482f49c9
Reviewed-on: https://go-review.googlesource.com/78355
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-29 19:04:57 +00:00
Robert Griesemer
ba1943cd23 go/format: document use of Source better
For #22695.

Change-Id: Idcda3294070aeaeaf940aaf2014b573732fd60a4
Reviewed-on: https://go-review.googlesource.com/80696
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com>
2017-11-29 19:02:00 +00:00
Sebastien Binet
f09a3d8223 runtime: fix documentation typo for gostartcall
This CL is a simple doc typo fix, uncovered while reviewing the go-wasm
port.

Change-Id: I0fce915c341aaaea3a7cc365819abbc5f2c468c3
Reviewed-on: https://go-review.googlesource.com/80715
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-29 18:42:49 +00:00
Jess Frazelle
0c14345c96 cmd/go: ensure pkgsFilter is run before build
Return an error when a user passes -o and -buildmode=exe to build a package
without a main.

Fixes #20017.

Change-Id: I07d49c75e7088a96f00afe18c9faa842c5d71afb
Reviewed-on: https://go-review.googlesource.com/49371
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-11-29 16:54:25 +00:00
Joe Tsai
d85a3535fe archive/zip: preserve old FileHeader.ModTime behavior
In order to avoid a regression where the date of the ModTime method
changed behavior, simply preserve the old behavior of determining
the date based on the legacy fields.

This ensures that anyone relying on ModTime before Go1.10 will have
the exact same behavior as before.
New users should use FileHeader.Modified instead.

We keep the UTC coersion logic in SetModTime since some users
manually compute timezone offsets in order to have precise control
over the MS-DOS time field.

Fixes #22738

Change-Id: Ib18b6ebd863bcf645748e083357dce9bc788cdba
Reviewed-on: https://go-review.googlesource.com/78031
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-29 16:28:13 +00:00
Russ Cox
be67e269b4 archive/zip: replace Writer.Comment field with SetComment method
A method is more in keeping with the rest of the Writer API and
incidentally allows the comment error to be reported earlier.

Fixes #22737.

Change-Id: I1eee2103a0720c76d0c394ccd6541e6219996dc0
Reviewed-on: https://go-review.googlesource.com/79415
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2017-11-29 16:27:42 +00:00
Russ Cox
4f6d8a59ea net/rpc: wait for responses to be written before closing Codec
If there are no more requests being made, wait to shut down
the response-writing codec until the pending requests are all
answered.

Fixes #17239.

Change-Id: Ie62c63ada536171df4e70b73c95f98f778069972
Reviewed-on: https://go-review.googlesource.com/79515
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2017-11-29 16:26:57 +00:00
Brad Fitzpatrick
70ee9b4a07 runtime: fix sysctl calling convention on netbsd/386
Thanks to coypoop for noticing at:

  https://github.com/golang/go/issues/22914#issuecomment-347761838

FreeBSD/386 and NetBSD/386 diverged between Go 1.4 and Go 1.5 when
Russ sent https://golang.org/cl/135830043 (git rev 25f6b02ab0)
to change the calling convention of the C compilers to match Go.
But netbsd wasn't updated.

Tested on a NetBSD/386 VM, since the builders aren't back up yet (due
to this bug)

Fixes #22914
Updates #19339
Updates #20852
Updates #16511

Change-Id: Id76ebe8f29bcc85e39b1c11090639d906cd6cf04
Reviewed-on: https://go-review.googlesource.com/80515
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-29 16:24:04 +00:00
Inanc Gumus
153e4096a8 testing: add -failfast to go test
When -test.failfast flag is provided to go test,
no new tests get started after the first failure.

Fixes #21700

Change-Id: I0092e72f25847af05e7c8e1b811dcbb65a00cbe7
Reviewed-on: https://go-review.googlesource.com/74450
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-11-29 16:20:49 +00:00
Jess Frazelle
4a483ce2ab cmd/cgo: fix for function taking pointer typedef
Fixes #19832

Change-Id: I7ce39c2c435d4716d8a42ac6784b4c87874c0e13
Reviewed-on: https://go-review.googlesource.com/49490
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-11-29 16:12:45 +00:00
Tobias Klauser
06d87bf854 os: correct err check in TestChdirAndGetwd
Due to err being shadowed in the else brach, the actual err return of
fd1.Chdir() is never checked. Fix it by not shadowing err anymore.

Change-Id: I9f1d52e88d8bc9a1c035960aa7af9f5224a63ab0
Reviewed-on: https://go-review.googlesource.com/80556
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-29 15:53:14 +00:00
Tobias Klauser
c3aeeef584 syscall: add missing err check in test
Follow CL 75810 which did the same for x/sys/unix.

Change-Id: I6314a97989631d589369c7b6001d1523ec2cc242
Reviewed-on: https://go-review.googlesource.com/80555
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-29 15:52:59 +00:00
Rob Pike
21672b36eb doc/faq: tweak the wording in the new section on goroutine IDs
There were too many changes of direction. Tidy up the intro a little
for better flow, and delete some unnecessary comments.

Change-Id: Ib5d85c0992626bd3152f86a51585884d3e0cab72
Reviewed-on: https://go-review.googlesource.com/80495
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-29 05:17:03 +00:00
Rob Pike
992ce90f66 doc/faq: explain why goroutines are anonymous
Fixes #22770.

Change-Id: Ief62043fb6895e215d2530d2a3bf88f7ea58c875
Reviewed-on: https://go-review.googlesource.com/80195
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-29 03:24:52 +00:00
David Chase
a5b759aab8 cmd/compile: adjust lineno during import to get Pos right
Binary import sometimes constructs nodes using functions
that use the global lineno for the Position.  This causes
spurious numbers to appear in the assembly and the
debugging output.

Fix (targeted, because late in the cycle): save and restore
lineno around bimport calls known to use lineno-sensitive
functions.

Updates #22600.
(Comment: "This is a weird line to step through")

Change-Id: I9c4094670380609fe4b6696443fb02579521c596
Reviewed-on: https://go-review.googlesource.com/80115
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-11-28 22:36:55 +00:00
Matthew Dempsky
71a9c4430f cmd/compile: fix infinite recursion in isdirectiface
Fixes #22904.

Change-Id: Id504504eda7275c10d3c665add8b7ccd23f65820
Reviewed-on: https://go-review.googlesource.com/80301
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-28 21:58:16 +00:00
Matthew Dempsky
08b19a1c59 cmd/compile: use NoXPos instead of lineno in typenod
typenod is only used for anonymous types, which don't logically have
position information.

Passes toolstash-check.

Updates #19683.

Change-Id: I505424ae980b88c7deed5f23502c3cecb3dc0702
Reviewed-on: https://go-review.googlesource.com/80298
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2017-11-28 19:37:04 +00:00
Mikio Hara
e76ae8af92 all: drop support for FreeBSD 9 or below
This change drops the support for FreeBSD 9 or below and simplifies
platform-dependent code for the sake of maintenance.

Updates #7187.
Fixes #11412.
Updates #16064.
Updates #18854.
Fixes #19072.

Change-Id: I9129130aafbfc7d0d7e9b674b6fc6cb31b7381be
Reviewed-on: https://go-review.googlesource.com/64910
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-28 18:57:25 +00:00
Brad Fitzpatrick
9a13f8e11c cmd/go/internal/get: consistently have trailing slashes in prefixes
Fixes #18122

Change-Id: Ib4067422c0c447ddb2c3068dc6217393abc4eed0
Reviewed-on: https://go-review.googlesource.com/80175
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-28 06:47:50 +00:00
Brad Fitzpatrick
d3c1df7126 net/http: document streaming nature of Response.Body
Fixes #22873

Change-Id: Ib2b7ee42a23b84db21cdfa693b62d5e6fbfdb54e
Reviewed-on: https://go-review.googlesource.com/80075
Reviewed-by: Tom Bergan <tombergan@google.com>
2017-11-28 04:51:12 +00:00
Russ Cox
13f45d09fa net: accept 64 kB lines in /etc/hosts
Apparently 4 kB is not enough for some people.

Fixes #21674.

Change-Id: If39eeb225d548b578560939f6ce51e31060f5aff
Reviewed-on: https://go-review.googlesource.com/79516
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-28 04:46:22 +00:00
Brad Fitzpatrick
5b649ffa23 net/http: update bundled http2
Update http2 to x/net git rev db473f6b23.

(And un-skip TestWriteHeader0_h2 added in CL 80077, now fixed.)

Includes:

   http2: remove afterReqBodyWriteError wrapper
   https://golang.org/cl/75252

   http2: fix transport data race on reused *http.Request objects
   https://golang.org/cl/75530

   http2: require either ECDSA or RSA ciphersuite
   https://golang.org/cl/30721

   http2: don't log about timeouts reading client preface on new connections
   https://golang.org/cl/79498

   http2: don't crash in Transport on server's DATA following bogus HEADERS
   https://golang.org/cl/80056

   http2: panic on invalid WriteHeader status code
   https://golang.org/cl/80076

   http2: fix race on ClientConn.maxFrameSize
   https://golang.org/cl/79238

   http2: don't autodetect Content-Type when the response has an empty body
   https://golang.org/cl/80135

Fixes golang/go#18776
Updates golang/go#20784
Fixes golang/go#21316
Fixes golang/go#22721
Fixes golang/go#22880

Change-Id: Ie86e24e0ee2582a5a82afe5de3c7c801528be069
Reviewed-on: https://go-review.googlesource.com/80078
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
2017-11-28 02:18:57 +00:00
Ian Lance Taylor
b5c7183001 runtime: skip GDB tests on NetBSD
TestGdbAutotmpTypes times out for unknown reasons on NetBSd. Skip the
gdb tests on NetBSD for now.

Updates #22893

Change-Id: Ibb05b7260eabb74d805d374b25a43770939fa5f2
Reviewed-on: https://go-review.googlesource.com/80136
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-28 01:18:54 +00:00
Brad Fitzpatrick
18ae4c834b net/http: panic on invalid WriteHeader status code
Panic if an http Handler does:

    rw.WriteHeader(0)

... or other invalid values. (for a forgiving range of valid)

I previously made it kinda work in https://golang.org/cl/19130 but
there's no good way to fake it in HTTP/2, and we want HTTP/1 and
HTTP/2 behavior to be the same, regardless of what programs do.
Currently HTTP/2 omitted the :status header altogether, which was a
protocol violation. In fixing that, I found CL 19130 added a test
about bogus WriteHeader values with the comment:

  // This might change at some point, but not yet in Go 1.6.

This now changes. Time to be strict.

Updates golang/go#228800

Change-Id: I20eb6c0e514a31f4bba305ac4c24266f39b95fd5
Reviewed-on: https://go-review.googlesource.com/80077
Reviewed-by: Tom Bergan <tombergan@google.com>
2017-11-27 23:35:10 +00:00
Tom Bergan
1c69384da4 net/textproto: reject all headers with a leading space
Previously, golang.org/cl/75350 updated ReadMIMEHeader to ignore the
first header line when it begins with a leading space, as in the
following example:

GET / HTTP/1.1
  Host: foo.com
Accept-Encoding: gzip

However, golang.org/cl/75350 changed ReadMIMEHeader's behavior for the
following example: before the CL it returned an error, but after the
CL it ignored the first line.

GET / HTTP/1.1
  Host foo.com
Accept-Encoding: gzip

This change updates ReadMIMEHeader to always fail when the first header
line starts with a space. During the discussion for golang.org/cl/75350,
we realized we had three competing needs:

1. HTTP clients should accept malformed response headers when possible
   (ignoring the malformed lines).

2. HTTP servers should reject all malformed request headers.

3. The net/textproto package is used by multiple protocols (most notably,
   HTTP and SMTP) which have slightly different parsing semantics. This
   complicates changes to net/textproto.

We weren't sure how to best fix net/textproto without an API change, but
it is too late for API changes in Go 1.10. We decided to ignore initial
lines that begin with spaces, thinking that would have the least impact on
existing users -- malformed headers would continue to parse, but the
initial lines would be ignored. Instead, golang.org/cl/75350 actually
changed ReadMIMEHeader to succeed in cases where it previously failed
(as in the above example).

Reconsidering the above two examples, there does not seem to be a good
argument to silently ignore ` Host: foo.com` but fail on ` Host foo.com`.
Hence, this change fails for *all* headers where the initial line begins
with a space.

Updates #22464

Change-Id: I68d3d190489c350b0bc1549735bf6593fe11a94c
Reviewed-on: https://go-review.googlesource.com/80055
Run-TryBot: Tom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-27 20:26:19 +00:00
rajender
671cf92c32 encoding/json: remove the word "text" in "JSON text" from package docs.
It was added in CL 79995. It is unnecessarily confusing.

Change-Id: Ib8ff35b9f71b54ff99d2d6e0534c7128e1f4345a
Reviewed-on: https://go-review.googlesource.com/80035
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-27 18:51:36 +00:00
rajender
0d26474606 encoding/json: update RFC number
Existing docs mention obsolete RFC 4627. Update it with current one,
https://tools.ietf.org/html/rfc7159.

Current implementation already adhere to RFC 7159.

Fixes #22888

Change-Id: I705ec1313f6f655b3bc41d2f847b30e479bf9b15
Reviewed-on: https://go-review.googlesource.com/79995
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-27 18:04:57 +00:00