Skip to content

x/tools/gopls: RenderPkgDoc crashes on go.starlark.net/starlark #67287

Closed
@adonovan

Description

@adonovan
 server.go:3430: http: panic serving 127.0.0.1:54595: got invalid type, want variadic parameter with unnamed slice type or string as core type
 goroutine 6676 [running]:
 net/http.(*conn).serve.func1()
 	/Users/adonovan/w/goroot/src/net/http/server.go:1898 +0xb0
 panic({0x10504bf60?, 0x14001bc98e0?})
 	/Users/adonovan/w/goroot/src/runtime/panic.go:759 +0x124
 go/types.NewSignatureType(0x0, {0x105898240, 0x0, 0x0}, {0x105898240, 0x0, 0x0}, 0x14002b2c090, 0x14001c27170, 0x1)
 	/Users/adonovan/w/goroot/src/go/types/signature.go:57 +0x2f4
 golang.org/x/tools/gopls/internal/golang.RenderPackageDoc.func13(0x14006588f00)
 	/Users/adonovan/w/xtools/gopls/internal/golang/pkgdoc.go:493 +0x398
 golang.org/x/tools/gopls/internal/golang.RenderPackageDoc(0x14002367950, 0x14006917810, 0x140045aeaf8)
 	/Users/adonovan/w/xtools/gopls/internal/golang/pkgdoc.go:534 +0xb74
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.func6({0x1051db0b0, 0x14001dc40e0}, 0x14005714120)
 	/Users/adonovan/w/xtools/gopls/internal/server/server.go:351 +0x2dc
 net/http.HandlerFunc.ServeHTTP(0x0?, {0x1051db0b0?, 0x14001dc40e0?}, 0x5?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.StripPrefix.func9({0x1051db0b0, 0x14001dc40e0}, 0x14005714000)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2226 +0x228
 net/http.HandlerFunc.ServeHTTP(0x14001db29a0?, {0x1051db0b0?, 0x14001dc40e0?}, 0x104cb14bc?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 net/http.(*ServeMux).ServeHTTP(0x0?, {0x1051db0b0, 0x14001dc40e0}, 0x14005714000)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2700 +0x1a4
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.StripPrefix.func7({0x1051db0b0, 0x14001dc40e0}, 0x14000001b00)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2226 +0x228
 net/http.HandlerFunc.ServeHTTP(0x0?, {0x1051db0b0?, 0x14001dc40e0?}, 0x10?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.withPanicHandler.func8({0x1051db0b0?, 0x14001dc40e0?}, 0x140037c9b48?)
 	/Users/adonovan/w/xtools/gopls/internal/server/server.go:412 +0x74
 net/http.HandlerFunc.ServeHTTP(0x14001db28c0?, {0x1051db0b0?, 0x14001dc40e0?}, 0x1046d0db4?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 net/http.(*ServeMux).ServeHTTP(0x0?, {0x1051db0b0, 0x14001dc40e0}, 0x14000001b00)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2700 +0x1a4
 net/http.serverHandler.ServeHTTP({0x1400222e420?}, {0x1051db0b0?, 0x14001dc40e0?}, 0x6?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:3154 +0xbc
 net/http.(*conn).serve(0x1400226c090, {0x1051dbd28, 0x14001e946c0})
 	/Users/adonovan/w/goroot/src/net/http/server.go:2042 +0x4fc
 created by net/http.(*Server).Serve in goroutine 3248
 	/Users/adonovan/w/goroot/src/net/http/server.go:3302 +0x3dc
 server.go:3430: http: panic serving 127.0.0.1:54599: got invalid type, want variadic parameter with unnamed slice type or string as core type
 goroutine 6857 [running]:
 net/http.(*conn).serve.func1()
 	/Users/adonovan/w/goroot/src/net/http/server.go:1898 +0xb0
 panic({0x10504bf60?, 0x1400425baa0?})
 	/Users/adonovan/w/goroot/src/runtime/panic.go:759 +0x124
 go/types.NewSignatureType(0x0, {0x105898240, 0x0, 0x0}, {0x105898240, 0x0, 0x0}, 0x140070cb248, 0x14001c27170, 0x1)
 	/Users/adonovan/w/goroot/src/go/types/signature.go:57 +0x2f4
 golang.org/x/tools/gopls/internal/golang.RenderPackageDoc.func13(0x14006588f00)
 	/Users/adonovan/w/xtools/gopls/internal/golang/pkgdoc.go:493 +0x398
 golang.org/x/tools/gopls/internal/golang.RenderPackageDoc(0x14002367950, 0x14000135810, 0x14005b8e3f0)
 	/Users/adonovan/w/xtools/gopls/internal/golang/pkgdoc.go:534 +0xb74
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.func6({0x1051db0b0, 0x140019f4380}, 0x14005888480)
 	/Users/adonovan/w/xtools/gopls/internal/server/server.go:351 +0x2dc
 net/http.HandlerFunc.ServeHTTP(0x0?, {0x1051db0b0?, 0x140019f4380?}, 0x5?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.StripPrefix.func9({0x1051db0b0, 0x140019f4380}, 0x14005888360)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2226 +0x228
 net/http.HandlerFunc.ServeHTTP(0x14001db29a0?, {0x1051db0b0?, 0x140019f4380?}, 0x104cb14bc?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 net/http.(*ServeMux).ServeHTTP(0x0?, {0x1051db0b0, 0x140019f4380}, 0x14005888360)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2700 +0x1a4
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.StripPrefix.func7({0x1051db0b0, 0x140019f4380}, 0x14005888240)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2226 +0x228
 net/http.HandlerFunc.ServeHTTP(0x0?, {0x1051db0b0?, 0x140019f4380?}, 0x10?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.withPanicHandler.func8({0x1051db0b0?, 0x140019f4380?}, 0x14003340b48?)
 	/Users/adonovan/w/xtools/gopls/internal/server/server.go:412 +0x74
 net/http.HandlerFunc.ServeHTTP(0x14001db28c0?, {0x1051db0b0?, 0x140019f4380?}, 0x1046d0db4?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 net/http.(*ServeMux).ServeHTTP(0x0?, {0x1051db0b0, 0x140019f4380}, 0x14005888240)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2700 +0x1a4
 net/http.serverHandler.ServeHTTP({0x14005c96c00?}, {0x1051db0b0?, 0x140019f4380?}, 0x6?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:3154 +0xbc
 net/http.(*conn).serve(0x14000286a20, {0x1051dbd28, 0x14001e946c0})
 	/Users/adonovan/w/goroot/src/net/http/server.go:2042 +0x4fc
 created by net/http.(*Server).Serve in goroutine 3248
 	/Users/adonovan/w/goroot/src/net/http/server.go:3302 +0x3dc
 server.go:3430: http: panic serving 127.0.0.1:54609: got invalid type, want variadic parameter with unnamed slice type or string as core type
 goroutine 6888 [running]:
 net/http.(*conn).serve.func1()
 	/Users/adonovan/w/goroot/src/net/http/server.go:1898 +0xb0
 panic({0x10504bf60?, 0x1400857e530?})
 	/Users/adonovan/w/goroot/src/runtime/panic.go:759 +0x124
 go/types.NewSignatureType(0x0, {0x105898240, 0x0, 0x0}, {0x105898240, 0x0, 0x0}, 0x140030e31a0, 0x14001c27170, 0x1)
 	/Users/adonovan/w/goroot/src/go/types/signature.go:57 +0x2f4
 golang.org/x/tools/gopls/internal/golang.RenderPackageDoc.func13(0x14006588f00)
 	/Users/adonovan/w/xtools/gopls/internal/golang/pkgdoc.go:493 +0x398
 golang.org/x/tools/gopls/internal/golang.RenderPackageDoc(0x14002367950, 0x1400691b810, 0x14003ed0a50)
 	/Users/adonovan/w/xtools/gopls/internal/golang/pkgdoc.go:534 +0xb74
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.func6({0x1051db0b0, 0x14001db22a0}, 0x14002d32240)
 	/Users/adonovan/w/xtools/gopls/internal/server/server.go:351 +0x2dc
 net/http.HandlerFunc.ServeHTTP(0x0?, {0x1051db0b0?, 0x14001db22a0?}, 0x5?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.StripPrefix.func9({0x1051db0b0, 0x14001db22a0}, 0x14002d32120)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2226 +0x228
 net/http.HandlerFunc.ServeHTTP(0x14001db29a0?, {0x1051db0b0?, 0x14001db22a0?}, 0x104cb14bc?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 net/http.(*ServeMux).ServeHTTP(0x0?, {0x1051db0b0, 0x14001db22a0}, 0x14002d32120)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2700 +0x1a4
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.StripPrefix.func7({0x1051db0b0, 0x14001db22a0}, 0x14002d32000)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2226 +0x228
 net/http.HandlerFunc.ServeHTTP(0x0?, {0x1051db0b0?, 0x14001db22a0?}, 0x10?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.withPanicHandler.func8({0x1051db0b0?, 0x14001db22a0?}, 0x1400352cb48?)
 	/Users/adonovan/w/xtools/gopls/internal/server/server.go:412 +0x74
 net/http.HandlerFunc.ServeHTTP(0x14001db28c0?, {0x1051db0b0?, 0x14001db22a0?}, 0x1046d0db4?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 net/http.(*ServeMux).ServeHTTP(0x0?, {0x1051db0b0, 0x14001db22a0}, 0x14002d32000)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2700 +0x1a4
 net/http.serverHandler.ServeHTTP({0x14002076f60?}, {0x1051db0b0?, 0x14001db22a0?}, 0x6?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:3154 +0xbc
 net/http.(*conn).serve(0x14003930000, {0x1051dbd28, 0x14001e946c0})
 	/Users/adonovan/w/goroot/src/net/http/server.go:2042 +0x4fc
 created by net/http.(*Server).Serve in goroutine 3248
 	/Users/adonovan/w/goroot/src/net/http/server.go:3302 +0x3dc
 server.go:3430: http: panic serving 127.0.0.1:54622: got invalid type, want variadic parameter with unnamed slice type or string as core type
 goroutine 6949 [running]:
 net/http.(*conn).serve.func1()
 	/Users/adonovan/w/goroot/src/net/http/server.go:1898 +0xb0
 panic({0x10504bf60?, 0x14001a8bc90?})
 	/Users/adonovan/w/goroot/src/runtime/panic.go:759 +0x124
 go/types.NewSignatureType(0x0, {0x105898240, 0x0, 0x0}, {0x105898240, 0x0, 0x0}, 0x140030e2c90, 0x14001c27170, 0x1)
 	/Users/adonovan/w/goroot/src/go/types/signature.go:57 +0x2f4
 golang.org/x/tools/gopls/internal/golang.RenderPackageDoc.func13(0x14006588f00)
 	/Users/adonovan/w/xtools/gopls/internal/golang/pkgdoc.go:493 +0x398
 golang.org/x/tools/gopls/internal/golang.RenderPackageDoc(0x14002367950, 0x14000135810, 0x1400040b908)
 	/Users/adonovan/w/xtools/gopls/internal/golang/pkgdoc.go:534 +0xb74
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.func6({0x1051db0b0, 0x14001db22a0}, 0x14002d32240)
 	/Users/adonovan/w/xtools/gopls/internal/server/server.go:351 +0x2dc
 net/http.HandlerFunc.ServeHTTP(0x0?, {0x1051db0b0?, 0x14001db22a0?}, 0x5?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.StripPrefix.func9({0x1051db0b0, 0x14001db22a0}, 0x14002d32120)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2226 +0x228
 net/http.HandlerFunc.ServeHTTP(0x14001db29a0?, {0x1051db0b0?, 0x14001db22a0?}, 0x104cb14bc?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 net/http.(*ServeMux).ServeHTTP(0x0?, {0x1051db0b0, 0x14001db22a0}, 0x14002d32120)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2700 +0x1a4
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.StripPrefix.func7({0x1051db0b0, 0x14001db22a0}, 0x14002d32000)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2226 +0x228
 net/http.HandlerFunc.ServeHTTP(0x0?, {0x1051db0b0?, 0x14001db22a0?}, 0x10?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 golang.org/x/tools/gopls/internal/server.(*server).initWeb.withPanicHandler.func8({0x1051db0b0?, 0x14001db22a0?}, 0x14003340b48?)
 	/Users/adonovan/w/xtools/gopls/internal/server/server.go:412 +0x74
 net/http.HandlerFunc.ServeHTTP(0x14001db28c0?, {0x1051db0b0?, 0x14001db22a0?}, 0x1046d0db4?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2169 +0x38
 net/http.(*ServeMux).ServeHTTP(0x0?, {0x1051db0b0, 0x14001db22a0}, 0x14002d32000)
 	/Users/adonovan/w/goroot/src/net/http/server.go:2700 +0x1a4
 net/http.serverHandler.ServeHTTP({0x14000279c80?}, {0x1051db0b0?, 0x14001db22a0?}, 0x6?)
 	/Users/adonovan/w/goroot/src/net/http/server.go:3154 +0xbc
 net/http.(*conn).serve(0x14000286240, {0x1051dbd28, 0x14001e946c0})
 	/Users/adonovan/w/goroot/src/net/http/server.go:2042 +0x4fc
 created by net/http.(*Server).Serve in goroutine 3248
 	/Users/adonovan/w/goroot/src/net/http/server.go:3302 +0x3dc

Activity

self-assigned this
on May 10, 2024
added
ToolsThis label describes issues relating to any tools in the x/tools repository.
goplsIssues related to the Go language server, gopls.
on May 10, 2024
added this to the Unreleased milestone on May 10, 2024
adonovan

adonovan commented on May 10, 2024

@adonovan
MemberAuthor

The cause is that truncation of long parameter lists should remove the "variadic" flag (otherwise NewSignatureType will panic). Fix pending.

gopherbot

gopherbot commented on May 10, 2024

@gopherbot
Contributor

Change https://go.dev/cl/584405 mentions this issue: gopls/internal/golang: RenderPackageDoc: fix param truncation crash

gopherbot

gopherbot commented on May 10, 2024

@gopherbot
Contributor

Change https://go.dev/cl/584406 mentions this issue: gopls/internal/golang: fix another crash in RenderPackageDoc

added a commit that references this issue on May 10, 2024
4cfd180
locked and limited conversation to collaborators on May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @adonovan@gopherbot

      Issue actions

        x/tools/gopls: RenderPkgDoc crashes on go.starlark.net/starlark · Issue #67287 · golang/go