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

panic: runtime error: invalid memory address or nil pointer dereference [recovered] #195

Open
cpellet opened this issue Oct 2, 2024 · 2 comments

Comments

@cpellet
Copy link

cpellet commented Oct 2, 2024

Running the program gives
`panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x62178f]

goroutine 84 [running]:
go/types.(*Checker).handleBailout(0xc000b1e1c0, 0xc000b29bf0)
/home/cyrus/sdk/go1.23.1/src/go/types/check.go:404 +0x88
panic({0xad0d40?, 0x1006d80?})
/home/cyrus/sdk/go1.23.1/src/runtime/panic.go:785 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0xc55880, 0x100dc80})
/home/cyrus/sdk/go1.23.1/src/go/types/sizes.go:229 +0x30f
go/types.(*Config).sizeof(...)
/home/cyrus/sdk/go1.23.1/src/go/types/sizes.go:334
go/types.representableConst.func1({0xc55880?, 0x100dc80?})
/home/cyrus/sdk/go1.23.1/src/go/types/const.go:77 +0x86
go/types.representableConst({0xc59278, 0x105e000}, 0xc000b1e1c0, 0x100dc80, 0xc000b28ea0)
/home/cyrus/sdk/go1.23.1/src/go/types/const.go:93 +0x173
go/types.(*Checker).representation(0xc000b1e1c0, 0xc0006b3640, 0x100dc80)
/home/cyrus/sdk/go1.23.1/src/go/types/const.go:257 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc000b1e1c0, 0xc0006b3640, {0xc55880, 0x100dc80})
/home/cyrus/sdk/go1.23.1/src/go/types/expr.go:377 +0x2d7
go/types.(*Checker).assignment(0xc000b1e1c0, 0xc0006b3640, {0xc55880, 0x100dc80}, {0xb72b4a, 0x10})
/home/cyrus/sdk/go1.23.1/src/go/types/assignments.go:70 +0x451
go/types.(*Checker).initVar(0xc000b1e1c0, 0xc000113aa0, 0xc0006b3640, {0xb72b4a, 0x10})
/home/cyrus/sdk/go1.23.1/src/go/types/assignments.go:181 +0x428
go/types.(*Checker).initVars(0xc000b1e1c0, {0xc000118268, 0x1, 0x0?}, {0xc000a32590, 0xb6cc43?, 0x3?}, {0xc57f90, 0xc000037140})
/home/cyrus/sdk/go1.23.1/src/go/types/assignments.go:399 +0x638
go/types.(*Checker).stmt(0xc000b1e1c0, 0x0, {0xc57f90, 0xc000037140})
/home/cyrus/sdk/go1.23.1/src/go/types/stmt.go:533 +0x1777
go/types.(*Checker).stmtList(0xc000b1e1c0, 0x0, {0xc000a325a0?, 0x5e9c00?, 0xc000b1e1c0?})
/home/cyrus/sdk/go1.23.1/src/go/types/stmt.go:121 +0x85
go/types.(*Checker).funcBody(0xc000b1e1c0, 0xc57cf0?, {0xc000a0b514?, 0xa?}, 0xc0006b35c0, 0xc000affa40, {0x0?, 0x0?})
/home/cyrus/sdk/go1.23.1/src/go/types/stmt.go:41 +0x2f3
go/types.(*Checker).funcDecl.func1()
/home/cyrus/sdk/go1.23.1/src/go/types/decl.go:888 +0x3a
go/types.(*Checker).processDelayed(0xc000b1e1c0, 0x0)
/home/cyrus/sdk/go1.23.1/src/go/types/check.go:516 +0x15c
go/types.(*Checker).checkFiles(0xc000b1e1c0, {0xc000a324d0, 0x2, 0x2})
/home/cyrus/sdk/go1.23.1/src/go/types/check.go:462 +0x17e
go/types.(*Checker).Files(0xc00019e0e0?, {0xc000a324d0?, 0xc000112300?, 0x6?})
/home/cyrus/sdk/go1.23.1/src/go/types/check.go:422 +0x75
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc00019e0e0, 0xc000a87e60)
/home/cyrus/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:1052 +0xa32
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
/home/cyrus/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:851 +0x1a9
sync.(*Once).doSlow(0x0?, 0x0?)
/home/cyrus/sdk/go1.23.1/src/sync/once.go:76 +0xb4
sync.(*Once).Do(...)
/home/cyrus/sdk/go1.23.1/src/sync/once.go:67
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
/home/cyrus/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:839 +0x3b
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
/home/cyrus/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:846 +0x26
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 80
/home/cyrus/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:845 +0x94
`

@YanShulinjj
Copy link

Did you fix it?

@pigga
Copy link

pigga commented Nov 6, 2024

what's happend? And how to fix it?Do u have any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants