1. 11 Sep, 2013 10 commits
    • Russ Cox's avatar
      runtime: show m stack during crash on m stack · ab38e2a4
      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
      ab38e2a4
    • Russ Cox's avatar
      runtime: show runtime.panic frame in traceback · fa4984d5
      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
      fa4984d5
    • Russ Cox's avatar
      net: defend against broken getaddrinfo on Linux · 382738af
      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
      382738af
    • Russ Cox's avatar
      cmd/cgo: replace C.malloc with our own wrapper · 397ba2cb
      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
      397ba2cb
    • Mikio Hara's avatar
      net: implement TCP connection setup with fast failover · 89b26760
      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
      89b26760
    • Russ Cox's avatar
      cmd/go: use pattern to prune file tree walk · e6a49555
      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
      e6a49555
    • Russ Cox's avatar
      cmd/cgo: don't say "gcc produced no output" if we ran clang · 08b26e41
      Russ Cox authored
      R=golang-dev, iant
      CC=golang-dev
      https://golang.org/cl/13420048
      08b26e41
    • Russ Cox's avatar
      misc/cgo/test: test of issue 4339 · 71ed6eb2
      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
      71ed6eb2
    • Dave Cheney's avatar
      bytes: additional test coverage · 3ee0744c
      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
      3ee0744c
    • Robert Daniel Kortschak's avatar
      cmd/api: make api check directory per-user · b34ec90e
      Robert Daniel Kortschak authored
      Fixes #6353.
      
      R=golang-dev, bradfitz, alex.brainman
      CC=golang-dev
      https://golang.org/cl/13652043
      b34ec90e
  2. 10 Sep, 2013 23 commits
  3. 09 Sep, 2013 7 commits