GO堆栈跟踪:某些函数调用参数或返回值之后,问题(?)标记的含义是什么?

发布于 2025-01-31 04:57:09 字数 807 浏览 4 评论 0原文

我正在尝试调试泄漏goroutines(使用gomega的 gleak )。当单元结束时,测试一些goroutines“固执地”持续不终止时,GLEAK将罪魁祸首带有其堆栈痕迹。这些堆栈痕迹中的某些调用甚至在其参数或返回值中都包含几个问号,例如:

foo.(*Fooler).Foo(0x40003efa40, {0xeeb638?, 0x40005bc580}, {0x400013a000?, 0x6, 0xd9c3a4?}) at foo.go

相应的接收器功能签名如下:

func (f *Fooler) Foo(context.Context, []string)

我已经检查了几篇文章/文章/有关“解释Golang Stack Traces”的帖子/文章/问题,尤其是如何解释Go stacktrace 堆栈跟踪。我发现所解释的示例从未提及任何可疑的(?)调用参数或返回值。

那么,在堆栈痕迹中出现问号的原因是什么?这是否与寄存器中传递的ARG有关,而对于堆栈跟踪不正确地恢复?

I'm trying to debug leaking goroutines (using Gomega's gleak). When at the end of a unit test some goroutines "stubbornly" persist to not terminate, gleak dumps the culprits with their stack traces. Some calls in these stack traces contain even several question marks in their arguments or return values, such as:

foo.(*Fooler).Foo(0x40003efa40, {0xeeb638?, 0x40005bc580}, {0x400013a000?, 0x6, 0xd9c3a4?}) at foo.go

the corresponding receiver function signature is as follows:

func (f *Fooler) Foo(context.Context, []string)

I've checked several posts/articles/questions on "interpreting golang stack traces", not least How to interpret Go stacktrace, but didn't find any mentioning of question marks in Go stack traces. The examples I find explained never mention any questionable(?) call arguments or return values.

So what is the reason for question marks in stack traces? Could this be related to args passed in registers and not properly recoverable for the stack trace?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

与君绝 2025-02-07 04:57:09

来自 https://go.dev/doc/go1.18#runtime

go 1.17通常改进了堆栈跟踪中参数的格式,但可能会打印出在寄存器中传递的参数的不准确值。通过打印问号(?),每个值不准确,可以在GO 1.18中改善这一点。

From https://go.dev/doc/go1.18#runtime :

Go 1.17 generally improved the formatting of arguments in stack traces, but could print inaccurate values for arguments passed in registers. This is improved in Go 1.18 by printing a question mark (?) after each value that may be inaccurate.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文