- 12 Sep, 2013 18 commits
-
-
Russ Cox authored
Bug #1: Issue 5406 identified an interesting case: defer iface.M() may end up calling a wrapper that copies an indirect receiver from the iface value and then calls the real M method. That's two calls down, not just one, and so recover() == nil always in the real M method, even during a panic. [For the purposes of this entire discussion, a wrapper's implementation is a function containing an ordinary call, not the optimized tail call form that is somtimes possible. The tail call does not create a second frame, so it is already handled correctly.] Fix this bug by introducing g->panicwrap, which counts the number of bytes on current stack segment that are due to wrapper calls that should not count against the recover check. All wrapper functions must now adjust g->panicwrap up on entry and back down on exit. This adds slightly to their expense; on the x86 it is a single instruction at entry and exit; on the ARM it is three. However, the alternative is to make a call to recover depend on being able to walk the stack, which I very much want to avoid. We have enough problems walking the stack for garbage collection and profiling. Also, if performance is critical in a specific case, it is already faster to use a pointer receiver and avoid this kind of wrapper entirely. Bug #2: The old code, which did not consider the possibility of two calls, already contained a check to see if the call had split its stack and so the panic-created segment was one behind the current segment. In the wrapper case, both of the two calls might split their stacks, so the panic-created segment can be two behind the current segment. Fix this by propagating the Stktop.panic flag forward during stack splits instead of looking backward during recover. Fixes #5406. R=golang-dev, iant CC=golang-dev https://golang.org/cl/13367052
-
Josh Bleecher Snyder authored
This is a follow-up to feedback from gri in https://golang.org/cl/12837044/. Most of the wording and naming improvements are lifted shamelessly from him. R=gri CC=golang-dev https://golang.org/cl/13670043
-
Nicholas Sullivan authored
The public key serialization from CreateCertificate is factored out to be used in MarshalPKIXPublicKey. Testcode with one P224 ECDSA keypair has been added. R=golang-dev, agl CC=agl, golang-dev https://golang.org/cl/13427044
-
Adam Langley authored
Generated by addca. R=golang-dev CC=golang-dev https://golang.org/cl/13678043
-
Han-Wen Nienhuys authored
Fixes #6306. R=golang-dev, bradfitz, r CC=golang-dev https://golang.org/cl/13474043
-
Brad Fitzpatrick authored
Fixes #4799 R=golang-dev, dave, rsc CC=golang-dev https://golang.org/cl/13457047
-
Rob Pike authored
R=golang-dev, adg CC=golang-dev https://golang.org/cl/13373053
-
Mikio Hara authored
Also fix trivial nits. R=golang-dev, r CC=golang-dev https://golang.org/cl/13532046
-
Rob Pike authored
It was simply a missing error case: when scanning plain text outside of an action, a right delimiter should be an error. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/13468045
-
Mikio Hara authored
This is in prepartion for fixing issue 6320. R=golang-dev, dave CC=golang-dev https://golang.org/cl/13611043
-
Mikio Hara authored
Reduces a number of trials but it still can detect memory leak when we make blunders in runtime-integarted network poller work, like just forgetting to call runtime_pollClose in code paths. Also disables the test on windows/386. R=alex.brainman, r CC=golang-dev https://golang.org/cl/13022046
-
Dave Cheney authored
Remove set but unused variable. R=rsc CC=golang-dev https://golang.org/cl/13490047
-
Russ Cox authored
Pull the stack split generation into its own function. This will make an upcoming change to fix recover easier to digest. R=ken2 CC=golang-dev https://golang.org/cl/13611044
-
Russ Cox authored
There is no reason to do this, and it's more work. ««« original CL description net: make channel-based semaphore depend on receive, not send R=r, dvyukov CC=golang-dev https://golang.org/cl/13348045 »»» R=golang-dev, r CC=golang-dev https://golang.org/cl/13632047
-
Russ Cox authored
R=golang-dev, adg CC=golang-dev https://golang.org/cl/13263052
-
Robert Griesemer authored
R=rsc, r, iant, ken CC=golang-dev https://golang.org/cl/10243046
-
Rob Pike authored
R=iant, minux.ma CC=golang-dev https://golang.org/cl/13669043
-
Andrew Gerrand authored
Generated by addca. R=gobot CC=golang-dev https://golang.org/cl/13261053
-
- 11 Sep, 2013 21 commits
-
-
Rob Pike authored
Also link it to the landing page for docs. R=golang-dev, adg CC=golang-dev https://golang.org/cl/13652045
-
Rémy Oudompheng authored
A new node type OSPTR is added to refer to the data pointer of strings and slices in a simple way during walk(). It will be useful for future work on simplification of slice arithmetic. benchmark old ns/op new ns/op delta BenchmarkCopy1Byte 9 8 -13.98% BenchmarkCopy2Byte 14 8 -40.49% BenchmarkCopy4Byte 13 8 -35.04% BenchmarkCopy8Byte 13 8 -37.10% BenchmarkCopy12Byte 14 12 -15.38% BenchmarkCopy16Byte 14 12 -17.24% BenchmarkCopy32Byte 19 14 -27.32% BenchmarkCopy128Byte 31 26 -15.29% BenchmarkCopy1024Byte 100 92 -7.50% BenchmarkCopy1String 10 7 -28.99% BenchmarkCopy2String 10 7 -28.06% BenchmarkCopy4String 10 8 -22.69% BenchmarkCopy8String 10 8 -23.30% BenchmarkCopy12String 11 11 -5.88% BenchmarkCopy16String 11 11 -5.08% BenchmarkCopy32String 15 14 -6.58% BenchmarkCopy128String 28 25 -10.60% BenchmarkCopy1024String 95 95 +0.53% R=golang-dev, bradfitz, cshapiro, dave, daniel.morsing, rsc, khr, khr CC=golang-dev https://golang.org/cl/9101048
-
Russ Cox authored
Simpler version of CL 13084043. R=ken2 CC=golang-dev https://golang.org/cl/13602045
-
Russ Cox authored
There is a cleaner, simpler way. ««« original CL description cmd/5g, cmd/6g, cmd/8g: faster compilation Replace linked list walk with memset. This reduces CPU time taken by 'go install -a std' by ~10%. Before: real user sys 0m23.561s 0m16.625s 0m5.848s 0m23.766s 0m16.624s 0m5.846s 0m23.742s 0m16.621s 0m5.868s after: 0m22.714s 0m14.858s 0m6.138s 0m22.644s 0m14.875s 0m6.120s 0m22.604s 0m14.854s 0m6.081s R=golang-dev, r CC=golang-dev https://golang.org/cl/13084043 »»» TBR=dvyukov CC=golang-dev https://golang.org/cl/13352049
-
Russ Cox authored
R=ken2 CC=golang-dev https://golang.org/cl/13512053
-
Russ Cox authored
Asking about runtime/cgo when CgoEnabled=false now correctly returns an error from build.Import (specifically, NoGoError), because there are no buildable Go files in that directory. The API tool was depending on it returning a package with no Go files instead. Correct that assumption. Fixes all.bash on local machines. (Dashboard appears not to be running the api tool at all.) Update #6124 TBR=golang-dev CC=golang-dev https://golang.org/cl/13385046
-
Russ Cox authored
It was never going to last. ««« original CL description cmd/api: break the builds There is some question about whether the api tool is running on Windows (see issue 6124), and now I'm starting to question whether it runs on any of the builders, since both darwin/amd64 and linux/amd64 are crashing for me in the api tool due to a recent cgo-related change, and yet the dashboard is happy. If the dashboard is still happy after this CL, we have a problem. Update #6124 TBR=golang-dev CC=golang-dev https://golang.org/cl/13632053 »»» TBR=golang-dev CC=golang-dev https://golang.org/cl/13474045
-
Russ Cox authored
There is some question about whether the api tool is running on Windows (see issue 6124), and now I'm starting to question whether it runs on any of the builders, since both darwin/amd64 and linux/amd64 are crashing for me in the api tool due to a recent cgo-related change, and yet the dashboard is happy. If the dashboard is still happy after this CL, we have a problem. Update #6124 TBR=golang-dev CC=golang-dev https://golang.org/cl/13632053
-
Russ Cox authored
args is useful for printing tracebacks. frame is not necessary anymore, but we might some day get back to functions where the frame size does not vary by program counter, and if so we'll need it. Avoid needing to introduce a new struct format later by keeping it now. Fixes #5907. R=golang-dev, iant CC=golang-dev https://golang.org/cl/13632051
-
Russ Cox authored
The old test for "no Go files" was p.Name == "", meaning we never saw a Go package statement. That test fails if there are cgo files that we parsed (and recorded the package name) but then chose not to use (because cgo is not available). Test the actual file lists instead. Fixes #6078. R=golang-dev, iant CC=golang-dev https://golang.org/cl/13661043
-
Ian Lance Taylor authored
The units example is nice but is covered by the Lucent license, which may be a concern for some people making a commercial source code distribution of Go. R=golang-dev, r CC=golang-dev https://golang.org/cl/13283045
-
Russ Cox authored
The various throwing > 0 finish a change started in a previous CL, which sets throwing = -1 to mean "don't show the internals". That gets set during the "all goroutines are asleep - deadlock!" crash, and it should also be set during any other expected crash that does not indicate a problem within the runtime. Most runtime.throw do indicate a problem within the runtime, however, so we should be able to enumerate the ones that should be silent. The goroutine sleeping deadlock is the only one I can think of. Update #5139 R=golang-dev, iant CC=golang-dev https://golang.org/cl/13662043
-
Russ Cox authored
Otherwise, if panic starts running deferred functions, the code that panicked appears to be calling those functions directly, which is not the case and can be confusing. For example: main.Two() /Users/rsc/x.go:12 +0x2a runtime.panic(0x20dc0, 0x2100cc010) /Users/rsc/g/go/src/pkg/runtime/panic.c:248 +0x106 main.One() /Users/rsc/x.go:8 +0x55 This makes clear(er) that main.Two is being called during a panic, not as a direct call from main.One. Fixes #5832. R=golang-dev, iant CC=golang-dev https://golang.org/cl/13302051
-
Russ Cox authored
getaddrinfo is supposed to set errno when it returns EAI_SYSTEM, but sometimes it does not. Fixes #6232. R=golang-dev, iant CC=golang-dev https://golang.org/cl/13532045
-
Russ Cox authored
This allows us to make two changes: 1. Force the argument type to be size_t, even on broken systems that declare malloc to take a ulong. 2. Call runtime.throw if malloc fails. (That is, the program crashes; it does not panic.) Fixes #3403. Fixes #5926. R=golang-dev, iant CC=golang-dev https://golang.org/cl/13413047
-
Mikio Hara authored
This CL adds minimal support of Happy Eyeballs-like TCP connection setup to Dialer API. Happy Eyeballs and derivation techniques are described in the following: - Happy Eyeballs: Success with Dual-Stack Hosts http://tools.ietf.org/html/rfc6555 - Analysing Dual Stack Behaviour and IPv6 Quality http://www.potaroo.net/presentations/2012-04-17-dual-stack-quality.pdf Usually, the techniques consist of three components below. - DNS query racers, that run A and AAAA queries in parallel or series - A short list of destination addresses - TCP SYN racers, that run IPv4 and IPv6 transport in parallel or series This CL implements only the latter two. The existing DNS query component gathers together A and AAAA records in series, so we don't touch it here. This CL just uses extended resolveInternetAddr and makes it possible to run multiple Dial racers in parallel. For example, when the given destination is a DNS name and the name has multiple address family A and AAAA records, and it happens on the TCP wildcard network "tcp" with DualStack=true like the following: (&net.Dialer{DualStack: true}).Dial("tcp", "www.example.com:80") The function will return a first established connection either TCP over IPv4 or TCP over IPv6, and close the other connection internally. Fixes #3610. Fixes #5267. Benchmark results on freebsd/amd64 virtual machine, tip vs. tip+12416043: benchmark old ns/op new ns/op delta BenchmarkTCP4OneShot 50696 52141 +2.85% BenchmarkTCP4OneShotTimeout 65775 66426 +0.99% BenchmarkTCP4Persistent 10986 10457 -4.82% BenchmarkTCP4PersistentTimeout 11207 10445 -6.80% BenchmarkTCP6OneShot 62009 63718 +2.76% BenchmarkTCP6OneShotTimeout 78351 79138 +1.00% BenchmarkTCP6Persistent 14695 14659 -0.24% BenchmarkTCP6PersistentTimeout 15032 14646 -2.57% BenchmarkTCP4ConcurrentReadWrite 7215 6217 -13.83% BenchmarkTCP6ConcurrentReadWrite 7528 7493 -0.46% benchmark old allocs new allocs delta BenchmarkTCP4OneShot 36 36 0.00% BenchmarkTCP4OneShotTimeout 36 36 0.00% BenchmarkTCP4Persistent 0 0 n/a% BenchmarkTCP4PersistentTimeout 0 0 n/a% BenchmarkTCP6OneShot 37 37 0.00% BenchmarkTCP6OneShotTimeout 37 37 0.00% BenchmarkTCP6Persistent 0 0 n/a% BenchmarkTCP6PersistentTimeout 0 0 n/a% BenchmarkTCP4ConcurrentReadWrite 0 0 n/a% BenchmarkTCP6ConcurrentReadWrite 0 0 n/a% benchmark old bytes new bytes delta BenchmarkTCP4OneShot 2500 2503 0.12% BenchmarkTCP4OneShotTimeout 2508 2505 -0.12% BenchmarkTCP4Persistent 0 0 n/a% BenchmarkTCP4PersistentTimeout 0 0 n/a% BenchmarkTCP6OneShot 2713 2707 -0.22% BenchmarkTCP6OneShotTimeout 2722 2720 -0.07% BenchmarkTCP6Persistent 0 0 n/a% BenchmarkTCP6PersistentTimeout 0 0 n/a% BenchmarkTCP4ConcurrentReadWrite 0 0 n/a% BenchmarkTCP6ConcurrentReadWrite 0 0 n/a% R=golang-dev, bradfitz, nightlyone, rsc CC=golang-dev https://golang.org/cl/12416043
-
Russ Cox authored
For example, if the pattern is m... there is no need to look in directories not beginning with m. Fixes #5214. R=golang-dev, adg CC=golang-dev https://golang.org/cl/13253049
-
Russ Cox authored
R=golang-dev, iant CC=golang-dev https://golang.org/cl/13420048
-
Russ Cox authored
This is not quite what that issue reports, because this does not involve a DLL. But I wanted to make sure this much was working. Update #4339 R=golang-dev, minux.ma CC=golang-dev https://golang.org/cl/13653043
-
Dave Cheney authored
Add coverage for some uncovered bytes methods. The increase in actual coverage is disapointing small. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/13651044
-
Robert Daniel Kortschak authored
Fixes #6353. R=golang-dev, bradfitz, alex.brainman CC=golang-dev https://golang.org/cl/13652043
-
- 10 Sep, 2013 1 commit
-
-
Russ Cox authored
The scan starts at the directory we care about and works backward to the GOPATH root. The error should say the original directory name, not the name of the GOPATH root. Fixes #6175. R=golang-dev, minux.ma CC=golang-dev https://golang.org/cl/13366050
-