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

Several panics when testing broken files #1393

Closed
qarmin opened this issue Apr 8, 2023 · 3 comments
Closed

Several panics when testing broken files #1393

qarmin opened this issue Apr 8, 2023 · 3 comments
Labels

Comments

@qarmin
Copy link

qarmin commented Apr 8, 2023

Staticheck -version - https://github.com/dominikh/go-tools/releases/tag/2023.1.3

[ch](panic: interface conversion: ast.Expr is *ast.ParenExpr, not *ast.UnaryExpr)
fatal error: runtime: out of memory
<unknown line number>: internal compiler error: panic: runtime error: invalid memory address or nil pointer dereference

command(probably all available rules - is there any easier way to enable all?)

staticcheck -checks S1000,S1001,S1002,S1003,S1004,S1005,S1006,S1007,S1008,S1009,S1010,S1011,S1012,S1016,S1017,S1018,S1019,S1020,S1021,S1023,S1024,S1025,S1028,S1029,S1030,S1031,S1032,S1033,S1034,S1035,S1036,S1037,S1038,S1039,S1040,SA1000,SA1001,SA1002,SA1003,SA1004,SA1005,SA1006,SA1007,SA1008,SA1010,SA1011,SA1012,SA1013,SA1014,SA1015,SA1016,SA1017,SA1018,SA1019,SA1020,SA1021,SA1023,SA1024,SA1025,SA1026,SA1027,SA1028,SA1029,SA1030,SA2000,SA2001,SA2002,SA2003,SA3000,SA3001,SA4000,SA4001,SA4003,SA4004,SA4005,SA4006,SA4008,SA4009,SA4010,SA4011,SA4012,SA4013,SA4014,SA4015,SA4016,SA4017,SA4018,SA4019,SA4020,SA4021,SA4022,SA4023,SA4024,SA4025,SA4026,SA4027,SA4028,SA4029,SA4030,SA4031,SA5000,SA5001,SA5002,SA5003,SA5004,SA5005,SA5007,SA5008,SA5009,SA5010,SA5011,SA5012,SA6000,SA6001,SA6002,SA6003,SA6005,SA9001,SA9002,SA9003,SA9004,SA9005,SA9006,SA9007,SA9008,ST1000,ST1001,ST1003,ST1005,ST1006,ST1008,ST1011,ST1012,ST1013,ST1015,ST1016,ST1017,ST1018,ST1019,ST1020,ST1021,ST1022,ST1023,U1000 gofile.go

10 problematic files - Broken_10.zip

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/rafal/.cache/go-build"
GOENV="/home/rafal/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/rafal/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/rafal/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.3"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1105168592=/tmp/go-build -gno-record-gcc-switches"
@qarmin qarmin added bug needs-triage Newly filed issue that needs triage labels Apr 8, 2023
@dominikh
Copy link
Owner

dominikh commented Apr 8, 2023

command(probably all available rules - is there any easier way to enable all?)

Yes, by using all.

@dominikh dominikh removed the needs-triage Newly filed issue that needs triage label Apr 8, 2023
@dominikh
Copy link
Owner

dominikh commented Apr 8, 2023

static03401.go and static06849.go are bugs in the Go compiler, not Staticcheck. I recommend you file those upstream.

I'm working on fixes for the other inputs. Thanks.

@dominikh
Copy link
Owner

dominikh commented Apr 8, 2023

  • issue2378104923.go, issue237810735.go, issue2378107379.go are identical
  • issue2378104923.go, issue2378105181.go, issue2378105344.go, issue2378107748.go are identical except for whitespace and comments.
  • issue2092301277.go, issue2092304312.go are identical except for whitespace.

In total there are two unique test cases, issue2092301277.go and issue2378104923.go.

dominikh added a commit that referenced this issue Apr 8, 2023
dominikh added a commit that referenced this issue Apr 8, 2023
Don't blow up memory usage trying to create a CompositeValue for
[]int{1<<31: 1}.

Updates: gh-1393
@dominikh dominikh closed this as completed Apr 8, 2023
dominikh added a commit that referenced this issue Aug 17, 2023
Updates: gh-1393
(cherry picked from commit a897bf7)
dominikh added a commit that referenced this issue Aug 17, 2023
Don't blow up memory usage trying to create a CompositeValue for
[]int{1<<31: 1}.

Updates: gh-1393
(cherry picked from commit 90a075d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants