profile
viewpoint
Daniel Morsing DanielMorsing London

DanielMorsing/suss 38

A property-based testing library

DanielMorsing/go 25

My sandbox for go experiments

DanielMorsing/rocksdb 19

levigo is a Go wrapper for LevelDB

DanielMorsing/gonzbee 16

Nzb downloader written in go

DanielMorsing/spdy 15

A simple spdy server I wrote.

DanielMorsing/stackcheck 10

A callgraph path checker.

DanielMorsing/ao 5

An acme tool for using the go oracle.

DanielMorsing/Brain 4

Arduino library for reading Neurosky EEG brainwave data. (Tested with the MindFlex and Force Trainer toys.)

DanielMorsing/reckt 3

checks for panics that you don't recover from

push eventgolang/go

Matthew Dempsky

commit sha 84cb51d7d7a936d56d6287ca075dd578097499a9

[dev.regabi] cmd/compile: eliminate more SetOrig This CL consolidates and cleans up fmt.go's logic for skipping past Nodes introduced during typechecking. This allows eliminating SetOrig on ConvExpr and Name. Also changes ConstExpr.SetOrig to a panic for good measure. The only remaining SetOrig uses now are for rewriting multi-value "f(g())" calls and "return g()" statements, and type-checking composite literals. It should be possible to eliminate both of those as well. Passes buildall w/ toolstash -cmp. Change-Id: I478aea1a17dfb7a784293b930bf9081637eb2d7a Reviewed-on: https://go-review.googlesource.com/c/go/+/275179 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>

view details

push time in 11 minutes

issue openedgolang/go

cmd/compile/internal/types2: valid shifts are not accepted

For the code

package p
func _(s uint) {
	var m map[int]string
	delete(m, 1<<s)
	delete(m, 1.<<s)
}

the type checker reports

x.go:4:12: invalid argument: 1 << s (untyped int value) is not assignable to int
x.go:5:12: invalid argument: 1. << s (untyped float value) is not assignable to int

go/types and the compiler accept this.

created time in 16 minutes

issue openedgolang/go

cmd/compile/internal/types2: bad error messages for bad import

package p
import 'a'

produces

x.go:2:8: could not import a (can't find import: "a")
x.go:2:8: "a" imported but not used

It should complain about a not being a string.

created time in 27 minutes

issue commentgolang/go

cmd/compile/internal/types2: superfluous error message for [...]byte("foo")

Correction: go/types seems to be doing it right.

x.go:2:10: expected array length, found '...'
griesemer

comment created time in 29 minutes

issue commentgolang/go

doc/go1.16: document crypto/x509 changes for Go 1.16

Change https://golang.org/cl/275313 mentions this issue: doc/go1.16: cleanup crypto release notes

dmitshur

comment created time in 33 minutes

issue commentgolang/go

doc: write Go 1.16 release notes

Change https://golang.org/cl/275313 mentions this issue: doc/go1.16: cleanup crypto release notes

dmitshur

comment created time in 33 minutes

push eventgolang/go

Filippo Valsorda

commit sha 2c2980aa0cde1a44789103981774e34a4c8a0f2d

doc/go1.16: pre-announce GODEBUG=x509ignoreCN=0 removal in Go 1.17 For #40700 Updates #24151 Change-Id: Id63dcaad238f7534bfce8902b8cb3efd8db5942d Reviewed-on: https://go-review.googlesource.com/c/go/+/266539 Trust: Filippo Valsorda <filippo@golang.org> Trust: Katie Hockman <katie@golang.org> Reviewed-by: Katie Hockman <katie@golang.org>

view details

push time in 36 minutes

issue commentgolang/go

doc: write Go 1.16 release notes

Change https://golang.org/cl/275312 mentions this issue: doc/go1.16: fix broken <code> tag

dmitshur

comment created time in 37 minutes

issue commentgolang/go

doc: write Go 1.16 release notes

Change https://golang.org/cl/266539 mentions this issue: doc/go1.16: pre-announce GODEBUG=x509ignoreCN=0 removal in Go 1.17

dmitshur

comment created time in 37 minutes

issue commentgolang/go

bytes: clarify semantics regarding Buffer.Bytes and Buffer.Write

Is this necessary? If the input slice aliases the next buffer segment, the current code should already do that, as self-copy should return immediately.

Great, I wasn't aware that copy had this optimization already.

dsnet

comment created time in 44 minutes

issue commentgolang/go

net/http: race in http2Transport

#42498 has been resolved (I believe), and should no longer block doing the bundle update.

vadmeste

comment created time in 44 minutes

issue openedgolang/go

cmd/compile/internal/types2, go/types: superfluous error message for [...]byte("foo")

package p
var _ = [...]byte("foo")

produces the type checker errors:

x.go:2:9: invalid use of [...] array (outside a composite literal)
x.go:2:19: cannot convert "foo" (untyped string constant) to [-1]byte

The 2nd error is not needed and also misleading.

cc: @findleyr

created time in 44 minutes

issue closedgolang/go

net/http, x/net/http2: net/http's TestNoSniffExpectRequestBody_h2 stops passing after x/net/http2 change in CL 253259

<pre> $ go version go version devel +8f2db14cd3 Tue Nov 10 18:42:47 2020 +0000 darwin/amd64 </pre>

With the following diff applied:

<details><summary>diff</summary>

diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
index 5b92eb234b..8157806bcb 100644
--- a/src/net/http/h2_bundle.go
+++ b/src/net/http/h2_bundle.go
@@ -7632,6 +7632,9 @@ func (cc *http2ClientConn) roundTrip(req *Request) (res *Response, gotErrAfterRe
 			// we can keep it.
 			bodyWriter.cancel()
 			cs.abortRequestBodyWrite(http2errStopReqBodyWrite)
+			if hasBody && !bodyWritten {
+				<-bodyWriter.resc
+			}
 		}
 		if re.err != nil {
 			cc.forgetStreamID(cs.ID)
@@ -7652,6 +7655,7 @@ func (cc *http2ClientConn) roundTrip(req *Request) (res *Response, gotErrAfterRe
 			} else {
 				bodyWriter.cancel()
 				cs.abortRequestBodyWrite(http2errStopReqBodyWriteAndCancel)
+				<-bodyWriter.resc
 			}
 			cc.forgetStreamID(cs.ID)
 			return nil, cs.getStartedWrite(), http2errTimeout
@@ -7661,6 +7665,7 @@ func (cc *http2ClientConn) roundTrip(req *Request) (res *Response, gotErrAfterRe
 			} else {
 				bodyWriter.cancel()
 				cs.abortRequestBodyWrite(http2errStopReqBodyWriteAndCancel)
+				<-bodyWriter.resc
 			}
 			cc.forgetStreamID(cs.ID)
 			return nil, cs.getStartedWrite(), ctx.Err()
@@ -7670,6 +7675,7 @@ func (cc *http2ClientConn) roundTrip(req *Request) (res *Response, gotErrAfterRe
 			} else {
 				bodyWriter.cancel()
 				cs.abortRequestBodyWrite(http2errStopReqBodyWriteAndCancel)
+				<-bodyWriter.resc
 			}
 			cc.forgetStreamID(cs.ID)
 			return nil, cs.getStartedWrite(), http2errRequestCanceled
@@ -7679,6 +7685,7 @@ func (cc *http2ClientConn) roundTrip(req *Request) (res *Response, gotErrAfterRe
 			// forgetStreamID.
 			return nil, cs.getStartedWrite(), cs.resetErr
 		case err := <-bodyWriter.resc:
+			bodyWritten = true
 			// Prefer the read loop's response, if available. Issue 16102.
 			select {
 			case re := <-readLoopResCh:
@@ -7689,7 +7696,6 @@ func (cc *http2ClientConn) roundTrip(req *Request) (res *Response, gotErrAfterRe
 				cc.forgetStreamID(cs.ID)
 				return nil, cs.getStartedWrite(), err
 			}
-			bodyWritten = true
 			if d := cc.responseHeaderTimeout(); d != 0 {
 				timer := time.NewTimer(d)
 				defer timer.Stop()

</details>

What did you do?

Pulled in latest version of x/net in CL 266898, which includes the change in CL 253259, then ran all.bash (and SlowBots). It failed with timeouts.

I narrowed it down to applying just the x/net/http2 change of CL 253259 and the TestNoSniffExpectRequestBody_h2 test:

$ go test -short -v -run=TestNoSniffExpectRequestBody_h2 net/http

What did you expect to see?

$ go test -short -v -run=TestNoSniffExpectRequestBody_h2 net/http
=== RUN   TestNoSniffExpectRequestBody_h2
--- PASS: TestNoSniffExpectRequestBody_h2 (0.00s)
PASS
ok  	net/http	0.369s

What did you see instead?

$ go test -short -v -run=TestNoSniffExpectRequestBody_h2 net/http
=== RUN   TestNoSniffExpectRequestBody_h2
<stall until test times out>

<details><summary>Full Output</summary><br>

 $ go test -short -v -timeout=60s -run=TestNoSniffExpectRequestBody_h2 net/http
=== RUN   TestNoSniffExpectRequestBody_h2
panic: test timed out after 1m0s

goroutine 29 [running]:
testing.(*M).startAlarm.func1()
	/Users/dmitshur/gotip/src/testing/testing.go:1680 +0xe5
created by time.goFunc
	/Users/dmitshur/gotip/src/time/sleep.go:167 +0x45

goroutine 1 [chan receive]:
testing.(*T).Run(0xc000082900, 0x15295ad, 0x1f, 0x1549ca8, 0x1091f01)
	/Users/dmitshur/gotip/src/testing/testing.go:1219 +0x2da
testing.runTests.func1(0xc000082780)
	/Users/dmitshur/gotip/src/testing/testing.go:1491 +0x78
testing.tRunner(0xc000082780, 0xc0000d5d68)
	/Users/dmitshur/gotip/src/testing/testing.go:1173 +0xef
testing.runTests(0xc0000b6138, 0x182eac0, 0x216, 0x216, 0xbfe2ea7af9323a28, 0xdf857cfc6, 0x1834180, 0x203000)
	/Users/dmitshur/gotip/src/testing/testing.go:1489 +0x2fe
testing.(*M).Run(0xc000194000, 0x0)
	/Users/dmitshur/gotip/src/testing/testing.go:1397 +0x1eb
net/http_test.TestMain(0xc000194000)
	/Users/dmitshur/gotip/src/net/http/main_test.go:23 +0x2b
main.main()
	_testmain.go:1179 +0x165

goroutine 19 [chan receive]:
net/http.(*http2ClientConn).roundTrip.func1(0xc00031a000, 0x0, 0x0, 0x0, 0x6, 0x2540be401, 0x5)
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:7636 +0x21d
net/http.(*http2ClientConn).roundTrip(0xc000212300, 0xc00018d700, 0x0, 0x0, 0x0, 0x0)
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:7651 +0x1022
net/http.(*http2Transport).RoundTripOpt(0xc0000ae3f0, 0xc00018d700, 0xc00009c500, 0xc0000c0370, 0xc00009c530, 0x154b228)
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:6972 +0x1a5
net/http.(*http2Transport).RoundTrip(0xc0000ae3f0, 0xc00018d700, 0x0, 0xc0000da0d8, 0x5)
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:6933 +0x3a
net/http.(*Transport).roundTrip(0xc00009c500, 0xc00018d600, 0x1515fb6, 0x6, 0xc00018e4a8)
	/Users/dmitshur/gotip/src/net/http/transport.go:590 +0x814
net/http.(*Transport).RoundTrip(...)
	/Users/dmitshur/gotip/src/net/http/roundtrip.go:17
net/http_test.testNoSniffExpectRequestBody(0xc000082900, 0x127406f257f701)
	/Users/dmitshur/gotip/src/net/http/clientserver_test.go:1339 +0x2ce
net/http_test.TestNoSniffExpectRequestBody_h2(0xc000082900)
	/Users/dmitshur/gotip/src/net/http/clientserver_test.go:1321 +0x30
testing.tRunner(0xc000082900, 0x1549ca8)
	/Users/dmitshur/gotip/src/testing/testing.go:1173 +0xef
created by testing.(*T).Run
	/Users/dmitshur/gotip/src/testing/testing.go:1218 +0x2b3

goroutine 20 [IO wait]:
internal/poll.runtime_pollWait(0x7b1e7d8, 0x72, 0x0)
	/Users/dmitshur/gotip/src/runtime/netpoll.go:222 +0x55
internal/poll.(*pollDesc).wait(0xc000194098, 0x72, 0x0, 0x0, 0x1516106)
	/Users/dmitshur/gotip/src/internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
	/Users/dmitshur/gotip/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Accept(0xc000194080, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/Users/dmitshur/gotip/src/internal/poll/fd_unix.go:401 +0x212
net.(*netFD).accept(0xc000194080, 0x4e0000c00020ad88, 0x100fc38, 0x4e2ee7a83207217e)
	/Users/dmitshur/gotip/src/net/fd_unix.go:172 +0x45
net.(*TCPListener).accept(0xc0000b6150, 0x14fa2c0, 0xc0000a1c70, 0xc00020ae20)
	/Users/dmitshur/gotip/src/net/tcpsock_posix.go:139 +0x32
net.(*TCPListener).Accept(0xc0000b6150, 0x127406f26beb00, 0xc039489ca0, 0xc0000ae1c0, 0x0)
	/Users/dmitshur/gotip/src/net/tcpsock.go:261 +0x65
crypto/tls.(*listener).Accept(0xc0000b6660, 0xc00020ae70, 0x18, 0xc000083080, 0x12f735b)
	/Users/dmitshur/gotip/src/crypto/tls/tls.go:66 +0x37
net/http.(*Server).Serve(0xc0001a6000, 0x15ca650, 0xc0000b6660, 0x0, 0x0)
	/Users/dmitshur/gotip/src/net/http/server.go:2975 +0x285
net/http/httptest.(*Server).goServe.func1(0xc0000ae1c0)
	/Users/dmitshur/gotip/src/net/http/httptest/server.go:308 +0x6e
created by net/http/httptest.(*Server).goServe
	/Users/dmitshur/gotip/src/net/http/httptest/server.go:306 +0x5c

goroutine 22 [select]:
net/http.(*http2serverConn).serve(0xc000083680)
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:4428 +0x579
net/http.(*http2Server).ServeConn(0xc0000ec880, 0x15d03d8, 0xc0000a9c00, 0xc0000d1b68)
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:4038 +0x725
net/http.http2ConfigureServer.func1(0xc0001a6000, 0xc0000a9c00, 0x15c27e0, 0xc0000d8520)
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:3864 +0xf0
net/http.(*conn).serve(0xc0000cadc0, 0x15cb2c0, 0xc000202060)
	/Users/dmitshur/gotip/src/net/http/server.go:1855 +0x1555
created by net/http.(*Server).Serve
	/Users/dmitshur/gotip/src/net/http/server.go:3007 +0x39b

goroutine 36 [IO wait]:
internal/poll.runtime_pollWait(0x7b1e6f0, 0x72, 0xffffffffffffffff)
	/Users/dmitshur/gotip/src/runtime/netpoll.go:222 +0x55
internal/poll.(*pollDesc).wait(0xc000194318, 0x72, 0x600, 0x6e9, 0xffffffffffffffff)
	/Users/dmitshur/gotip/src/internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
	/Users/dmitshur/gotip/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc000194300, 0xc000260000, 0x6e9, 0x6e9, 0x0, 0x0, 0x0)
	/Users/dmitshur/gotip/src/internal/poll/fd_unix.go:166 +0x1d5
net.(*netFD).Read(0xc000194300, 0xc000260000, 0x6e9, 0x6e9, 0x79fffff, 0xc00005f7c8, 0x101ab7e)
	/Users/dmitshur/gotip/src/net/fd_posix.go:55 +0x4f
net.(*conn).Read(0xc000210000, 0xc000260000, 0x6e9, 0x6e9, 0x0, 0x0, 0x0)
	/Users/dmitshur/gotip/src/net/net.go:183 +0x91
crypto/tls.(*atLeastReader).Read(0xc000308030, 0xc000260000, 0x6e9, 0x6e9, 0x3, 0xc000080000, 0x0)
	/Users/dmitshur/gotip/src/crypto/tls/conn.go:777 +0x63
bytes.(*Buffer).ReadFrom(0xc000214278, 0x15c13e0, 0xc000308030, 0x100d125, 0x14a50e0, 0x1501b40)
	/Users/dmitshur/gotip/src/bytes/buffer.go:204 +0xbe
crypto/tls.(*Conn).readFromUntil(0xc000214000, 0x7b22a40, 0xc000210000, 0x5, 0xc000210000, 0x20300000000000)
	/Users/dmitshur/gotip/src/crypto/tls/conn.go:799 +0xf3
crypto/tls.(*Conn).readRecordOrCCS(0xc000214000, 0x15cb200, 0xc0000a4008, 0x0)
	/Users/dmitshur/gotip/src/crypto/tls/conn.go:606 +0x115
crypto/tls.(*Conn).readRecord(...)
	/Users/dmitshur/gotip/src/crypto/tls/conn.go:574
crypto/tls.(*Conn).Read(0xc000214000, 0xc000274000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/Users/dmitshur/gotip/src/crypto/tls/conn.go:1277 +0x17f
bufio.(*Reader).Read(0xc00025d980, 0xc00026c1f8, 0x9, 0x9, 0x0, 0x10, 0x19433c8)
	/Users/dmitshur/gotip/src/bufio/bufio.go:227 +0x222
io.ReadAtLeast(0x15c1200, 0xc00025d980, 0xc00026c1f8, 0x9, 0x9, 0x9, 0xc00005fcd8, 0x12bc13c, 0x14e0be0)
	/Users/dmitshur/gotip/src/io/io.go:328 +0x87
io.ReadFull(...)
	/Users/dmitshur/gotip/src/io/io.go:347
net/http.http2readFrameHeader(0xc00026c1f8, 0x9, 0x9, 0x15c1200, 0xc00025d980, 0x0, 0x0, 0xc00030a040, 0x0)
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:1477 +0x89
net/http.(*http2Framer).ReadFrame(0xc00026c1c0, 0xc00030a040, 0x0, 0x0, 0x0)
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:1735 +0xa5
net/http.(*http2clientConnReadLoop).run(0xc00005ffa8, 0x0, 0x0)
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:8303 +0xd8
net/http.(*http2ClientConn).readLoop(0xc000212300)
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:8225 +0x6f
created by net/http.(*http2Transport).newClientConn
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:7198 +0x66e

goroutine 25 [IO wait]:
internal/poll.runtime_pollWait(0x7b1e608, 0x72, 0xffffffffffffffff)
	/Users/dmitshur/gotip/src/runtime/netpoll.go:222 +0x55
internal/poll.(*pollDesc).wait(0xc000194398, 0x72, 0x200, 0x205, 0xffffffffffffffff)
	/Users/dmitshur/gotip/src/internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
	/Users/dmitshur/gotip/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc000194380, 0xc0001a8240, 0x205, 0x205, 0x0, 0x0, 0x0)
	/Users/dmitshur/gotip/src/internal/poll/fd_unix.go:166 +0x1d5
net.(*netFD).Read(0xc000194380, 0xc0001a8240, 0x205, 0x205, 0x200, 0xc0001a8240, 0x5)
	/Users/dmitshur/gotip/src/net/fd_posix.go:55 +0x4f
net.(*conn).Read(0xc0000aa070, 0xc0001a8240, 0x205, 0x205, 0x0, 0x0, 0x0)
	/Users/dmitshur/gotip/src/net/net.go:183 +0x91
crypto/tls.(*atLeastReader).Read(0xc0000b6780, 0xc0001a8240, 0x205, 0x205, 0x200, 0x1834a40, 0x0)
	/Users/dmitshur/gotip/src/crypto/tls/conn.go:777 +0x63
bytes.(*Buffer).ReadFrom(0xc0000a9e78, 0x15c13e0, 0xc0000b6780, 0x100d125, 0x14a50e0, 0x1501b40)
	/Users/dmitshur/gotip/src/bytes/buffer.go:204 +0xbe
crypto/tls.(*Conn).readFromUntil(0xc0000a9c00, 0x7b22a40, 0xc0000aa070, 0x5, 0xc0000aa070, 0x9)
	/Users/dmitshur/gotip/src/crypto/tls/conn.go:799 +0xf3
crypto/tls.(*Conn).readRecordOrCCS(0xc0000a9c00, 0x15cb200, 0xc0000a4008, 0x0)
	/Users/dmitshur/gotip/src/crypto/tls/conn.go:606 +0x115
crypto/tls.(*Conn).readRecord(...)
	/Users/dmitshur/gotip/src/crypto/tls/conn.go:574
crypto/tls.(*Conn).Read(0xc0000a9c00, 0xc0001a6498, 0x9, 0x9, 0x0, 0x0, 0x0)
	/Users/dmitshur/gotip/src/crypto/tls/conn.go:1277 +0x17f
io.ReadAtLeast(0x15c13a0, 0xc0000a9c00, 0xc0001a6498, 0x9, 0x9, 0x9, 0x0, 0x2, 0x1)
	/Users/dmitshur/gotip/src/io/io.go:328 +0x87
io.ReadFull(...)
	/Users/dmitshur/gotip/src/io/io.go:347
net/http.http2readFrameHeader(0xc0001a6498, 0x9, 0x9, 0x15c13a0, 0xc0000a9c00, 0x0, 0xc000000000, 0xc0000d3f70, 0xc0000909c0)
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:1477 +0x89
net/http.(*http2Framer).ReadFrame(0xc0001a6460, 0xc0000d3f38, 0x0, 0x0, 0x2)
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:1735 +0xa5
net/http.(*http2serverConn).readFrames(0xc000083680)
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:4314 +0xa9
created by net/http.(*http2serverConn).serve
	/Users/dmitshur/gotip/src/net/http/h2_bundle.go:4420 +0x366
FAIL	net/http	60.249s
FAIL

</details>

This may be related to #42256.

CC @fraenkel, @neild, @odeke-em.

closed time in an hour

dmitshur

issue commentgolang/go

net/http, x/net/http2: net/http's TestNoSniffExpectRequestBody_h2 stops passing after x/net/http2 change in CL 253259

I believe this was fixed by https://golang.org/cl/269058.

dmitshur

comment created time in an hour

issue commentgolang/go

bytes: clarify semantics regarding Buffer.Bytes and Buffer.Write

(I'm not sure I really understand the use case and not sure about about what semantics Buffer.Bytes should be. Just a comment about the performance part.)

If this is an appropriate use of the Bytes method, then I suggest that Write have a special case where it trivially reslices the internal buffer if the input slice aliases the next buffer segment

Is this necessary? If the input slice aliases the next buffer segment, the current code should already do that, as self-copy should return immediately.

dsnet

comment created time in an hour

issue closedgolang/go

proposal: Go 2: reflect: return opaque pointer instead of uintptr

The Value.Pointer and Value.UnsafeAddr methods and the SliceHeader.Data and StringHeader.Data fields all use uintptr. This has some downsides:

Package reflect's Value methods named Pointer and UnsafeAddr return type uintptr instead of unsafe.Pointer to keep callers from changing the result to an arbitrary type without first importing "unsafe". However, this means that the result is fragile and must be converted to Pointer immediately after making the call, in the same expression.

  • It is ill-suited for applications that only care about pointer comparability (don't care about pointer arithmetic and converting to a specific type). For example, the reflect.DeepEqual implementation imports unsafe in order to convert the uintptr to an unsafe.Pointer to have a pointer that the GC knows how to scan (or move if we ever have a moving GC).

In Go2, I propose that Value.UnsafeAddr and Value.Pointer methods return and the SliceHeader.Data and StringHeader.Data fields be a reflect.Pointer type:

package reflect

// Pointer is an opaque pointer and is guaranteed to be comparable.
type Pointer struct { p unsafe.Pointer }

func (p Pointer) SetInto(p2 *unsafe.Pointer) {
    *p2 = p.p
}

The SetInto method writes the pointer into p2 and requires the user to already have imported unsafe. It's a more clunky, but less error prone.

Alternatively, we could define unsafe.OpaquePointer that is safe to store and pass around, but does not permit arithmetic on it, nor can it be converted to a pointer of any arbitrary type. You can convert unsafe.OpaquePointer to unsafe.Pointer and vice versa. However, you cannot convert an uintptr to an unsafe.OpaquePointer as this would easily allow the creation of invalid pointers. This simplifies the warnings about uintptr not being stored in a variable, and must be within the same expression. To ensure usage of OpaquePointer does not require unsafe, we could type alias it from the reflect package.

Thus, rules 5 and 6 in unsafe can be entirely eliminated.

closed time in an hour

dsnet

issue commentgolang/go

proposal: Go 2: reflect: return opaque pointer instead of uintptr

I'm rescinding this proposal in light of #40592.

dsnet

comment created time in an hour

PR opened DataDog/documentation

Documentation for Code Signing for Lambda Do Not Merge

because I did a fastpress on https://github.com/DataDog/documentation/pull/9190 and it wasn't ready yet. This is dependent on version 41 of the Node layer is release. @nhinsch will let us know in #documentation

+38 -3

0 comment

3 changed files

pr created time in an hour

push eventDataDog/documentation

Kaylyn

commit sha eec3cccfccdae8c04f4e7ffe2c580605fc8b3177

Revert "Documentation for Code Signing for Lambda (#9190)" (#9191) This reverts commit ea891cfb6afe331be64fa88ef3f7215ace0a536a.

view details

push time in an hour

delete branch DataDog/documentation

delete branch : revert-9190-ngh-lambda-signing

delete time in an hour

create barnchDataDog/documentation

branch : revert-9190-ngh-lambda-signing

created branch time in an hour

create barnchDataDog/documentation

branch : ngh-lambda-signing

created branch time in an hour

issue commentgolang/go

cmd/compile: make encoding/binary.LittleEndian.* have negligible inlining cost on amd64

Whatever happens, I think we should avoid special casing just encoding/binary.LittleEndian.*. There are a number of equivalent functions that avoid the encoding/binary package as a dependency that may want to benefit from this as well (e.g., "compress/flate".load64)

josharian

comment created time in an hour

push eventDataDog/documentation

Nicolas Hinsch

commit sha ea891cfb6afe331be64fa88ef3f7215ace0a536a

Documentation for Code Signing for Lambda (#9190)

view details

push time in an hour

delete branch DataDog/documentation

delete branch : ngh-lambda-signing

delete time in an hour

PR merged DataDog/documentation

Add documentation for Code Signing for Lambda, remove Node 8 reference Do Not Merge serverless

What does this PR do?

  • Update documentation to take into account the new code signing for Lambda feature.
  • Remove a reference to the Node 8 runtime, which has been deprecated by AWS Lambda, and for which we no longer publish layers

Motivation

We offer Lambda layers for the Node, Python, and JavaScript runtimes. If the customer configures a Lambda function to use code signing, they must add Datadog's Signing Profile ARN to that function's Code Signing Configuration before they can add our layer to the function.

Preview

https://docs-staging.datadoghq.com/ngh-lambda-signing/installation/python https://docs-staging.datadoghq.com/ngh-lambda-signing/installation/nodejs https://docs-staging.datadoghq.com/ngh-lambda-signing/installation/ruby


Reviewer checklist

  • [ ] Review the changed files.
  • [ ] Review the URLs listed in the Preview section.
  • [ ] Review any mentions of "Contact Datadog support" for internal support documentation.
+38 -3

1 comment

3 changed files

nhinsch

pr closed time in an hour

pull request commentDataDog/documentation

Add documentation for Code Signing for Lambda, remove Node 8 reference

This is ready for review, but should not be merged until version 41 of the Node layer is released.

nhinsch

comment created time in an hour

PR opened DataDog/documentation

Add documentation for Code Signing for Lambda, remove Node 8 reference

What does this PR do?

  • Update documentation to take into account the new code signing for Lambda feature.
  • Remove a reference to the Node 8 runtime, which has been deprecated by AWS Lambda, and for which we no longer publish layers

Motivation

We offer Lambda layers for the Node, Python, and JavaScript runtimes. If the customer configures a Lambda function to use code signing, they must add Datadog's Signing Profile ARN to that function's Code Signing Configuration before they can add our layer to the function.

Preview

https://docs-staging.datadoghq.com/ngh-lambda-signing/installation/python https://docs-staging.datadoghq.com/ngh-lambda-signing/installation/nodejs https://docs-staging.datadoghq.com/ngh-lambda-signing/installation/ruby


Reviewer checklist

  • [ ] Review the changed files.
  • [ ] Review the URLs listed in the Preview section.
  • [ ] Review any mentions of "Contact Datadog support" for internal support documentation.
+38 -3

0 comment

3 changed files

pr created time in an hour

more