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/[email protected]/myast/common.go:42 +0x36c
github.com/xxjwxc/ginrpc.(_Base).tryGenRegister(0x40003a0190, 0x8588a0, 0x40003b01a0, 0x400042bea8, 0x1, 0x1, 0x40003a0190)
/go/pkg/mod/github.com/xxjwxc/[email protected]/common.go:455 +0x30
github.com/xxjwxc/ginrpc.(
_Base).Register(0x40003a0190, 0x8588a0, 0x40003b01a0, 0x400042bea8, 0x1, 0x1, 0x40003b01a0)
/go/pkg/mod/github.com/xxjwxc/[email protected]/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/[email protected]/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