- 01 Nov, 2016 8 commits
-
-
Martin Möhrmann authored
- Adds overflow checks - Adds parsing of negative integers - Adds boolean return value to signal parsing errors - Adds atoi32 for parsing of integers that fit in an int32 - Adds tests Handling of errors to provide error messages at the call sites is left to future CLs. Updates #17718 Change-Id: I3cacd0ab1230b9efc5404c68edae7304d39bcbc0 Reviewed-on: https://go-review.googlesource.com/32390Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Carlos Eduardo Seo authored
This implements a check that can be done at runtime for the ISA level and hardware capability. It follows the same implementation as in s390x. These checks will be important as we enable new instructions and write go asm implementations using those. Updates #15403 Fixes #16643 Change-Id: Idfee374a3ffd7cf13a7d8cf0a6c83d247d3bee16 Reviewed-on: https://go-review.googlesource.com/32330Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Michael Munday authored
Use vector instructions to speed up indexing operations for short strings (64 bytes or less). bytes_s390x.go and strings_s390x.go are based on their amd64 equivalents in CL 31690. bytes package: name old time/op new time/op delta Index/10 40.3ns ± 7% 11.3ns ± 4% -72.06% (p=0.000 n=10+10) Index/32 196ns ± 1% 27ns ± 2% -86.25% (p=0.000 n=10+10) Index/4K 28.9µs ± 1% 1.5µs ± 2% -94.94% (p=0.000 n=9+9) Index/4M 30.1ms ± 2% 1.5ms ± 3% -94.94% (p=0.000 n=10+10) Index/64M 549ms ±13% 28ms ± 3% -94.87% (p=0.000 n=10+9) IndexEasy/10 18.8ns ±11% 11.5ns ± 2% -38.81% (p=0.000 n=10+10) IndexEasy/32 23.6ns ± 6% 28.1ns ± 3% +19.29% (p=0.000 n=10+10) IndexEasy/4K 251ns ± 5% 223ns ± 8% -11.04% (p=0.000 n=10+10) IndexEasy/4M 318µs ± 9% 266µs ± 8% -16.42% (p=0.000 n=10+10) IndexEasy/64M 14.7ms ±16% 13.2ms ±11% -10.22% (p=0.001 n=10+10) strings package: name old time/op new time/op delta IndexRune 88.1ns ±16% 28.9ns ± 4% -67.20% (p=0.000 n=10+10) IndexRuneLongString 456ns ± 7% 34ns ± 3% -92.50% (p=0.000 n=10+10) IndexRuneFastPath 12.9ns ±14% 11.1ns ± 6% -13.84% (p=0.000 n=10+10) Index 13.0ns ± 7% 11.3ns ± 4% -13.31% (p=0.000 n=10+10) IndexHard1 3.38ms ± 9% 0.07ms ± 1% -97.79% (p=0.000 n=10+10) IndexHard2 3.58ms ± 7% 0.37ms ± 2% -89.78% (p=0.000 n=10+10) IndexHard3 3.47ms ± 7% 0.75ms ± 1% -78.52% (p=0.000 n=10+10) IndexHard4 3.56ms ± 6% 1.34ms ± 0% -62.39% (p=0.000 n=9+9) Change-Id: If36c2afb8c02e80fcaa1cf5ec2abb0a2be08c7d1 Reviewed-on: https://go-review.googlesource.com/32447 Run-TryBot: Michael Munday <munday@ca.ibm.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Daniel Martí authored
In a previous change, cmd/go was taught to show a "no tests ran" warning if test did nothing. But it missed a case - if no tests nor examples ran but any benchmarks were meant to be run, it would still produce the warning. This meant that running only benchmarks, which is common, would be confusing: $ go test -run='^$' -bench=. testing: warning: no tests to run BenchmarkFoo-4 300000 5056 ns/op [...] I believe this was because of a copy-paste error in the tests. This was being tested, but on the wrong file which does contain a test that was being run. Fix the path and fix the now failing test by never showing the warning if -bench was given a non-empty string. The rationale is that if -bench was given but there was no output, it's obvious that nothing happened as benchmarks always produce output even without -v. So showing a warning in those cases is redundant. To make future typos less likely, make sure that no tests are being run in the cases where we only want to run benchmarks. Fixes #17603. Change-Id: I4c626caf39f72260c6a9761c06446663f465f947 Reviewed-on: https://go-review.googlesource.com/32157Reviewed-by: Marcel van Lohuizen <mpvl@golang.org> Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Emmanuel Odeke authored
Adds ModifyResponse, an optional func to ReverseProxy that modifies a response in the backend, right before the headers of the response are written to the internal response writer. If ModifyResponse returns an error, the proxy returns a StatusBadGateway error. Fixes #14237. Change-Id: I8e03139e34dea0084512ccbd8cc49e941bf9fb5d Reviewed-on: https://go-review.googlesource.com/32356Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Joe Tsai authored
This CL expands upon a change made in (http://golang.org/cl/21811) to ensure that a nil RawMessage gets serialized as "null" instead of being a nil slice. The added check only triggers when the RawMessage is nil. We do not handle the case when the RawMessage is non-nil, but empty. Fixes #17704 Updates #14493 Change-Id: I0fbebcdd81f7466c5b78c94953afc897f162ceb4 Reviewed-on: https://go-review.googlesource.com/32472Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Robert Griesemer authored
If no error handler is provided, terminate parsing with first error and report that error. Fixes #17697. Change-Id: I9070faf7239bd53725de141507912b92ded3474b Reviewed-on: https://go-review.googlesource.com/32456 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Brad Fitzpatrick authored
Also updates x/net/http2 to git rev 541150 for: http2: add support for graceful shutdown of Server https://golang.org/cl/32412 http2: make http2.Server access http1's Server via an interface check https://golang.org/cl/32417 Fixes #4674 Fixes #9478 Change-Id: I8021a18dee0ef2fe3946ac1776d2b10d3d429052 Reviewed-on: https://go-review.googlesource.com/32329 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 31 Oct, 2016 28 commits
-
-
Matthew Dempsky authored
Change-Id: I54f8788a4703283b9aa3904e2e610097ac3e3586 Reviewed-on: https://go-review.googlesource.com/32471 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Austin Clements authored
Currently we have write barriers for direct channel sends, where the receiver is blocked and the sender is writing directly to the receiver's stack; but not for direct channel receives, where the sender is blocked and the receiver is reading directly from the sender's stack. This was okay with the old write barrier because either 1) the receiver would write the received pointer into the heap (causing it to be shaded), 2) the pointer would still be on the receiver's stack at mark termination and we would rescan it, or 3) the receiver dropped the pointer so it wasn't necessarily reachable anyway. This is not okay with the write barrier because it lets a grey stack send a white pointer to a black stack and then remove it from its own stack. If the grey stack was the sole grey-protector of this pointer, this hides the object from the garbage collector. Fix this by making direct receives perform a stack-to-stack write barrier just like direct sends do. Fixes #17694. Change-Id: I1a4cb904e4138d2ac22f96a3e986635534a5ae41 Reviewed-on: https://go-review.googlesource.com/32450Reviewed-by: Rick Hudson <rlh@golang.org>
-
Dhananjay Nakrani authored
typecheckcomplit nils out node's type, upon finding new errors. This hides new errors in children's node as well as the type info of current node. This change fixes that. Fixes #17645. Change-Id: Ib473291f31c7e8fa0307cb1d494e0c112ddd3583 Reviewed-on: https://go-review.googlesource.com/32324Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Austin Clements authored
Currently, assists can only perform heap marking jobs. However, at the beginning of GC, there are only root jobs and no heap marking jobs. As a result, there's often a period at the beginning of a GC cycle where no goroutine has accumulated assist credit, but at the same time it can't get any credit because there are no heap marking jobs for it to do yet. As a result, many goroutines often block on the assist queue at the very beginning of the GC cycle. This commit fixes this by allowing assists to perform root marking jobs. The tricky part of this (and the reason we haven't done this before) is that stack scanning jobs can lead to deadlocks if the goroutines performing the stack scanning are themselves non-preemptible, since two non-preemptible goroutines may try to scan each other. To address this, we use the same insight d6625caf used to simplify the mark worker stack scanning: as long as we're careful with the stacks and only drain jobs while on the system stack, we can put the goroutine into a preemptible state while we drain jobs. This means an assist's user stack can be scanned while it continues to do work. This reduces the rate of assist blocking in the x/benchmarks HTTP benchmark by a factor of 3 and all remaining blocking happens towards the *end* of the GC cycle, when there may genuinely not be enough work to go around. Ideally, assists would get credit for working on root jobs. Currently they do not; however, this change prioritizes heap work over root jobs in assists, so they're likely to mostly perform heap work. In contrast with mark workers, for assists, the root jobs act only as a backstop to create heap work when there isn't enough heap work. Fixes #15361. Change-Id: If6e169863e4ad75710b0c8dc00f6125b41e9a595 Reviewed-on: https://go-review.googlesource.com/32432Reviewed-by: Rick Hudson <rlh@golang.org>
-
Austin Clements authored
This lifts the part of gcAssistAlloc that runs on the system stack to its own function in preparation for letting assists perform root jobs (notably stack scanning). This makes it easy to see that there are no references to the user stack once we've entered gcAssistAlloc1, which means it's safe to shrink the stack while in gcAssistAlloc1. This does not yet make assists perform root jobs, so it's not actually possible for the stack to shrink yet. That will happen in the next commit. The code in gcAssistAlloc1 is identical to the code that's currently passed in a closure to systemstack with one exception. Currently, we set the "completed" variable in the enclosing scope to indicate that the assist completed the mark phase. This is exactly the sort of cross-stack reference lifting this function is meant to prevent. We replace this variable with setting gp.param to nil or non-nil to indicate the completion status. Updates #15361. Change-Id: Iba7cfb758c781070a441aea86c0117b399a24dbd Reviewed-on: https://go-review.googlesource.com/32431 TryBot-Result: Gobot Gobot <gobot@golang.org> Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Rick Hudson <rlh@golang.org>
-
Robert Griesemer authored
Change-Id: I113ea712838511ee823375d9ea059089195414f5 Reviewed-on: https://go-review.googlesource.com/32449 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
-
Jaana Burcu Dogan authored
Fixes #16910. Change-Id: I0e97e88bee0361cd3621cacd1d4b84e6e42af718 Reviewed-on: https://go-review.googlesource.com/32424Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Robert Griesemer authored
Change-Id: Iba5cfa033483b843dbd3681ffad50b117cced4a7 Reviewed-on: https://go-review.googlesource.com/32448Reviewed-by: Alan Donovan <adonovan@google.com>
-
Dhananjay Nakrani authored
Previously, on encountering Func.Nname.Type == nil, typecheckfunc() returned without initializing Decldepth for that func. This causes typecheckclosure() to fatal. This change ensures that we initialize Decldepth in all cases. Fixes #17588. Change-Id: I2e3c81ad52e8383395025388989e8dbf03438b68 Reviewed-on: https://go-review.googlesource.com/32415Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Keith Randall authored
We used to have to keep on-stack copies of these types. Now they can be registerized. [0]T is kind of trivial but might as well handle it. This change enables another change I'm working on to improve how x.(T) expressions are handled (#17405). This CL helps because now all types that are direct interface types are registerizeable (e.g. [1]*byte). No higher-degree arrays for now because non-constant indexes are hard. Update #17405 Change-Id: I2399940965d17b3969ae66f6fe447a8cefdd6edd Reviewed-on: https://go-review.googlesource.com/32416 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
David Chase authored
This is an extension of https://go-review.googlesource.com/c/31662/ to mark all the temporaries, not just the ssa-generated ones. Before-and-after ls -l `go tool -n compile` shows a 3% reduction in size (or rather, a prior 3% inflation for failing to filter temps out properly.) Replaced name-dependent "is it a temp?" tests with calls to *Node.IsAutoTmp(), which depends on AutoTemp. Also replace calls to istemp(n) with n.IsAutoTmp(), to reduce duplication and clean up function name space. Generated temporaries now come with a "." prefix to avoid (apparently harmless) clashes with legal Go variable names. Fixes #17644. Fixes #17240. Change-Id: If1417f29c79a7275d7303ddf859b51472890fd43 Reviewed-on: https://go-review.googlesource.com/32255 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Robert Griesemer authored
Change-Id: I8a28a88a655d9929f8641f71573dc01dc53be00f Reviewed-on: https://go-review.googlesource.com/32443Reviewed-by: Alan Donovan <adonovan@google.com>
-
Josh Bleecher Snyder authored
This picks up just a trivial fix, making vet (and thus me) happy. Change-Id: Ib82ae44c081ff1ec5c078196a6cd5e1a3505d03b Reviewed-on: https://go-review.googlesource.com/32427 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
Change-Id: Ic66eb2939d83559610e62cbb181a8faa6193ecc4 Reviewed-on: https://go-review.googlesource.com/32426 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
Makes vet happy. Change-Id: I00de44a844afa57901b31991acf9e7ac834a9572 Reviewed-on: https://go-review.googlesource.com/32425 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Robert Griesemer authored
Fixes #17592. Change-Id: I914fa8c0729012990878b6e5c3e99b0f9b0e2be8 Reviewed-on: https://go-review.googlesource.com/32350 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
-
Matthew Dempsky authored
-M, -P, and -R were for debugging backend passes that no longer exists. -g is used for debugging instructions generated with Gins, but the SSA backend mostly generates instructions directly. The handful of instructions still generated with Gins are pretty useless for debugging. -x was used to debug the old lexer, but now it only causes us to print file names as they're parsed, and only if we manually hack the compiler to enable tracing. Change-Id: Ia58d4bc9c1312693466171a3fcefc1221e9a2381 Reviewed-on: https://go-review.googlesource.com/32428 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Mike Strosaker authored
Adds an assembly implementation of sha256.block for ppc64le to improve its performance. This implementation is largely based on the original amd64 implementation, which unrolls the 64 iterations of the inner loop. Fixes #17652 benchmark old ns/op new ns/op delta BenchmarkHash8Bytes 1263 767 -39.27% BenchmarkHash1K 14048 7766 -44.72% BenchmarkHash8K 102245 55626 -45.60% benchmark old MB/s new MB/s speedup BenchmarkHash8Bytes 6.33 10.43 1.65x BenchmarkHash1K 72.89 131.85 1.81x BenchmarkHash8K 80.12 147.27 1.84x Change-Id: Ib4adf429423b20495580400be10bd7e171bcc70b Reviewed-on: https://go-review.googlesource.com/32318Reviewed-by: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Mike Strosaker authored
Adds an assembly implementation of sha512.block for ppc64le to improve its performance. This implementation is largely based on the original amd64 implementation, unrolling the 80 iterations of the inner loop. Fixes #17660 benchmark old ns/op new ns/op delta BenchmarkHash8Bytes 1715 1133 -33.94% BenchmarkHash1K 10098 5513 -45.41% BenchmarkHash8K 68004 35278 -48.12% benchmark old MB/s new MB/s speedup BenchmarkHash8Bytes 4.66 7.06 1.52x BenchmarkHash1K 101.40 185.72 1.83x BenchmarkHash8K 120.46 232.21 1.93x Change-Id: Ifd55a49a24cb159b3a09a8e928c3f37727aca103 Reviewed-on: https://go-review.googlesource.com/32320Reviewed-by: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Michael Matloob authored
These were accidentally removed by a rollback cl: golang.org/cl/32441 Change-Id: I0cfa8b3397be324dabfb8f33b6548a03c10571eb Reviewed-on: https://go-review.googlesource.com/32334Reviewed-by: Alan Donovan <adonovan@google.com>
-
Michael Matloob authored
This reverts commit b33030a7. Reason for revert: We're going to try to get the code in this change submitted in smaller, more carefully reviewed changes. Change-Id: I4175f4b297f0e69fb78b11f9dc0bd82f27865be7 Reviewed-on: https://go-review.googlesource.com/32441Reviewed-by: Russ Cox <rsc@golang.org>
-
Quentin Renard authored
Fixes #16997 Change-Id: I9ca27d8cff1905584862997d0e8a11ce3c4c21cb Reviewed-on: https://go-review.googlesource.com/30750Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Kevin Burke authored
Also add a link to more information about isolation levels as defined by the SQL standard. Fixes #17682. Change-Id: I94c53b713f4c882af40cf15fe5f1e5dbc53ea741 Reviewed-on: https://go-review.googlesource.com/32418Reviewed-by: Daniel Theophanes <kardianos@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
INADA Naoki authored
Change-Id: If6eb3a7c9ad48a517e584567b1003479c1df6cca Reviewed-on: https://go-review.googlesource.com/32136Reviewed-by: Daniel Theophanes <kardianos@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Jaana Burcu Dogan authored
Fixes #17686. Change-Id: I7d07c367e50b448579f9855bea43df76ddb82bd0 Reviewed-on: https://go-review.googlesource.com/32420Reviewed-by: Rob Pike <r@golang.org>
-
Robert Griesemer authored
Does not handle imports of packages with exported aliases yet. For #17592. Change-Id: Iee63fb9d521014995003a417271fbe0384ae04ef Reviewed-on: https://go-review.googlesource.com/32108Reviewed-by: Alan Donovan <adonovan@google.com>
-
David Crawshaw authored
The map[typeOff]*_type object is created at run time and stored in the moduledata. The moduledata object is marked by the linker as SNOPTRDATA, so the reference is ignored by the GC. Running misc/cgo/testplugin/test.bash with GOGC=1 will eventually collect the typemap and crash. This bug probably comes up in -linkshared binaries in Go 1.7. I don't know why we haven't seen a report about this yet. Fixes #17680 Change-Id: I0e9b5c006010e8edd51d9471651620ba665248d3 Reviewed-on: https://go-review.googlesource.com/32430 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
David Crawshaw authored
Plumb the import path of a plugin package through to the linker, and use it as the prefix on the exported symbol names. Before this we used the basename of the plugin file as the prefix, which could conflict and result in multiple loaded plugins sharing symbols that are distinct. Fixes #17155 Fixes #17579 Change-Id: I7ce966ca82d04e8507c0bcb8ea4ad946809b1ef5 Reviewed-on: https://go-review.googlesource.com/32355Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 30 Oct, 2016 4 commits
-
-
Nigel Tao authored
Previously, we were off by one. Also fix a comment typo. Change-Id: Ib94d23acc56d5fccd44144f71655481f98803ac8 Reviewed-on: https://go-review.googlesource.com/32149Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
This is convenient for direct use of `go tool cgo`. We can also use it from the go tool to reduce the length of the file names that cgo generates. Update #17070. Change-Id: I8466a0a2cc68a732d17d07319e303497715bac8c Reviewed-on: https://go-review.googlesource.com/32354 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Russ Cox authored
Disabled by https://golang.org/cl/53020044 due to false positives. Reenable and model properly. Fixes #17306. Change-Id: I28405ddfcd17f58cf1427c300273212729154359 Reviewed-on: https://go-review.googlesource.com/31589 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
-
Ian Gudger authored
This field is a zero length array and has little use. Since Go 1.5, trailing zero-length arrays take up space. Both syscall.UnixRights() and syscall.ParseSocketControlMessage() depend on being able to do an unsafe cast of socket control message data to Cmsghdr this is only safe if the socket control message data is greater than or equal to the size of Cmsghdr. Since control message data that is equal in size to Cmsghdr without X__cmsg_data is a valid socket control message, we must remove X__cmsg_data or not perform the unsafe cast. Removing X__cmsg_data will prevent Go code that uses X__cmsg_data from compiling, but removing the unsafe cast will cause Go code that uses X__cmsg_data to fail or exhibit undefined behavior at runtime. It was therefore decided that removing X__cmsg_data was the better option. Fixes #17649 Change-Id: I39f323f978eca09d62da5785c5c5c9c7cbdf8c31 Reviewed-on: https://go-review.googlesource.com/32319Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-