转到堆栈跟踪:在某些函数调用参数或 return 值之后问号(?)的含义是什么?

go stack trace: what is the meaning of a question(?) mark after certain function call arguments or return values?

我正在尝试调试泄漏的 goroutines(使用 Gomega 的 gleak)。当单元测试结束时,一些 goroutines“顽固地”坚持不终止,gleak 将罪魁祸首及其堆栈跟踪转储。这些堆栈跟踪中的一些调用在其参数或 return 值中甚至包含几个问号,例如:

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

对应的接收函数签名如下:

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

我已经检查了几个关于“解释 golang 堆栈跟踪”的 posts/articles/questions,尤其是 ,但在 Go 堆栈跟踪中没有发现任何问号。我发现解释的示例从未提及任何有问题的(?)调用参数或 return 值。

那么堆栈跟踪中出现问号的原因是什么?这可能与寄存器中传递的参数有关,并且无法正确恢复堆栈跟踪吗?

来自 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.