Comments (5)
Similar Issues
- x/tools/go/ssa: addNamedLocal panic: runtime error: invalid memory address or nil pointer dereference #58600
- x/tools/go/ssa: panic: cannot convert interface #62085
- x/tools/go/ssa: panic in ssa.(*Program).needMethods with type parameters #50078
- go/ssa: crash during SSA construction #9569
- x/tools/go/ssa: ssautil.Packages panics with the standard library #53604
- x/tools/go/ssa: panic: T #54274
- x/text/cmd/gotext: panic: interface conversion: types.Type is nil, not *types.Signature #51865
- x/tools/go/ssa: emitConv panic on generics #57272
- x/tools/go/ssa/ssautil: clarify that LoadAllSyntax is required, and provide better errors #28106
- x/tools/go/ssa: builder crash in map[*S]bool{{}: true} #13341
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
from go.
the loaded package is "google.golang.org/protobuf/reflect/protoreflect"
it starts with struct EnumValueDescriptor
from go.
The version of x/tools v0.11.0 (from the stack trace) is fairly out of date so you may want to try updating to see if this fixes the issue already.
I am not yet able to reproduce this with go1.20.5 (from the go env) with golang.org/x/tools v0.11.0
and google.golang.org/protobuf v1.34.2
. What version of google.golang.org/protobuf/reflect/protoreflect are you analyzing?
Here is what I am doing to try to reproduce this:
# mkdir and cd into it
% cat go.mod
module example.com/x
go 1.20
require (
golang.org/x/tools v0.11.0
google.golang.org/protobuf v1.34.2
)
require (
golang.org/x/mod v0.12.0 // indirect
golang.org/x/sys v0.10.0 // indirect
)
% cat m.go
package main
import (
"log"
"golang.org/x/tools/go/packages"
"golang.org/x/tools/go/ssa"
"golang.org/x/tools/go/ssa/ssautil"
_ "google.golang.org/protobuf/reflect/protoreflect"
)
func main() {
fp := "."
cfg := &packages.Config{
Mode: packages.NeedSyntax | packages.NeedTypesInfo |
packages.NeedTypesSizes | packages.NeedTypes | packages.NeedImports |
packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles,
Dir: fp,
}
ps, err := packages.Load(cfg, "google.golang.org/protobuf/reflect/protoreflect")
if err != nil {
log.Fatal(err)
return
}
if en := packages.PrintErrors(ps); en > 0 {
for _, tp := range ps {
for _, e := range tp.Errors {
err = e
break
}
if err != nil {
log.Fatal(err)
break
}
}
return
}
prog, sps := ssautil.AllPackages(ps, ssa.InstantiateGenerics)
// p.ssaFs = prog.Fset
needAst := true /*conf.needAst*/
if needAst {
for _, sp := range sps {
sp.SetDebugMode(true)
}
}
prog.Build()
for _, pkg := range sps {
for k, m := range pkg.Members {
log.Println(pkg.String(), k, ":", m.String())
}
}
}
% go1.20.5 build
% ./x # Prints many many members so it is loading and building.
Can you give more details for how to reproduce the crash?
from go.
The version of x/tools v0.11.0 (from the stack trace) is fairly out of date so you may want to try updating to see if this fixes the issue already.
I am not yet able to reproduce this with go1.20.5 (from the go env) with
golang.org/x/tools v0.11.0
andgoogle.golang.org/protobuf v1.34.2
. What version of google.golang.org/protobuf/reflect/protoreflect are you analyzing?Here is what I am doing to try to reproduce this:
# mkdir and cd into it % cat go.mod module example.com/x go 1.20 require ( golang.org/x/tools v0.11.0 google.golang.org/protobuf v1.34.2 ) require ( golang.org/x/mod v0.12.0 // indirect golang.org/x/sys v0.10.0 // indirect ) % cat m.go package main import ( "log" "golang.org/x/tools/go/packages" "golang.org/x/tools/go/ssa" "golang.org/x/tools/go/ssa/ssautil" _ "google.golang.org/protobuf/reflect/protoreflect" ) func main() { fp := "." cfg := &packages.Config{ Mode: packages.NeedSyntax | packages.NeedTypesInfo | packages.NeedTypesSizes | packages.NeedTypes | packages.NeedImports | packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles, Dir: fp, } ps, err := packages.Load(cfg, "google.golang.org/protobuf/reflect/protoreflect") if err != nil { log.Fatal(err) return } if en := packages.PrintErrors(ps); en > 0 { for _, tp := range ps { for _, e := range tp.Errors { err = e break } if err != nil { log.Fatal(err) break } } return } prog, sps := ssautil.AllPackages(ps, ssa.InstantiateGenerics) // p.ssaFs = prog.Fset needAst := true /*conf.needAst*/ if needAst { for _, sp := range sps { sp.SetDebugMode(true) } } prog.Build() for _, pkg := range sps { for k, m := range pkg.Members { log.Println(pkg.String(), k, ":", m.String()) } } } % go1.20.5 build % ./x # Prints many many members so it is loading and building.
Can you give more details for how to reproduce the crash?
thanks for replying. the problem was solved after I updated x/tools to version v0.22.0
I can't neither reproduce this problem with your code, sorry that I can't provide you with the loaded repo, it's a company property.
thanks again.
from go.
solved by updating x/gools to the latest version
from go.
Related Issues (20)
- cmd/compile: generics cannot infer slice/array of slice/array types HOT 3
- time: time zone parsing when format includes time zone seconds fails HOT 4
- cmd/compile: global variable assignment implicit type conversion error HOT 5
- x/pkgsite: standard lib symbol available version does not have same behavior across packages HOT 2
- x/pkgsite: show version when global variables and constants are added HOT 1
- bufio: NewScanner(file).Scan() not setting error when file is already closed HOT 4
- regexp: Invalid character class on Windows ARM HOT 16
- How to close "go version -m" ? HOT 1
- warning: go env -w GOPROXY=... does not override conflicting OS environment variable HOT 2
- build: golang.org/x/telemetry/internal/configgen failures HOT 2
- proposal: math: fixed decimal types HOT 5
- internal/poll: deadlock when SetReadDeadline and Read race (on net.UnixConn) HOT 4
- runtime: poor error message for Goexit on C-created thread HOT 2
- x/build/cmd/relui: consider failing to add a reviewer a soft failure HOT 1
- cmd/trace, x/exp/trace: nondeterministic output, seems related to timestamp tie-breaking HOT 10
- runtime: use getrandom(2) for readRandom HOT 11
- proposal: fmt: add iterator for format tokens HOT 37
- Go Packages issues are not resolving in RHEL 9.4 HOT 1
- regexp: wrong match HOT 4
- Provide download for checksum of go releases. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go.