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

goxlsw panics when importing a project with a large number of empty sprite source files into a newly created project #1486

Open
aofei opened this issue Mar 20, 2025 · 1 comment

Comments

@aofei
Copy link
Member

aofei commented Mar 20, 2025

all-sprites.gbp.zip

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x0 addr=0x0 pc=0x0]
<empty string>
goroutine 8 [running]:
github.com/goplus/gop/ast.(*File).Pos(...)
	github.com/goplus/gop@v1.3.6/ast/ast_gop.go:488
github.com/goplus/goxlsw/internal/server.(*compileResult).fromPosition(0x1885200, 0x0, {{0x0, 0x0}, 0x0, 0x0, 0x0})
	github.com/goplus/goxlsw@v0.3.1/internal/server/compile.go:599 +0x3
github.com/goplus/goxlsw/internal/server.(*compileResult).rangeForASTFilePosition(...)
	github.com/goplus/goxlsw@v0.3.1/internal/server/compile.go:647
github.com/goplus/goxlsw/internal/server.(*compileResult).rangeForPos(0x1885200, 0x0)
	github.com/goplus/goxlsw@v0.3.1/internal/server/compile.go:653 +0xd
github.com/goplus/goxlsw/internal/server.(*Server).compileAt.func1({0x153100, 0x20d6080})
	github.com/goplus/goxlsw@v0.3.1/internal/server/compile.go:785 +0xa
github.com/goplus/goxlsw/internal/server.(*Server).compileAt(0x187f590, 0x1872210)
	github.com/goplus/goxlsw@v0.3.1/internal/server/compile.go:799 +0x80
github.com/goplus/goxlsw/internal/server.(*Server).compile(0x187f590)
	github.com/goplus/goxlsw@v0.3.1/internal/server/compile.go:703 +0x8
github.com/goplus/goxlsw/internal/server.(*Server).textDocumentDiagnostic(0x187f590, 0x187f5e0)
	github.com/goplus/goxlsw@v0.3.1/internal/server/diagnostic.go:5 +0x2
github.com/goplus/goxlsw/internal/server.(*Server).handleCall.func12()
	github.com/goplus/goxlsw@v0.3.1/internal/server/server.go:175 +0x2
github.com/goplus/goxlsw/internal/server.(*Server).handleCall.(*Server).runWithResponse.func30()
	github.com/goplus/goxlsw@v0.3.1/internal/server/server.go:297 +0x4
github.com/goplus/goxlsw/internal/server.(*Server).run.func1()
	github.com/goplus/goxlsw@v0.3.1/internal/server/server.go:288 +0x4
created by github.com/goplus/goxlsw/internal/server.(*Server).run in goroutine 7
	github.com/goplus/goxlsw@v0.3.1/internal/server/server.go:287 +0x5
@aofei aofei self-assigned this Mar 20, 2025
@aofei
Copy link
Member Author

aofei commented Mar 21, 2025

This panic was triggered by a sprite named Game in the project mentioned in the OP, due to a bug in gop/gogen that generated a types.Error with an invalid Pos. (Related to #1085)

@aofei aofei removed their assignment Mar 24, 2025
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

1 participant