crypto: 无聊的加密 crypto cgo指针失败

qyuhtwio  于 5个月前  发布在  Go
关注(0)|答案(4)|浏览(62)
  1. #!watchflakes
  2. post <- builder ~ `boringcrypto` && `cgo argument has Go pointer to Go pointer`

自动创建的问题以收集这些故障。
示例( log ):

  1. --- FAIL: TestVersion (0.00s)
  2. panic: runtime error: cgo argument has Go pointer to Go pointer [recovered]
  3. panic: runtime error: cgo argument has Go pointer to Go pointer
  4. goroutine 488 [running]:
  5. panic({0x3af200, 0x40002fc4c0})
  6. /workdir/go/src/runtime/panic.go:987 +0x3e0 fp=0x4000400f60 sp=0x4000400ea0 pc=0x12e190
  7. testing.tRunner.func1.2({0x3af200, 0x40002fc4c0})
  8. /workdir/go/src/testing/testing.go:1396 +0x1c8 fp=0x4000401010 sp=0x4000400f60 pc=0x1d7308
  9. testing.tRunner.func1()
  10. ...
  11. crypto/tls.TestVersion(0x40002a04e0)
  12. /workdir/go/src/crypto/tls/handshake_server_test.go:390 +0xc4 fp=0x4000401f60 sp=0x4000401c30 pc=0x3317c4
  13. testing.tRunner(0x40002a04e0, 0x436b00)
  14. /workdir/go/src/testing/testing.go:1446 +0x10c fp=0x4000401fb0 sp=0x4000401f60 pc=0x1d6a3c
  15. testing.(*T).Run.func1()
  16. /workdir/go/src/testing/testing.go:1493 +0x2c fp=0x4000401fd0 sp=0x4000401fb0 pc=0x1d777c
  17. runtime.goexit()
  18. /workdir/go/src/runtime/asm_arm64.s:1165 +0x4 fp=0x4000401fd0 sp=0x4000401fd0 pc=0x1617a4
  19. created by testing.(*T).Run
  20. /workdir/go/src/testing/testing.go:1493 +0x328

watchflakes

yxyvkwin

yxyvkwin1#

找到新的 Jmeter 板测试碎片:

  1. #!watchflakes
  2. post <- pkg == "crypto/tls" && test == "TestVersion"

2022-08-18 21:54 linux-arm64-boringcrypto go@17211c35 crypto/tls.TestVersion ( log )

  1. --- FAIL: TestVersion (0.00s)
  2. panic: runtime error: cgo argument has Go pointer to Go pointer [recovered]
  3. panic: runtime error: cgo argument has Go pointer to Go pointer
  4. goroutine 488 [running]:
  5. panic({0x3af200, 0x40002fc4c0})
  6. /workdir/go/src/runtime/panic.go:987 +0x3e0 fp=0x4000400f60 sp=0x4000400ea0 pc=0x12e190
  7. testing.tRunner.func1.2({0x3af200, 0x40002fc4c0})
  8. /workdir/go/src/testing/testing.go:1396 +0x1c8 fp=0x4000401010 sp=0x4000400f60 pc=0x1d7308
  9. testing.tRunner.func1()
  10. ...
  11. crypto/tls.TestVersion(0x40002a04e0)
  12. /workdir/go/src/crypto/tls/handshake_server_test.go:390 +0xc4 fp=0x4000401f60 sp=0x4000401c30 pc=0x3317c4
  13. testing.tRunner(0x40002a04e0, 0x436b00)
  14. /workdir/go/src/testing/testing.go:1446 +0x10c fp=0x4000401fb0 sp=0x4000401f60 pc=0x1d6a3c
  15. testing.(*T).Run.func1()
  16. /workdir/go/src/testing/testing.go:1493 +0x2c fp=0x4000401fd0 sp=0x4000401fb0 pc=0x1d777c
  17. runtime.goexit()
  18. /workdir/go/src/runtime/asm_arm64.s:1165 +0x4 fp=0x4000401fd0 sp=0x4000401fd0 pc=0x1617a4
  19. created by testing.(*T).Run
  20. /workdir/go/src/testing/testing.go:1493 +0x328

watchflakes

展开查看全部
6pp0gazn

6pp0gazn2#

已更改以跟踪无聊的加密指针故障。我认为它们已经解决了,但我不记得修复它们了。

pexxcrt2

pexxcrt23#

发现了新的 Jmeter 板测试碎片:

  1. #!watchflakes
  2. post <- builder ~ `boringcrypto` && `cgo argument has Go pointer to Go pointer`

2022-08-17 18:37 linux-amd64-boringcrypto crypto@04dced17 go@57d05512 x/crypto/internal/wycheproof.TestHkdf ( log )

  1. --- FAIL: TestHkdf (0.02s)
  2. panic: runtime error: cgo argument has Go pointer to Go pointer [recovered]
  3. panic: runtime error: cgo argument has Go pointer to Go pointer
  4. goroutine 1732 [running]:
  5. testing.tRunner.func1.2({0x740ea0, 0xc00006ecb0})
  6. /workdir/go/src/testing/testing.go:1396 +0x24e
  7. testing.tRunner.func1()
  8. /workdir/go/src/testing/testing.go:1399 +0x39f
  9. panic({0x740ea0, 0xc00006ecb0})
  10. /workdir/go/src/runtime/panic.go:884 +0x212
  11. crypto/internal/boring.(*boringHMAC).Reset.func1(0xc000479c20)
  12. /workdir/go/src/crypto/internal/boring/hmac.go:107 +0x57
  13. crypto/internal/boring.(*boringHMAC).Reset(0xc000479c20)
  14. /workdir/go/src/crypto/internal/boring/hmac.go:107 +0x94
  15. crypto/internal/boring.NewHMAC(0xc000641b88?, {0xc000024d20, 0x38, 0x0?})
  16. /workdir/go/src/crypto/internal/boring/hmac.go:79 +0x125
  17. crypto/hmac.New(0xc000641cd8, {0xc000024d20, 0x38, 0x70})
  18. /workdir/go/src/crypto/hmac/hmac.go:131 +0x31
  19. golang.org/x/crypto/hkdf.Extract(0xc00044bc20?, {0xc000476a00, 0x20, 0x40}, {0xc000024d20?, 0x20?, 0x30?})
  20. /workdir/gopath/src/golang.org/x/crypto/hkdf/hkdf.go:30 +0x85
  21. golang.org/x/crypto/hkdf.New(0x15?, {0xc000476a00?, 0x20?, 0x82d248?}, {0xc000024d20?, 0xc000057ca0?, 0x5c57f9?}, {0xc00044bc20, 0x14, 0x30})
  22. /workdir/gopath/src/golang.org/x/crypto/hkdf/hkdf.go:91 +0x2b
  23. golang.org/x/crypto/internal/wycheproof.TestHkdf(0xc000600820)
  24. /workdir/gopath/src/golang.org/x/crypto/internal/wycheproof/hkdf_test.go:95 +0x450
  25. testing.tRunner(0xc000600820, 0x792668)
  26. /workdir/go/src/testing/testing.go:1446 +0x10b
  27. created by testing.(*T).Run
  28. /workdir/go/src/testing/testing.go:1493 +0x35f

2022-08-17 18:37 linux-amd64-boringcrypto crypto@04dced17 go@ebda5a73 x/crypto/internal/wycheproof.TestHkdf ( log )

  1. --- FAIL: TestHkdf (0.00s)
  2. panic: runtime error: cgo argument has Go pointer to Go pointer [recovered]
  3. panic: runtime error: cgo argument has Go pointer to Go pointer
  4. goroutine 879 [running]:
  5. testing.tRunner.func1.2({0x740ea0, 0xc00014f2b0})
  6. /workdir/go/src/testing/testing.go:1396 +0x24e
  7. testing.tRunner.func1()
  8. /workdir/go/src/testing/testing.go:1399 +0x39f
  9. panic({0x740ea0, 0xc00014f2b0})
  10. /workdir/go/src/runtime/panic.go:884 +0x212
  11. crypto/internal/boring.(*boringHMAC).Reset.func1(0xc0001efd40)
  12. /workdir/go/src/crypto/internal/boring/hmac.go:107 +0x57
  13. crypto/internal/boring.(*boringHMAC).Reset(0xc0001efd40)
  14. /workdir/go/src/crypto/internal/boring/hmac.go:107 +0x94
  15. crypto/internal/boring.NewHMAC(0xc000173b88?, {0xc0003ebb90, 0x41, 0x0?})
  16. /workdir/go/src/crypto/internal/boring/hmac.go:79 +0x125
  17. crypto/hmac.New(0xc000173cd8, {0xc0003ebb90, 0x41, 0x90})
  18. /workdir/go/src/crypto/hmac/hmac.go:131 +0x31
  19. golang.org/x/crypto/hkdf.Extract(0xc0001cd410?, {0xc0001cd3e0, 0x14, 0x30}, {0xc0003ebb90?, 0x20?, 0x30?})
  20. /workdir/gopath/src/golang.org/x/crypto/hkdf/hkdf.go:30 +0x85
  21. golang.org/x/crypto/hkdf.New(0x13?, {0xc0001cd3e0?, 0x20?, 0x82d248?}, {0xc0003ebb90?, 0xc00037b4a0?, 0x5c57f9?}, {0xc0001cd410, 0x14, 0x30})
  22. /workdir/gopath/src/golang.org/x/crypto/hkdf/hkdf.go:91 +0x2b
  23. golang.org/x/crypto/internal/wycheproof.TestHkdf(0xc00042a1a0)
  24. /workdir/gopath/src/golang.org/x/crypto/internal/wycheproof/hkdf_test.go:95 +0x450
  25. testing.tRunner(0xc00042a1a0, 0x792648)
  26. /workdir/go/src/testing/testing.go:1446 +0x10b
  27. created by testing.(*T).Run
  28. /workdir/go/src/testing/testing.go:1493 +0x35f

watchflakes

展开查看全部
798qvoo8

798qvoo84#

已更改以跟踪无聊的加密指针故障。我认为它们已经解决了,但我不记得修复它们了。
@rsc 我们最近开始看到 cgo pointerboringcrypto 的故障。有任何计划解决这个问题吗?

  1. panic: runtime error: cgo argument has Go pointer to unpinned Go pointer
  2. goroutine 1 [running]:
  3. solace.dev/go/messaging/internal/ccsmp.(*SolClientContext).SolClientSessionCreate.func1.1(0x7f76c6d08a68?, 0x30?, 0xc000600400?, 0xc000226de0?)
  4. /go/src/example/vendor/solace.dev/go/messaging/internal/ccsmp/ccsmp_core.go:265
  5. +0x51solace.dev/go/messaging/internal/ccsmp.(*SolClientContext).SolClientSessionCreate.func1()
  6. /go/src/example/vendor/solace.dev/go/messaging/internal/ccsmp/ccsmp_core.go:265 +0x25

内部库 solace 使用带有 //go:cgo_unsafe_args 指令的 CGO 函数。这导致了带有 boringcrypto 的运行时错误。
而这种 Unpinned 指针运行时错误只在我们尝试在应用程序中启用 GOEXPERIMENT=boringcrypto 时发生。

相关问题