Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test panic when go directive is bumped to 1.22 #4338

Closed
zhsj opened this issue Feb 28, 2024 · 3 comments · Fixed by #4486
Closed

Test panic when go directive is bumped to 1.22 #4338

zhsj opened this issue Feb 28, 2024 · 3 comments · Fixed by #4486
Milestone

Comments

@zhsj
Copy link

zhsj commented Feb 28, 2024

In Debian, we still build software with GOPATH mode. After bumping Go to 1.22, I see a strange failure in quic-go. The failure can be reproduced by bumping go directive to 1.22 in go.mod.

zsj@nuc12:/tmp/t$ git clone https://github.com/quic-go/quic-go
Cloning into 'quic-go'...
remote: Enumerating objects: 41633, done.
remote: Counting objects: 100% (7498/7498), done.
remote: Compressing objects: 100% (674/674), done.
remote: Total 41633 (delta 7040), reused 6918 (delta 6821), pack-reused 34135
Receiving objects: 100% (41633/41633), 15.48 MiB | 406.00 KiB/s, done.
Resolving deltas: 100% (31249/31249), done.
zsj@nuc12:/tmp/t$ cd quic-go/

zsj@nuc12:/tmp/t/quic-go$ go mod edit -go=1.22

zsj@nuc12:/tmp/t/quic-go$ go test -v . -ginkgo.v  -ginkgo.focus "Connection sending packets sending Handshake probe packets"
=== RUN   TestQuicGo
Running Suite: QUIC Suite - /tmp/t/quic-go
==========================================
Random Seed: 1709153441

Will run 2 of 745 specs
------------------------------
[BeforeSuite] 
/tmp/t/quic-go/quic_suite_test.go:31
[BeforeSuite] PASSED [0.000 seconds]
------------------------------
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
------------------------------
Connection sending packets sending Handshake probe packets sends a probe packet
/tmp/t/quic-go/connection_test.go:1322
  [PANICKED] in [It] - /usr/lib/go-1.22/src/runtime/panic.go:770 @ 02/29/24 04:50:42.919
  [FAILED] in [AfterEach] - /tmp/t/quic-go/connection_test.go:1201 @ 02/29/24 04:50:43.922
  [FAILED] in [AfterEach] - /tmp/t/quic-go/quic_suite_test.go:48 @ 02/29/24 04:50:43.923
• [PANICKED] [2.008 seconds]
Connection sending packets sending Handshake probe packets [It] sends a probe packet
/tmp/t/quic-go/connection_test.go:1322

  [PANICKED] Test Panicked
  In [It] at: /usr/lib/go-1.22/src/runtime/panic.go:770 @ 02/29/24 04:50:42.919

  can't determine encryption level

  Full Stack Trace
    panic({0x99b960?, 0xb91fc0?})
        /usr/lib/go-1.22/src/runtime/panic.go:770 +0x132
    github.com/quic-go/quic-go.(*longHeaderPacket).EncryptionLevel(...)
        /tmp/t/quic-go/packet_packer.go:89
    github.com/quic-go/quic-go.(*connection).sendPackedCoalescedPacket(0xc0001a8408, 0xc0004a0690, 0x0, {0xc000000001?, 0xa56f80?, 0xf16ee0?})
        /tmp/t/quic-go/connection.go:2080 +0x4a9
    github.com/quic-go/quic-go.(*connection).sendProbePacket(0xc0001a8408, 0x2, {0x1039e15?, 0xf16ee0?, 0xf16ee0?})
        /tmp/t/quic-go/connection.go:2040 +0x193
    github.com/quic-go/quic-go.(*connection).triggerSending(0xc0001a8408, {0x1039e15?, 0xf16ee0?, 0xf16ee0?})
        /tmp/t/quic-go/connection.go:1810 +0x14e
    github.com/quic-go/quic-go.(*connection).run(0xc0001a8408)
        /tmp/t/quic-go/connection.go:633 +0x9fa
    github.com/quic-go/quic-go.init.func14.11.3.1()
        /tmp/t/quic-go/connection_test.go:1209 +0x145
    created by github.com/quic-go/quic-go.init.func14.11.3 in goroutine 14
        /tmp/t/quic-go/connection_test.go:1205 +0x90

  There were additional failures detected.  To view them in detail run ginkgo -vv
------------------------------
SS
------------------------------
Connection sending packets sending Handshake probe packets sends a PING as a probe packet
/tmp/t/quic-go/connection_test.go:1345
  [PANICKED] in [It] - /usr/lib/go-1.22/src/runtime/panic.go:770 @ 02/29/24 04:50:44.927
  [FAILED] in [AfterEach] - /tmp/t/quic-go/connection_test.go:1201 @ 02/29/24 04:50:45.928
  [FAILED] in [AfterEach] - /tmp/t/quic-go/quic_suite_test.go:48 @ 02/29/24 04:50:45.929
• [PANICKED] [2.005 seconds]
Connection sending packets sending Handshake probe packets [It] sends a PING as a probe packet
/tmp/t/quic-go/connection_test.go:1345

  [PANICKED] Test Panicked
  In [It] at: /usr/lib/go-1.22/src/runtime/panic.go:770 @ 02/29/24 04:50:44.927

  can't determine encryption level

  Full Stack Trace
    panic({0x99b960?, 0xb91fc0?})
        /usr/lib/go-1.22/src/runtime/panic.go:770 +0x132
    github.com/quic-go/quic-go.(*longHeaderPacket).EncryptionLevel(...)
        /tmp/t/quic-go/packet_packer.go:89
    github.com/quic-go/quic-go.(*connection).sendPackedCoalescedPacket(0xc0001a8808, 0xc0004a1ad0, 0x3, {0xc000000001?, 0xa56f80?, 0xf16ee0?})
        /tmp/t/quic-go/connection.go:2080 +0x4a9
    github.com/quic-go/quic-go.(*connection).sendProbePacket(0xc0001a8808, 0x2, {0x78c1df75?, 0xf16ee0?, 0xf16ee0?})
        /tmp/t/quic-go/connection.go:2040 +0x193
    github.com/quic-go/quic-go.(*connection).triggerSending(0xc0001a8808, {0x78c1df75?, 0xf16ee0?, 0xf16ee0?})
        /tmp/t/quic-go/connection.go:1810 +0x14e
    github.com/quic-go/quic-go.(*connection).run(0xc0001a8808)
        /tmp/t/quic-go/connection.go:633 +0x9fa
    github.com/quic-go/quic-go.init.func14.11.3.1()
        /tmp/t/quic-go/connection_test.go:1209 +0x145
    created by github.com/quic-go/quic-go.init.func14.11.3 in goroutine 27
        /tmp/t/quic-go/connection_test.go:1205 +0x90

  There were additional failures detected.  To view them in detail run ginkgo -vv
------------------------------
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

Summarizing 2 Failures:
  [PANICKED!] Connection sending packets sending Handshake probe packets [It] sends a probe packet
  /usr/lib/go-1.22/src/runtime/panic.go:770
  [PANICKED!] Connection sending packets sending Handshake probe packets [It] sends a PING as a probe packet
  /usr/lib/go-1.22/src/runtime/panic.go:770

Ran 2 of 745 Specs in 4.026 seconds
FAIL! -- 0 Passed | 2 Failed | 0 Pending | 743 Skipped
--- FAIL: TestQuicGo (4.03s)
FAIL
FAIL    github.com/quic-go/quic-go      4.037s
FAIL

I fail to see what new language feature in Go 1.22 could cause this.

@marten-seemann
Copy link
Member

I haven't tried it out yet, but our CI is running on Go 1.22 and everything is fine. I assume this is only happening because you're bumping the version in go.mod? Can you not do that and would that solve the problem?

@zhsj
Copy link
Author

zhsj commented Feb 29, 2024

I assume this is only happening because you're bumping the version in go.mod

Yes.

We are using GOPATH to build software in Debian. In that mode, the compiler always uses the latest version for language feature. I use go module mode in the issue for easy reproducing.

@marten-seemann marten-seemann added this to the v0.44 milestone May 4, 2024
@marten-seemann
Copy link
Member

This is due to https://go.dev/blog/loopvar-preview. The code is not testing what it should on Go 1.21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants