amit-davidson / Chronos

Chronos - A static race detector for the go language
MIT License
424 stars 11 forks source link

Internal panic in pointer analysis #13

Open howardjohn opened 3 years ago

howardjohn commented 3 years ago
$ chronos --file ./pilot/cmd/pilot-agent/main.go
Internal panic in pointer analysis:
goroutine 1 [running]:
runtime/debug.Stack(0x24, 0x0, 0x0)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x9d
runtime/debug.PrintStack()
        /usr/local/go/src/runtime/debug/stack.go:16 +0x22
golang.org/x/tools/go/pointer.Analyze.func1(0xc03e10fad0)
        /usr/local/google/home/howardjohn/go/pkg/mod/golang.org/x/tools@v0.0.0-20201017001424-6003fad69a88/go/pointer/analysis.go:227 +0x10b
panic(0x8b8b20, 0xc0b6a0a760)
        /usr/local/go/src/runtime/panic.go:967 +0x15d
golang.org/x/tools/go/pointer.(*analysis).taggedValue(0xc07a85d6c0, 0xc0000984b7, 0x2, 0x64, 0xc0338c5880)
        /usr/local/google/home/howardjohn/go/pkg/mod/golang.org/x/tools@v0.0.0-20201017001424-6003fad69a88/go/pointer/gen.go:272 +0x102
golang.org/x/tools/go/pointer.(*invokeConstraint).solve(0xc0bb920750, 0xc07a85d6c0, 0xc070062140)
        /usr/local/google/home/howardjohn/go/pkg/mod/golang.org/x/tools@v0.0.0-20201017001424-6003fad69a88/go/pointer/solve.go:317 +0x24c
golang.org/x/tools/go/pointer.(*analysis).solveConstraints(0xc07a85d6c0, 0xc0aea87170, 0xc070062140)
        /usr/local/google/home/howardjohn/go/pkg/mod/golang.org/x/tools@v0.0.0-20201017001424-6003fad69a88/go/pointer/solve.go:165 +0x171
golang.org/x/tools/go/pointer.(*analysis).solve(0xc07a85d6c0)
        /usr/local/google/home/howardjohn/go/pkg/mod/golang.org/x/tools@v0.0.0-20201017001424-6003fad69a88/go/pointer/solve.go:59 +0x1a2
golang.org/x/tools/go/pointer.Analyze(0xc040099180, 0x0, 0xa290a0, 0xc0b6a0a7b0)
        /usr/local/google/home/howardjohn/go/pkg/mod/golang.org/x/tools@v0.0.0-20201017001424-6003fad69a88/go/pointer/analysis.go:331 +0x4a5
github.com/amit-davidson/Chronos/pointerAnalysis.Analysis(0xc05177de00, 0xc0102010e0, 0xc0462aae00, 0x7, 0x8, 0x0, 0x7c)
        /usr/local/google/home/howardjohn/go/pkg/mod/github.com/amit-davidson/!chronos@v0.0.0-20201018190309-37a9373183e0/pointerAnalysis/PointerAnalysis.go:51 +0x36a
main.main()
        /usr/local/google/home/howardjohn/go/pkg/mod/github.com/amit-davidson/!chronos@v0.0.0-20201018190309-37a9373183e0/cmd/chronos/main.go:35 +0x468
Error in analysis:internal error in pointer analysis: not a tagged object: n623799 (please report this bug)

Codebase is run against https://github.com/istio/istio

amit-davidson commented 3 years ago

@howardjohn I'll take a look at this. In general, this is a bug in x/tools/go/pointer. Seems related to this: https://github.com/golang/go/issues/25090

ro-tex commented 3 years ago

I'm experiencing the same thing, if that helps:

inovakov Sia [ivo/gc_backups_dir]% chronos --file cmd/siad/main.go 
Internal panic in pointer analysis:
goroutine 1 [running]:
runtime/debug.Stack(0x24, 0x0, 0x0)
        /usr/local/Cellar/go/1.15.3/libexec/src/runtime/debug/stack.go:24 +0x9f
runtime/debug.PrintStack()
        /usr/local/Cellar/go/1.15.3/libexec/src/runtime/debug/stack.go:16 +0x25
golang.org/x/tools/go/pointer.Analyze.func1(0xc05b607b00)
        /Users/inovakov/go/pkg/mod/golang.org/x/tools@v0.0.0-20201020161133-226fd2f889ca/go/pointer/analysis.go:227 +0x10b
panic(0x13502e0, 0xc03aff2380)
        /usr/local/Cellar/go/1.15.3/libexec/src/runtime/panic.go:969 +0x1b9
golang.org/x/tools/go/pointer.(*analysis).taggedValue(0xc042b7d340, 0xc00002acfd, 0x2, 0x64, 0xc00d7a8000)
        /Users/inovakov/go/pkg/mod/golang.org/x/tools@v0.0.0-20201020161133-226fd2f889ca/go/pointer/gen.go:272 +0x105
golang.org/x/tools/go/pointer.(*invokeConstraint).solve(0xc0499eb780, 0xc042b7d340, 0xc082a8e400)
        /Users/inovakov/go/pkg/mod/golang.org/x/tools@v0.0.0-20201020161133-226fd2f889ca/go/pointer/solve.go:317 +0x24e
golang.org/x/tools/go/pointer.(*analysis).solveConstraints(0xc042b7d340, 0xc049a7f620, 0xc082a8e400)
        /Users/inovakov/go/pkg/mod/golang.org/x/tools@v0.0.0-20201020161133-226fd2f889ca/go/pointer/solve.go:165 +0x178
golang.org/x/tools/go/pointer.(*analysis).solve(0xc042b7d340)
        /Users/inovakov/go/pkg/mod/golang.org/x/tools@v0.0.0-20201020161133-226fd2f889ca/go/pointer/solve.go:59 +0x1ad
golang.org/x/tools/go/pointer.Analyze(0xc042efc690, 0x0, 0x1437dc0, 0xc03aff2390)
        /Users/inovakov/go/pkg/mod/golang.org/x/tools@v0.0.0-20201020161133-226fd2f889ca/go/pointer/analysis.go:331 +0x4bc
github.com/amit-davidson/Chronos/pointerAnalysis.Analysis(0xc02ebbdb00, 0xc02e1361e0, 0xc042cd6f00, 0x5c, 0x60, 0x0, 0x7c)
        /Users/inovakov/go/pkg/mod/github.com/amit-davidson/!chronos@v0.0.0-20201025214407-28ddac508b7d/pointerAnalysis/PointerAnalysis.go:51 +0x38a
main.main()
        /Users/inovakov/go/pkg/mod/github.com/amit-davidson/!chronos@v0.0.0-20201025214407-28ddac508b7d/cmd/chronos/main.go:35 +0x473
Error in analysis:internal error in pointer analysis: not a tagged object: n175357 (please report this bug)

This happened when run on this project/branch: https://gitlab.com/NebulousLabs/Sia/-/tree/ivo/gc_backups_dir, SHA de052028f69143e11aa9da17cebdb771946b5753.

amit-davidson commented 3 years ago

@ro-tex Thanks. I'm working on the next version of Chronos so I'll also try to look at this and see if I can find why it failed and maybe push a fix.

Jacalz commented 3 years ago

I ran into the same issue when trying to check my project, called wormhole-gui. The reported panic is not exactly the same, so I figured I would share it here as well in case it can be helpful for finding out the issue. The commend that I ran was the following:

~/go/src/github.com/Jacalz/wormhole-gui $ ~/go/bin/chronos -file=main.go -mod=/home/jacob/go/src/github.com/Jacalz/wormhole-gui

The result was:

Internal panic in pointer analysis:
goroutine 1 [running]:
runtime/debug.Stack(0x24, 0x0, 0x0)
        /usr/lib64/golang/src/runtime/debug/stack.go:24 +0x9f
runtime/debug.PrintStack()
        /usr/lib64/golang/src/runtime/debug/stack.go:16 +0x25
golang.org/x/tools/go/pointer.Analyze.func1(0xc04e871a78)
        /home/jacob/go/src/golang.org/x/tools/go/pointer/analysis.go:227 +0x10b
panic(0x72ea20, 0x807700)
        /usr/lib64/golang/src/runtime/panic.go:969 +0x1b9
golang.org/x/tools/go/pointer.(*analysis).enclosingObj(0xc035d05dc0, 0x7fb200060e85, 0x7fb200018e42)
        /home/jacob/go/src/golang.org/x/tools/go/pointer/analysis.go:158 +0x85
golang.org/x/tools/go/pointer.(*hvn).markIndirectNodes(0xc02d1fa700)
        /home/jacob/go/src/golang.org/x/tools/go/pointer/hvn.go:486 +0x32f
golang.org/x/tools/go/pointer.(*analysis).hvn(0xc035d05dc0)
        /home/jacob/go/src/golang.org/x/tools/go/pointer/hvn.go:281 +0x2c8
golang.org/x/tools/go/pointer.Analyze(0xc00ca13d60, 0x0, 0x80ec40, 0xc026816750)
        /home/jacob/go/src/golang.org/x/tools/go/pointer/analysis.go:323 +0x4ab
github.com/amit-davidson/Chronos/pointerAnalysis.Analysis(0xc0354c1aa0, 0xc0240b6000, 0x206, 0x260, 0x0, 0xc0354c1aa0, 0x0, 0x0, 0xc00018ed10)
        /home/jacob/go/src/github.com/amit-davidson/Chronos/pointerAnalysis/PointerAnalysis.go:44 +0x387
main.main()
        /home/jacob/go/src/github.com/amit-davidson/Chronos/cmd/chronos/main.go:45 +0x59c
Error in analysis:internal error in pointer analysis: node has no enclosing object (please report this bug)
b0b0haha commented 1 year ago

I run into the same problem. Have you solved the problem?

I ran into the same issue when trying to check my project, called wormhole-gui. The reported panic is not exactly the same, so I figured I would share it here as well in case it can be helpful for finding out the issue. The commend that I ran was the following:

~/go/src/github.com/Jacalz/wormhole-gui $ ~/go/bin/chronos -file=main.go -mod=/home/jacob/go/src/github.com/Jacalz/wormhole-gui

The result was:

Internal panic in pointer analysis:
goroutine 1 [running]:
runtime/debug.Stack(0x24, 0x0, 0x0)
        /usr/lib64/golang/src/runtime/debug/stack.go:24 +0x9f
runtime/debug.PrintStack()
        /usr/lib64/golang/src/runtime/debug/stack.go:16 +0x25
golang.org/x/tools/go/pointer.Analyze.func1(0xc04e871a78)
        /home/jacob/go/src/golang.org/x/tools/go/pointer/analysis.go:227 +0x10b
panic(0x72ea20, 0x807700)
        /usr/lib64/golang/src/runtime/panic.go:969 +0x1b9
golang.org/x/tools/go/pointer.(*analysis).enclosingObj(0xc035d05dc0, 0x7fb200060e85, 0x7fb200018e42)
        /home/jacob/go/src/golang.org/x/tools/go/pointer/analysis.go:158 +0x85
golang.org/x/tools/go/pointer.(*hvn).markIndirectNodes(0xc02d1fa700)
        /home/jacob/go/src/golang.org/x/tools/go/pointer/hvn.go:486 +0x32f
golang.org/x/tools/go/pointer.(*analysis).hvn(0xc035d05dc0)
        /home/jacob/go/src/golang.org/x/tools/go/pointer/hvn.go:281 +0x2c8
golang.org/x/tools/go/pointer.Analyze(0xc00ca13d60, 0x0, 0x80ec40, 0xc026816750)
        /home/jacob/go/src/golang.org/x/tools/go/pointer/analysis.go:323 +0x4ab
github.com/amit-davidson/Chronos/pointerAnalysis.Analysis(0xc0354c1aa0, 0xc0240b6000, 0x206, 0x260, 0x0, 0xc0354c1aa0, 0x0, 0x0, 0xc00018ed10)
        /home/jacob/go/src/github.com/amit-davidson/Chronos/pointerAnalysis/PointerAnalysis.go:44 +0x387
main.main()
        /home/jacob/go/src/github.com/amit-davidson/Chronos/cmd/chronos/main.go:45 +0x59c
Error in analysis:internal error in pointer analysis: node has no enclosing object (please report this bug)
Jacalz commented 1 year ago

My message was four years ago. I've moved on and just use the regular race detector now.