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

Run llgo run . command sigsegv on macOS #967

Open
wangkuiyi opened this issue Feb 1, 2025 · 1 comment
Open

Run llgo run . command sigsegv on macOS #967

wangkuiyi opened this issue Feb 1, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@wangkuiyi
Copy link

~/w/llgo/_demo/hello [main|✔]
19:19 $ llgo run .
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x50 pc=0x1023abf6c]

goroutine 1 [running]:
github.com/goplus/llgo/ssa.(*aProgram).rtNamed(0x14000194008, {0x102445570?, 0x5?})
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/ssa/package.go:282 +0x9c
github.com/goplus/llgo/ssa.(*aProgram).rtType(0x14000194008, {0x102445570?, 0x140063dee88?})
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/ssa/package.go:288 +0x24
github.com/goplus/llgo/ssa.(*aProgram).rtIface(...)
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/ssa/package.go:300
github.com/goplus/llgo/ssa.(*aProgram).toType(0x14000194008, {0x102589380, 0x140000e6a50})
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/ssa/type.go:372 +0xbd8
github.com/goplus/llgo/ssa.(*aProgram).rawType(0x14000194008, {0x102589380, 0x140000e6a50})
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/ssa/type.go:251 +0x6c
github.com/goplus/llgo/ssa.(*aProgram).toNamed(0x14000194008, 0x140000e4070)
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/ssa/type.go:511 +0x104
github.com/goplus/llgo/ssa.(*aProgram).toType(0x14000194008, {0x1025893a8, 0x140000e4070})
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/ssa/type.go:381 +0x170
github.com/goplus/llgo/ssa.(*aProgram).rawType(0x14000194008, {0x1025893a8, 0x140000e4070})
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/ssa/type.go:251 +0x6c
github.com/goplus/llgo/ssa.(*aProgram).toLLVMTypes(0x14000194008, 0x14004f18ca8, 0x2)
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/ssa/type.go:447 +0x84
github.com/goplus/llgo/ssa.(*aProgram).toLLVMFunc(0x14000194008, 0x14001d77240)
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/ssa/type.go:460 +0xe0
github.com/goplus/llgo/ssa.(*aProgram).FuncDecl(0x14000194008, 0x1023c9530?, 0x14008728820?)
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/ssa/type_cvt.go:66 +0x98
github.com/goplus/llgo/ssa.(*aPackage).NewFuncEx(0x14008717340, {0x14008728820, 0x9}, 0x14001d77240, 0x1, 0x0, 0x0)
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/ssa/decl.go:206 +0x74
github.com/goplus/llgo/cl.(*context).compileFuncDecl(0x14008724ea0, 0x14008717340, 0x140076884e0)
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/cl/compile.go:258 +0x77c
github.com/goplus/llgo/cl.processPkg(0x14008724ea0, 0x14008717340, 0x14007686000)
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/cl/compile.go:1097 +0x300
github.com/goplus/llgo/cl.NewPackageEx(0x14000194008, 0x14005090420, 0x14007686000, {0x14004f18240, 0x3, 0x3})
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/cl/compile.go:1044 +0x648
github.com/goplus/llgo/internal/build.buildPkg(0x14004cd0120, 0x14005bb5e80, 0x0)
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/internal/build/build.go:524 +0x2bc
github.com/goplus/llgo/internal/build.buildAllPkgs(0x14004cd0120, {0x14004b634c8?, 0x14005520000?, 0x1024d1388?}, 0x0)
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/internal/build/build.go:351 +0x410
github.com/goplus/llgo/internal/build.Do({0x14000020440?, 0x1?, 0x1?}, 0x140000b45a0)
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/internal/build/build.go:205 +0x99c
github.com/goplus/llgo/cmd/internal/run.runCmdEx(0x10245861b?, {0x14000020440, 0x1, 0x1}, 0x2)
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/cmd/internal/run/run.go:68 +0x120
github.com/goplus/llgo/cmd/internal/run.runCmd(0x140000e4000?, {0x14000020440?, 0x0?, 0x0?})
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/cmd/internal/run/run.go:52 +0x24
main.main()
	/Users/y/go/pkg/mod/github.com/goplus/llgo@v0.9.9/cmd/llgo/llgo.go:92 +0x44c
19:19 $ uname -a
Darwin yis-mac-studio.lan 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec  6 18:56:34 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6020 arm64
@xushiwei xushiwei added the bug Something isn't working label Feb 1, 2025
@cpunion
Copy link
Contributor

cpunion commented Feb 8, 2025

Please fetch latest code from main branch and run go install ./cmd/llgo in compiler/ and test again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants