polyfloyd / go-errorlint

A source code linter that can be used to find code that will cause problems with Go's error wrapping scheme
MIT License
249 stars 19 forks source link

fatal error: stack overflow #19

Closed acim closed 2 years ago

acim commented 2 years ago

` ❯ go-errorlint ./... runtime: goroutine stack exceeds 1000000000-byte limit runtime: sp=0xc023704358 stack=[0xc023704000, 0xc043704000] fatal error: stack overflow

runtime stack: runtime.throw({0x6c608e, 0x88d4c0}) /usr/local/go/src/runtime/panic.go:1198 +0x71 runtime.newstack() /usr/local/go/src/runtime/stack.go:1088 +0x5ac runtime.morestack() /usr/local/go/src/runtime/asm_amd64.s:461 +0x8b

goroutine 3117 [running]: runtime.heapBitsSetType(0xc0076d0bd8, 0x8, 0x8, 0x6960c0) /usr/local/go/src/runtime/mbitmap.go:822 +0xbcc fp=0xc023704368 sp=0xc023704360 pc=0x4152ec runtime.mallocgc(0x8, 0x6960c0, 0x1) /usr/local/go/src/runtime/malloc.go:1106 +0x65e fp=0xc0237043e8 sp=0xc023704368 pc=0x40ca7e runtime.growslice(0x6960c0, {0xc023704490, 0xc001302be0, 0x20}, 0x20) /usr/local/go/src/runtime/slice.go:267 +0x4ea fp=0xc023704450 sp=0xc0237043e8 pc=0x44b04a github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:141 +0x154 fp=0xc023704548 sp=0xc023704450 pc=0x654774 github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023704640 sp=0xc023704548 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023704738 sp=0xc023704640 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023704830 sp=0xc023704738 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023704928 sp=0xc023704830 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023704a20 sp=0xc023704928 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023704b18 sp=0xc023704a20 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023704c10 sp=0xc023704b18 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023704d08 sp=0xc023704c10 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023704e00 sp=0xc023704d08 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023704ef8 sp=0xc023704e00 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023704ff0 sp=0xc023704ef8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237050e8 sp=0xc023704ff0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237051e0 sp=0xc0237050e8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237052d8 sp=0xc0237051e0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237053d0 sp=0xc0237052d8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237054c8 sp=0xc0237053d0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237055c0 sp=0xc0237054c8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237056b8 sp=0xc0237055c0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237057b0 sp=0xc0237056b8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237058a8 sp=0xc0237057b0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237059a0 sp=0xc0237058a8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023705a98 sp=0xc0237059a0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023705b90 sp=0xc023705a98 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023705c88 sp=0xc023705b90 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023705d80 sp=0xc023705c88 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023705e78 sp=0xc023705d80 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023705f70 sp=0xc023705e78 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706068 sp=0xc023705f70 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706160 sp=0xc023706068 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706258 sp=0xc023706160 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706350 sp=0xc023706258 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706448 sp=0xc023706350 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706540 sp=0xc023706448 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706638 sp=0xc023706540 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706730 sp=0xc023706638 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706828 sp=0xc023706730 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706920 sp=0xc023706828 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706a18 sp=0xc023706920 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706b10 sp=0xc023706a18 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706c08 sp=0xc023706b10 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706d00 sp=0xc023706c08 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706df8 sp=0xc023706d00 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706ef0 sp=0xc023706df8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023706fe8 sp=0xc023706ef0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237070e0 sp=0xc023706fe8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237071d8 sp=0xc0237070e0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237072d0 sp=0xc0237071d8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237073c8 sp=0xc0237072d0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237074c0 sp=0xc0237073c8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237075b8 sp=0xc0237074c0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237076b0 sp=0xc0237075b8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237077a8 sp=0xc0237076b0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237078a0 sp=0xc0237077a8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023707998 sp=0xc0237078a0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023707a90 sp=0xc023707998 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023707b88 sp=0xc023707a90 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023707c80 sp=0xc023707b88 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023707d78 sp=0xc023707c80 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023707e70 sp=0xc023707d78 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023707f68 sp=0xc023707e70 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708060 sp=0xc023707f68 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708158 sp=0xc023708060 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708250 sp=0xc023708158 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708348 sp=0xc023708250 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708440 sp=0xc023708348 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708538 sp=0xc023708440 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708630 sp=0xc023708538 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708728 sp=0xc023708630 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708820 sp=0xc023708728 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708918 sp=0xc023708820 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708a10 sp=0xc023708918 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708b08 sp=0xc023708a10 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708c00 sp=0xc023708b08 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708cf8 sp=0xc023708c00 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708df0 sp=0xc023708cf8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708ee8 sp=0xc023708df0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023708fe0 sp=0xc023708ee8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237090d8 sp=0xc023708fe0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237091d0 sp=0xc0237090d8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237092c8 sp=0xc0237091d0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237093c0 sp=0xc0237092c8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237094b8 sp=0xc0237093c0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237095b0 sp=0xc0237094b8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237096a8 sp=0xc0237095b0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc0237097a0 sp=0xc0237096a8 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023709898 sp=0xc0237097a0 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023709990 sp=0xc023709898 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023709a88 sp=0xc023709990 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023709b80 sp=0xc023709a88 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023709c78 sp=0xc023709b80 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023709d70 sp=0xc023709c78 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023709e68 sp=0xc023709d70 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc023709f60 sp=0xc023709e68 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc02370a058 sp=0xc023709f60 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302a40) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc02370a150 sp=0xc02370a058 pc=0x65497d github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0xc000aec6c0, 0xc001302be0) /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x35d fp=0xc02370a248 sp=0xc02370a150 pc=0x65497d ...additional frames elided... created by golang.org/x/tools/go/analysis/internal/checker.execAll /home/acim/go/pkg/mod/golang.org/x/tools@v0.0.0-20191029190741-b9c20aec41a5/go/analysis/internal/checker/checker.go:559 +0x168

goroutine 1 [semacquire]: sync.runtime_Semacquire(0x0) /usr/local/go/src/runtime/sema.go:56 +0x25 sync.(*WaitGroup).Wait(0x0) /usr/local/go/src/sync/waitgroup.go:130 +0x71 golang.org/x/tools/go/analysis/internal/checker.execAll({0xc002fa8280, 0xd, 0xc002b79576}) /home/acim/go/pkg/mod/golang.org/x/tools@v0.0.0-20191029190741-b9c20aec41a5/go/analysis/internal/checker/checker.go:562 +0x172 golang.org/x/tools/go/analysis/internal/checker.analyze({0xc0000cbf80, 0xd, 0x1}, {0xc0000b4568, 0x1, 0x6c3122}) /home/acim/go/pkg/mod/golang.org/x/tools@v0.0.0-20191029190741-b9c20aec41a5/go/analysis/internal/checker/checker.go:258 +0x1bf golang.org/x/tools/go/analysis/internal/checker.Run({0xc0000ba010, 0x1, 0x1}, {0xc0000b4568, 0x1, 0x1}) /home/acim/go/pkg/mod/golang.org/x/tools@v0.0.0-20191029190741-b9c20aec41a5/go/analysis/internal/checker/checker.go:133 +0x777 golang.org/x/tools/go/analysis/singlechecker.Main(0xc0000f05b0) /home/acim/go/pkg/mod/golang.org/x/tools@v0.0.0-20191029190741-b9c20aec41a5/go/analysis/singlechecker/singlechecker.go:76 +0x22c main.main() /home/acim/go/pkg/mod/github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/main.go:10 +0xa7 `

polyfloyd commented 2 years ago

Yeah, that does not seem to be intended behaviour. Thanks for reporting :)

Could you provide a source file that triggers this? Thanks!

acim commented 2 years ago

I just figured out that it fails on archive/zip. Some time ago there was a bug in archive/zip related to big files (over 4GB if I remember correctly) and we made a fork of this package in our repository and made fixes. You can reproduce this by cloning Go repository git clone git@github.com:golang/go.git, cd src and go-errorlint archive/zip. It's obvious that Go team do not use linters, but that's not the reason to crash.

lwaddicor commented 2 years ago

I'm seeing the exact same thing building as well. The repo it is doing it on is very large and has lots of dependencies so i'm not sure exactly what is causing it. But just to let you know it does seem to be happening

Darwin, ARM64

./golangci-lint run -n ./...
runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0x1405a92a3b0 stack=[0x1405a92a000, 0x1407a92a000]
fatal error: stack overflow

runtime stack:
runtime.throw({0x101a1772f, 0xe})
        runtime/panic.go:1198 +0x54
runtime.newstack()
        runtime/stack.go:1088 +0x56c
runtime.morestack()
        runtime/asm_arm64.s:303 +0x70

goroutine 57114 [running]:
runtime.heapBitsSetType(0x14099aacdb0, 0x8, 0x8, 0x101cf05a0)
        runtime/mbitmap.go:822 +0xa00 fp=0x1405a92a3b0 sp=0x1405a92a3b0 pc=0x100f82940
runtime.mallocgc(0x8, 0x101cf05a0, 0x1)
        runtime/malloc.go:1106 +0x654 fp=0x1405a92a440 sp=0x1405a92a3b0 pc=0x100f79ed4
runtime.growslice(0x101cf05a0, {0x1405a92a4f0, 0x0, 0x0}, 0x1)
        runtime/slice.go:267 +0x43c fp=0x1405a92a4a0 sp=0x1405a92a440 pc=0x100fbdb6c
github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0x14015c71b60, 0x1400ab1e9c0)
        github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:141 +0x168 fp=0x1405a92a5a0 sp=0x1405a92a4a0 pc=0x1015a8048
github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0x14015c71b60, 0x1400ab1f000)
        github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x36c fp=0x1405a92a6a0 sp=0x1405a92a5a0 pc=0x1015a824c
github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0x14015c71b60, 0x1400ab1e9c0)
        github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x36c fp=0x1405a92a7a0 sp=0x1405a92a6a0 pc=0x1015a824c
github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0x14015c71b60, 0x1400ab1f000)
        github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x36c fp=0x1405a92a8a0 sp=0x1405a92a7a0 pc=0x1015a824c
github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0x14015c71b60, 0x1400ab1e9c0)
        github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x36c fp=0x1405a92a9a0 sp=0x1405a92a8a0 pc=0x1015a824c
github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0x14015c71b60, 0x1400ab1f000)
        github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x36c fp=0x1405a92aaa0 sp=0x1405a92a9a0 pc=0x1015a824c
github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0x14015c71b60, 0x1400ab1e9c0)
        github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x36c fp=0x1405a92aba0 sp=0x1405a92aaa0 pc=0x1015a824c
github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0x14015c71b60, 0x1400ab1f000)
        github.com/polyfloyd/go-errorlint@v0.0.0-20211125173453-6d6d39c5bb8b/errorlint/allowed.go:172 +0x36c fp=0x1405a92aca0 sp=0x1405a92aba0 pc=0x1015a824c
github.com/polyfloyd/go-errorlint/errorlint.assigningCallExprs(0x14015c71b60, 0x1400ab1e9c0)
...
polyfloyd commented 2 years ago

Ah yes, I have been able to confirm this in archive/zip. Not yet been able to isolate what exactly is causing this...

egonelbre commented 2 years ago

Here's a small repro based on archive/zip:

var errChecksum = errors.New("errors checksum")

type checksumReader struct {
    err   error
    rc    io.ReadCloser
    hash  uint32
}

func (r *checksumReader) Read(b []byte) (n int, err error) {
    n, err = r.rc.Read(b)
    if err == nil {
        return
    }
    if r.hash != 123 {
        err = errChecksum
    }
    if r.hash != 123 {
        err = errChecksum
    }
    r.err = err
    return
}
egonelbre commented 2 years ago

I have no good understanding of what the code is doing, however, one fix would be to use a map to avoid infinite recursion in assigningCallExprs:

diff --git a/errorlint/allowed.go b/errorlint/allowed.go
index cb8fc64..823b111 100644
--- a/errorlint/allowed.go
+++ b/errorlint/allowed.go
@@ -3,6 +3,7 @@ package errorlint
 import (
        "fmt"
        "go/ast"
+       "go/token"
 )

 var allowedErrors = []struct {
@@ -87,7 +88,7 @@ func isAllowedErrorComparison(info *TypesInfoExt, binExpr *ast.BinaryExpr) bool
                case *ast.Ident:
                        // Identifier, most likely to be the `err` variable or whatever
                        // produces it.
-                       callExprs = assigningCallExprs(info, t)
+                       callExprs = assigningCallExprs(info, t, map[token.Pos]struct{}{})
                case *ast.CallExpr:
                        callExprs = append(callExprs, t)
                }
@@ -126,25 +127,24 @@ func isAllowedErrorComparison(info *TypesInfoExt, binExpr *ast.BinaryExpr) bool

 // assigningCallExprs finds all *ast.CallExpr nodes that are part of an
 // *ast.AssignStmt that assign to the subject identifier.
-func assigningCallExprs(info *TypesInfoExt, subject *ast.Ident) []*ast.CallExpr {
+func assigningCallExprs(info *TypesInfoExt, subject *ast.Ident, visited map[token.Pos]struct{}) []*ast.CallExpr {
        if subject.Obj == nil {
                return nil
        }

-       // Find other identifiers that reference this same object. Make sure to
-       // exclude the subject identifier as it will cause an infinite recursion
-       // and is being used in a read operation anyway.
+       visited[subject.Pos()] = struct{}{}
+
        sobj := info.ObjectOf(subject)
-       identifiers := []*ast.Ident{}
-       for _, ident := range info.IdentifiersForObject[sobj] {
-               if subject.Pos() != ident.Pos() {
-                       identifiers = append(identifiers, ident)
-               }
-       }
+       identifiers := info.IdentifiersForObject[sobj]

        // Find out whether the identifiers are part of an assignment statement.
        var callExprs []*ast.CallExpr
        for _, ident := range identifiers {
+               // avoid infinite recursion
+               if _, ok := visited[ident.Pos()]; ok {
+                       continue
+               }
+
                parent := info.NodeParent[ident]
                switch declT := parent.(type) {
                case *ast.AssignStmt:
@@ -169,7 +169,7 @@ func assigningCallExprs(info *TypesInfoExt, subject *ast.Ident) []*ast.CallExpr
                                callExprs = append(callExprs, assignT)
                        case *ast.Ident:
                                // The subject was the result of assigning from another identifier.
-                               callExprs = append(callExprs, assigningCallExprs(info, assignT)...)
+                               callExprs = append(callExprs, assigningCallExprs(info, assignT, visited)...)
                        default:
                                // TODO: inconclusive?
                        }

There might be a way to avoid creating the map -- not sure how much it'll affect the performance.

polyfloyd commented 2 years ago

@egonelbre Thanks for your isolated repro snippet, I was able to resolve the issue with it :)