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

Arm64 run panic: package parsing failed:can not find main files "runtime/asm_amd64.s" #15

Open
peterSZW opened this issue Jun 3, 2021 · 2 comments

Comments

@peterSZW
Copy link

peterSZW commented Jun 3, 2021

if strings.HasSuffix(filename, "runtime/asm_amd64.s") {
				index = index - 2
				break
			}
			index++

asm_amd64 is not correct in arm64 platform !

panic: package parsing failed:can not find main files

goroutine 1 [running]:
github.com/xxjwxc/public/myast.GetModuleInfo(0x2, 0x40000740d8, 0x400042baa8, 0x89198, 0x0, 0xe24dc)
/go/pkg/mod/github.com/xxjwxc/public@v0.0.0-20210528122519-9c0267a26e38/myast/common.go:42 +0x36c
github.com/xxjwxc/ginrpc.(_Base).tryGenRegister(0x40003a0190, 0x8588a0, 0x40003b01a0, 0x400042bea8, 0x1, 0x1, 0x40003a0190)
/go/pkg/mod/github.com/xxjwxc/ginrpc@v0.0.0-20210528122947-199c6df89cae/common.go:455 +0x30
github.com/xxjwxc/ginrpc.(
_Base).Register(0x40003a0190, 0x8588a0, 0x40003b01a0, 0x400042bea8, 0x1, 0x1, 0x40003b01a0)
/go/pkg/mod/github.com/xxjwxc/ginrpc@v0.0.0-20210528122947-199c6df89cae/ginrpc.go:152 +0x9c

@peterSZW
Copy link
Author

peterSZW commented Jun 3, 2021

modify code like below, it works

vi /go/pkg/mod/github.com/xxjwxc/public@v0.0-20210528122519-9c0267a26e38/myast/common.go

        for { // find main file
                _, filename, _, ok := runtime.Caller(index)
                if ok {
                        fmt.Println(filename)
                        if strings.HasSuffix(filename, "runtime/asm_amd64.s") {
                                index = index - 2
                                break
                        }
                        if strings.HasSuffix(filename, "runtime/asm_arm64.s") {
                                index = index - 2
                                break
                        }
                        index++
                } else {
                        panic(errors.New("package parsing failed:can not find m........
                }
        }

@xxjwxc
Copy link
Owner

xxjwxc commented Jun 3, 2021

@peterSZW 感谢,请提一个pr,我来合并

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

2 participants