1. 28 Apr, 2015 4 commits
    • Russ Cox's avatar
      cmd/internal/gc: emit write barriers at lower level · 0ad4f8b1
      Russ Cox authored
      This is primarily preparation for inlining, not an optimization by itself,
      but it still helps some.
      
      name                                       old                     new          delta
      BenchmarkBinaryTree17              18.2s × (0.99,1.01)     17.9s × (0.99,1.01)  -1.57%
      BenchmarkFannkuch11                4.44s × (1.00,1.00)     4.42s × (1.00,1.00)  -0.40%
      BenchmarkFmtFprintfEmpty           119ns × (0.95,1.02)     118ns × (0.96,1.02)  ~
      BenchmarkFmtFprintfString          501ns × (0.99,1.02)     486ns × (0.99,1.01)  -2.89%
      BenchmarkFmtFprintfInt             474ns × (0.99,1.00)     457ns × (0.99,1.01)  -3.59%
      BenchmarkFmtFprintfIntInt          792ns × (1.00,1.00)     768ns × (1.00,1.01)  -3.03%
      BenchmarkFmtFprintfPrefixedInt     574ns × (1.00,1.01)     584ns × (0.99,1.03)  +1.83%
      BenchmarkFmtFprintfFloat           749ns × (1.00,1.00)     739ns × (0.99,1.00)  -1.34%
      BenchmarkFmtManyArgs              2.94µs × (1.00,1.01)    2.77µs × (1.00,1.00)  -5.76%
      BenchmarkGobDecode                39.5ms × (0.99,1.01)    39.3ms × (0.99,1.01)  ~
      BenchmarkGobEncode                39.4ms × (1.00,1.01)    39.4ms × (0.99,1.00)  ~
      BenchmarkGzip                      658ms × (1.00,1.01)     661ms × (0.99,1.01)  ~
      BenchmarkGunzip                    142ms × (1.00,1.00)     142ms × (1.00,1.00)  +0.22%
      BenchmarkHTTPClientServer          134µs × (0.99,1.01)     133µs × (0.98,1.01)  ~
      BenchmarkJSONEncode               57.1ms × (0.99,1.01)    56.5ms × (0.99,1.01)  ~
      BenchmarkJSONDecode                141ms × (1.00,1.00)     143ms × (1.00,1.00)  +1.09%
      BenchmarkMandelbrot200            6.01ms × (1.00,1.00)    6.01ms × (1.00,1.00)  ~
      BenchmarkGoParse                  10.1ms × (0.91,1.09)     9.6ms × (0.94,1.07)  ~
      BenchmarkRegexpMatchEasy0_32       207ns × (1.00,1.01)     210ns × (1.00,1.00)  +1.45%
      BenchmarkRegexpMatchEasy0_1K       592ns × (0.99,1.00)     596ns × (0.99,1.01)  +0.68%
      BenchmarkRegexpMatchEasy1_32       184ns × (0.99,1.01)     184ns × (0.99,1.01)  ~
      BenchmarkRegexpMatchEasy1_1K      1.01µs × (1.00,1.00)    1.01µs × (0.99,1.01)  ~
      BenchmarkRegexpMatchMedium_32      327ns × (0.99,1.00)     327ns × (1.00,1.01)  ~
      BenchmarkRegexpMatchMedium_1K     92.5µs × (1.00,1.00)    93.0µs × (1.00,1.02)  +0.48%
      BenchmarkRegexpMatchHard_32       4.79µs × (0.95,1.00)    4.76µs × (0.95,1.01)  ~
      BenchmarkRegexpMatchHard_1K        136µs × (1.00,1.00)     136µs × (1.00,1.01)  ~
      BenchmarkRevcomp                   900ms × (0.99,1.01)     892ms × (1.00,1.01)  ~
      BenchmarkTemplate                  170ms × (0.99,1.01)     175ms × (0.99,1.00)  +2.95%
      BenchmarkTimeParse                 645ns × (1.00,1.00)     638ns × (1.00,1.00)  -1.16%
      BenchmarkTimeFormat                740ns × (1.00,1.00)     772ns × (1.00,1.00)  +4.39%
      
      Change-Id: I0be905e32791e0cb70ff01f169c4b309a971d981
      Reviewed-on: https://go-review.googlesource.com/9159Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      0ad4f8b1
    • Josh Bleecher Snyder's avatar
      test: gofmt run.go · 673bd188
      Josh Bleecher Snyder authored
      Clean up after CL 5310.
      
      Change-Id: Ib870e7b9d26eb118eefdaa3e76dcec4a4d459584
      Reviewed-on: https://go-review.googlesource.com/9398Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      673bd188
    • Josh Bleecher Snyder's avatar
      test: set GOMAXPROCS=1 in fixedbugs/issue9110 · 1fb948a0
      Josh Bleecher Snyder authored
      With this fix,
      
      GOMAXPROCS=8 ./all.bash
      
      passes, at least on my machine.
      
      Fixes #10216.
      
      Change-Id: Ib5991950892a1399ec81aced0a52b435e6f83fdf
      Reviewed-on: https://go-review.googlesource.com/9392Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      1fb948a0
    • Mikio Hara's avatar
      net: don't miss testing server teardowns when test fails early · 9bef5cfb
      Mikio Hara authored
      Change-Id: I9fa678e43b4ae3970323cac474b5f86d4d933997
      Reviewed-on: https://go-review.googlesource.com/9382Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      9bef5cfb
  2. 27 Apr, 2015 24 commits
  3. 26 Apr, 2015 11 commits
    • Adam Langley's avatar
      crypto/tls: call GetCertificate if Certificates is empty. · cba882ea
      Adam Langley authored
      This change causes the GetCertificate callback to be called if
      Certificates is empty. Previously this configuration would result in an
      error.
      
      This allows people to have servers that depend entirely on dynamic
      certificate selection, even when the client doesn't send SNI.
      
      Fixes #9208.
      
      Change-Id: I2f5a5551215958b88b154c64a114590300dfc461
      Reviewed-on: https://go-review.googlesource.com/8792Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Adam Langley <agl@golang.org>
      cba882ea
    • Jonathan Rudenberg's avatar
      crypto/tls: add OCSP response to ConnectionState · ac2bf8ad
      Jonathan Rudenberg authored
      The OCSP response is currently only exposed via a method on Conn,
      which makes it inaccessible when using wrappers like net/http. The
      ConnectionState structure is typically available even when using
      wrappers and contains many of the other handshake details, so this
      change exposes the stapled OCSP response in that structure.
      
      Change-Id: If8dab49292566912c615d816321b4353e711f71f
      Reviewed-on: https://go-review.googlesource.com/9361Reviewed-by: 's avatarAdam Langley <agl@golang.org>
      Run-TryBot: Adam Langley <agl@golang.org>
      ac2bf8ad
    • David Leon Gil's avatar
      crypto/elliptic: don't unmarshal points that are off the curve · d86b8d34
      David Leon Gil authored
      At present, Unmarshal does not check that the point it unmarshals
      is actually *on* the curve. (It may be on the curve's twist.)
      
      This can, as Daniel Bernstein has pointed out at great length,
      lead to quite devastating attacks. And 3 out of the 4 curves
      supported by crypto/elliptic have twists with cofactor != 1;
      P-224, in particular, has a sufficiently large cofactor that it
      is likely that conventional dlog attacks might be useful.
      
      This closes #2445, filed by Watson Ladd.
      
      To explain why this was (partially) rejected before being accepted:
      
      In the general case, for curves with cofactor != 1, verifying subgroup
      membership is required. (This is expensive and hard-to-implement.)
      But, as recent discussion during the CFRG standardization process
      has brought out, small-subgroup attacks are much less damaging than
      a twist attack.
      
      Change-Id: I284042eb9954ff9b7cde80b8b693b1d468c7e1e8
      Reviewed-on: https://go-review.googlesource.com/2421Reviewed-by: 's avatarAdam Langley <agl@golang.org>
      d86b8d34
    • Paul van Brouwershaven's avatar
      crypto/x509: CertificateRequest signature verification · 54bb4b9f
      Paul van Brouwershaven authored
      This implements a method for x509.CertificateRequest to prevent
      certain attacks and to allow a CA/RA to properly check the validity
      of the binding between an end entity and a key pair, to prove that
      it has possession of (i.e., is able to use) the private key
      corresponding to the public key for which a certificate is requested.
      
      RFC 2986 section 3 states:
      
      "A certification authority fulfills the request by authenticating the
      requesting entity and verifying the entity's signature, and, if the
      request is valid, constructing an X.509 certificate from the
      distinguished name and public key, the issuer name, and the
      certification authority's choice of serial number, validity period,
      and signature algorithm."
      
      Change-Id: I37795c3b1dfdfdd455d870e499b63885eb9bda4f
      Reviewed-on: https://go-review.googlesource.com/7371Reviewed-by: 's avatarAdam Langley <agl@golang.org>
      54bb4b9f
    • Jonathan Rudenberg's avatar
      crypto/tls: add support for session ticket key rotation · bff14175
      Jonathan Rudenberg authored
      This change adds a new method to tls.Config, SetSessionTicketKeys, that
      changes the key used to encrypt session tickets while the server is
      running. Additional keys may be provided that will be used to maintain
      continuity while rotating keys. If a ticket encrypted with an old key is
      provided by the client, the server will resume the session and provide
      the client with a ticket encrypted using the new key.
      
      Fixes #9994
      
      Change-Id: Idbc16b10ff39616109a51ed39a6fa208faad5b4e
      Reviewed-on: https://go-review.googlesource.com/9072Reviewed-by: 's avatarJonathan Rudenberg <jonathan@titanous.com>
      Reviewed-by: 's avatarAdam Langley <agl@golang.org>
      bff14175
    • Håvard Haugen's avatar
      cmd/pprof: handle empty profile gracefully · 14a4649f
      Håvard Haugen authored
      The command "go tool pprof -top $GOROOT/bin/go /dev/null" now logs that
      profile is empty instead of panicking.
      
      Fixes #9207
      
      Change-Id: I3d55c179277cb19ad52c8f24f1aca85db53ee08d
      Reviewed-on: https://go-review.googlesource.com/2571
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      14a4649f
    • Jonathan Rudenberg's avatar
      crypto/tls: add support for Certificate Transparency · 02e69c4b
      Jonathan Rudenberg authored
      This change adds support for serving and receiving Signed Certificate
      Timestamps as described in RFC 6962.
      
      The server is now capable of serving SCTs listed in the Certificate
      structure. The client now asks for SCTs and, if any are received,
      they are exposed in the ConnectionState structure.
      
      Fixes #10201
      
      Change-Id: Ib3adae98cb4f173bc85cec04d2bdd3aa0fec70bb
      Reviewed-on: https://go-review.googlesource.com/8988Reviewed-by: 's avatarAdam Langley <agl@golang.org>
      Run-TryBot: Adam Langley <agl@golang.org>
      Reviewed-by: 's avatarJonathan Rudenberg <jonathan@titanous.com>
      02e69c4b
    • Justin Nuß's avatar
      encoding/csv: Preallocate records slice · 2db58f8f
      Justin Nuß authored
      Currently parseRecord will always start with a nil
      slice and then resize the slice on append. For input
      with a fixed number of fields per record we can preallocate
      the slice to avoid having to resize the slice.
      
      This change implements this optimization by using
      FieldsPerRecord as capacity if it's > 0 and also adds a
      benchmark to better show the differences.
      
      benchmark         old ns/op     new ns/op     delta
      BenchmarkRead     19741         17909         -9.28%
      
      benchmark         old allocs     new allocs     delta
      BenchmarkRead     59             41             -30.51%
      
      benchmark         old bytes     new bytes     delta
      BenchmarkRead     6276          5844          -6.88%
      
      Change-Id: I7c2abc9c80a23571369bcfcc99a8ffc474eae7ab
      Reviewed-on: https://go-review.googlesource.com/8880Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2db58f8f
    • David Crawshaw's avatar
      runtime: signal forwarding for darwin/amd64 · a5b693b4
      David Crawshaw authored
      Follows the linux signal forwarding semantics from
      http://golang.org/cl/8712, sharing the implementation of sigfwdgo.
      Forwarding for 386, arm, and arm64 will follow.
      
      Change-Id: I6bf30d563d19da39b6aec6900c7fe12d82ed4f62
      Reviewed-on: https://go-review.googlesource.com/9302Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      a5b693b4
    • Michael Hudson-Doyle's avatar
      cmd/internal/ld: R_TLS_LE is fine on Darwin too · c20ff36f
      Michael Hudson-Doyle authored
      Sorry about this.
      
      Fixes #10575
      
      Change-Id: I2de23be68e7d822d182e5a0d6a00c607448d861e
      Reviewed-on: https://go-review.googlesource.com/9341Reviewed-by: 's avatarMinux Ma <minux@golang.org>
      c20ff36f
    • Matt T. Proud's avatar
      testing/quick: align tests with reflect.Kind. · b6a0450b
      Matt T. Proud authored
      This commit is largely cosmetic in the sense that it is the remnants
      of a change proposal I had prepared for testing/quick, until I
      discovered that 3e9ed273 already implemented the feature I was looking
      for: quick.Value() for reflect.Kind Array.  What you see is a merger
      and manual cleanup; the cosmetic cleanups are as follows:
      
      (1.) Keeping the TestCheckEqual and its associated input functions
      in the same order as type kinds defined in reflect.Kind.  Since
      3e9ed273 was committed, the test case began to diverge from the
      constant's ordering.
      
      (2.) The `Intptr` derivatives existed to exercise quick.Value with
      reflect.Kind's `Ptr` constant.  All `Intptr` (unrelated to `uintptr`)
      in the test have been migrated to ensure the parallelism of the
      listings and to convey that `Intptr` is not special.
      
      (3.) Correct a misspelling (transposition) of "alias", whereby it is
      named as "Alais".
      
      Change-Id: I441450db16b8bb1272c52b0abcda3794dcd0599d
      Reviewed-on: https://go-review.googlesource.com/8804Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      b6a0450b
  4. 25 Apr, 2015 1 commit
    • Michael Hudson-Doyle's avatar
      cmd/8l, cmd/internal/ld, cmd/internal/obj/x86: stop incorrectly using the term "inital exec" · 264858c4
      Michael Hudson-Doyle authored
      The long comment block in obj6.go:progedit talked about the two code sequences
      for accessing g as "local exec" and "initial exec", but really they are both forms
      of local exec. This stuff is confusing enough without using the wrong words for
      things, so rewrite it to talk about 2-instruction and 1-instruction sequences.
      Unfortunately the confusion has made it into code, with the R_TLS_IE relocation
      now doing double duty as meaning actual initial exec when externally linking and
      boring old local exec when linking internally (half of this is my fault). So this
      stops using R_TLS_IE in the local exec case. There is a chance this might break
      plan9 or windows, but I don't think so. Next step is working out what the heck is
      going on on ARM...
      
      Change-Id: I09da4388210cf49dbc99fd25f5172bbe517cee57
      Reviewed-on: https://go-review.googlesource.com/9273Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      264858c4