1. 07 Dec, 2017 13 commits
  2. 06 Dec, 2017 20 commits
  3. 05 Dec, 2017 7 commits
    • Joe Tsai's avatar
      encoding/csv: truncate carriage returns at EOF · 0b3b5113
      Joe Tsai authored
      This fixes a regression where only CRLF was folded into LF at EOF.
      Now, we also truncate trailing CR at EOF to preserve the old behavior.
      
      Every one of the test cases added exactly matches the behavior
      of Go1.9, even if the results are somewhat unexpected.
      
      Fixes #22937
      
      Change-Id: I1bc6550533163ae489ea77ec1e598163267b7eec
      Reviewed-on: https://go-review.googlesource.com/81577
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      0b3b5113
    • Joe Tsai's avatar
      net: return io.ErrClosedPipe when possible from net.Pipe · 8f2a9267
      Joe Tsai authored
      The previous implementation of net.Pipe was just a thin wrapper around
      io.Pipe and did not wrap any of the io.Pipe errors as net.Errors.
      As a result of Hyrum's law, users have come to depend on the fact that
      net.Pipe returns io.ErrClosedPipe when the pipe is closed.
      Thus, we preserve this behavior to avoid regressing such use cases.
      
      Change-Id: I06b387877b944c1c08527601f58983872b7557b4
      Reviewed-on: https://go-review.googlesource.com/81777
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      8f2a9267
    • Russ Cox's avatar
      cmd/dist: disable test caching during run.bash · 49fec9b4
      Russ Cox authored
      Sometimes people use run.bash repeatedly
      or run go tool dist test by hand for cgo tests.
      Avoid test caching in that case, by request.
      
      Refactor code so that all go test commands
      share a common prefix.
      
      If not caching is problematic it will be a one-line
      change to turn caching back on.
      
      Fixes #22758.
      
      Change-Id: I17d721b832d97bffe26629d21f85b05dbbf2b3ec
      Reviewed-on: https://go-review.googlesource.com/80735
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      49fec9b4
    • Tim Heckman's avatar
      net/http: fix unclosed Listener leak in ListenAndServeTLS · a3c1a867
      Tim Heckman authored
      Fixes #23002
      
      Change-Id: I87e72833757497aff49117dd40629cb7ec49e6e7
      Reviewed-on: https://go-review.googlesource.com/81955Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      a3c1a867
    • christopher-henderson's avatar
      encoding/asn1: allow '&' in PrintableString fields · eb441e6d
      christopher-henderson authored
      There are, unfortunately, intermediate CA ceritificates in circulation
      that contain the invalid character '&' in some PrintableString fields,
      notably Organization Name. This patch allows for ampersand
      to be parsed as though it is valid in an ASN.1 PrintableString.
      
      Fixes #22970
      
      Change-Id: Ifab1a10bbff1cdac68e843c6b857ff1a031051aa
      Reviewed-on: https://go-review.googlesource.com/81635Reviewed-by: default avatarAdam Langley <agl@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Adam Langley <agl@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      eb441e6d
    • kirk's avatar
      database/sql: fix transaction leak · bcf964de
      kirk authored
      When the user context which passed in (*DB)BeginTx is canceled or
      timeout, the current implementation could cause db transaction leak
      in some extreme scenario.
      
      Goroutine 1:
              Call (*DB) BeginTx begins a transaction with a userContext.
              In (*DB)BeginTx, a new goroutine (*Tx)awaitDone
              which monitor context and rollback tx if needed will be created
      
      Goroutine 2(awaitDone):
              block on tx.ctx.Done()
      
      Goroutine 1:
              Execute some insert or update sqls on the database
      
      Goroutine 1:
              Commit the transaction, (*Tx)Commit set
              the atomic variable tx.done to 1
      
      Goroutine 3(maybe global timer):
              Cancel userContext which be passed in Tx
      
      Goroutine 1:
              (*Tx)Commit checks tx.ctx.Done().
              Due to the context has been canceled, it will return
              context.Canceled or context.DeadlineExceeded error immediately
              and abort the real COMMIT operation of transaction
      
      Goroutine 2:
              Release with tx.ctx.Done() signal, execute (*Tx)rollback.
              However the atomic variable tx.done is 1 currently,
              it will return ErrTxDone error immediately and
              abort the real ROLLBACK operation of transaction
      
      Fixes #22976
      
      Change-Id: I3bc23adf25db823861d91e33d3cca6189fb1171d
      Reviewed-on: https://go-review.googlesource.com/81736
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarDaniel Theophanes <kardianos@gmail.com>
      bcf964de
    • Keith Randall's avatar
      cmd/compile: fix map assignment with panicking right-hand side · dd7cbf3a
      Keith Randall authored
      Make sure that when we're assigning to a map, we evaluate the
      right-hand side before we attempt to insert into the map.
      
      We used to evaluate the left-hand side to a pointer-to-slot-in-bucket
      (which as a side effect does len(m)++), then evaluate the right-hand side,
      then do the assignment. That clearly isn't correct when the right-hand side
      might panic.
      
      Fixes #22881
      
      Change-Id: I42a62870ff4bf480568c9bdbf0bb18958962bdf0
      Reviewed-on: https://go-review.googlesource.com/81817Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      dd7cbf3a