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

viewcore 生成对象引用关系图报错 #2383

Open
bailongxian opened this issue Mar 16, 2024 · 4 comments
Open

viewcore 生成对象引用关系图报错 #2383

bailongxian opened this issue Mar 16, 2024 · 4 comments

Comments

@bailongxian
Copy link

viewcore corefile --exe bin_file objref ref.bt
用viewcore生成引用关系图的时候报错
panic: can't find type runtime.special

@alpha-baby
Copy link
Member

cc @doujiang24

@doujiang24
Copy link
Member

@bailongxian

首先说下背景:
viewcore 这个工具,golang 官方基本不咋维护了,确实很容易有这类的问题
而且,以我之前使用的经验来看,解决/绕过这个问题之后,还可能有其他类似的坑

继续分析这个 issue 的话,还请提供更多信息呢:

  1. bin_file 用的哪个 golang 版本编译的呢?确认是跟生成 corefile 时用的 bin_file 是同一个,对吧?
  2. panic 完成调用栈可以提供一下,方便判断

@bailongxian
Copy link
Author

go版本是1.20.3
重新生成最小的代码 执行了 又报下面的错误了

panic: can't find field runtime.functab.entry
goroutine 1 [running]:
golang.org/x/debug/internal/gocore.region.Field(...)
/home/bailongxian/debug-mosn/internal/gocore/region.go:165
golang.org/x/debug/internal/gocore.(*Process).readModule(0xc002fd4000, {0xc002fd4000?, 0xc003c94d70?, 0xc003c94e10?})
/home/bailongxian/debug-mosn/internal/gocore/module.go:49 +0xdba
golang.org/x/debug/internal/gocore.(*Process).readModules(0xc002fd4000)
/home/bailongxian/debug-mosn/internal/gocore/module.go:27 +0x105
golang.org/x/debug/internal/gocore.Core(0xc00014a000)
/home/bailongxian/debug-mosn/internal/gocore/process.go:167 +0x2e5
main.readCore()
/home/bailongxian/debug-mosn/cmd/viewcore/main.go:290 +0x93
main.runObjref(0xb514c0?, {0xc0000391a0, 0x1, 0x4?})
/home/bailongxian/debug-mosn/cmd/viewcore/objref.go:135 +0x113
github.com/spf13/cobra.(*Command).execute(0xb514c0, {0xc000078340, 0x3, 0x4})
/home/bailongxian/Work/github.com/spf13/cobra@v0.0.3/command.go:766 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0xb50b40)
/home/bailongxian/Work/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2e5
github.com/spf13/cobra.(*Command).Execute(...)
/home/bailongxian/Work/github.com/spf13/cobra@v0.0.3/command.go:800
main.main()
/home/bailongxian/debug-mosn/cmd/viewcore/main.go:257 +0x1cb

@doujiang24
Copy link
Member

1.20 好新了,估计一堆的兼容性的坑,我当时用 1.18 都踩了不少坑

你可以不用这个 objref 工具,试试跑下原生的 viewcore 工具,比如 objgraph,reachable 这种的
估计也能发现一样的问题,然后可以考虑给 https://github.com/golang/debug 提 issue

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