<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>《记一次go panic问题的解决过程》的评论</title>
	<atom:link href="http://tonybai.com/2019/04/04/notes-about-fixing-a-go-panic-problem/feed/" rel="self" type="application/rss+xml" />
	<link>https://tonybai.com/2019/04/04/notes-about-fixing-a-go-panic-problem/</link>
	<description>一个程序员的心路历程</description>
	<lastBuildDate>Wed, 29 Apr 2026 22:54:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2019/04/04/notes-about-fixing-a-go-panic-problem/#comment-7733</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Thu, 14 Dec 2023 04:16:34 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=2694#comment-7733</guid>
		<description>手动点赞！</description>
		<content:encoded><![CDATA[<p>手动点赞！</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：ifndef</title>
		<link>https://tonybai.com/2019/04/04/notes-about-fixing-a-go-panic-problem/#comment-7731</link>
		<dc:creator>ifndef</dc:creator>
		<pubDate>Wed, 13 Dec 2023 06:42:12 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=2694#comment-7731</guid>
		<description>找到了，是go 1.18新增的，如果是栈传参的话，panic打印出的参数可能是不确定的，不确定的参数会带上问号</description>
		<content:encoded><![CDATA[<p>找到了，是go 1.18新增的，如果是栈传参的话，panic打印出的参数可能是不确定的，不确定的参数会带上问号</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：ifndef</title>
		<link>https://tonybai.com/2019/04/04/notes-about-fixing-a-go-panic-problem/#comment-7730</link>
		<dc:creator>ifndef</dc:creator>
		<pubDate>Wed, 13 Dec 2023 02:34:48 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=2694#comment-7730</guid>
		<description>调用栈的参数有时候会带着问号，这是啥意思</description>
		<content:encoded><![CDATA[<p>调用栈的参数有时候会带着问号，这是啥意思</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2019/04/04/notes-about-fixing-a-go-panic-problem/#comment-7690</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Fri, 07 Apr 2023 22:00:22 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=2694#comment-7690</guid>
		<description>此外，你用的go版本是多少？较新版本的go引入了更多的优化，一些函数很容易被inline掉，那样就看不到函数调用栈信息了。go build -gcflags &#039;-l -N&#039; xxx.go来关闭优化。此外，我看到较新版本的go在输出栈跟踪信息做的更好了，比如：

func Example(slice []string, str string, i int) {
	panic(&quot;Want stack trace&quot;)
}

这样的函数输出的栈跟踪信息：

goroutine 1 [running]:
main.Example({0xc00004a730, 0x2, 0x4}, {0x1064942, 0x5}, 0xa)
	/Users/tonybai/test/go/stacktrace/trace1.go:9 +0x45
main.main()
	/Users/tonybai/test/go/stacktrace/trace1.go:5 +0x85

你可以看到，go将slice、string这样的参数类型用大括号将其内部组成括起来，方便大家区别查看了。</description>
		<content:encoded><![CDATA[<p>此外，你用的go版本是多少？较新版本的go引入了更多的优化，一些函数很容易被inline掉，那样就看不到函数调用栈信息了。go build -gcflags &#8216;-l -N&#8217; xxx.go来关闭优化。此外，我看到较新版本的go在输出栈跟踪信息做的更好了，比如：</p>
<p>func Example(slice []string, str string, i int) {<br />
	panic(“Want stack trace”)<br />
}</p>
<p>这样的函数输出的栈跟踪信息：</p>
<p>goroutine 1 [running]:<br />
main.Example({0xc00004a730, 0&#215;2, 0&#215;4}, {0&#215;1064942, 0&#215;5}, 0xa)<br />
	/Users/tonybai/test/go/stacktrace/trace1.go:9 +0&#215;45<br />
main.main()<br />
	/Users/tonybai/test/go/stacktrace/trace1.go:5 +0&#215;85</p>
<p>你可以看到，go将slice、string这样的参数类型用大括号将其内部组成括起来，方便大家区别查看了。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2019/04/04/notes-about-fixing-a-go-panic-problem/#comment-7689</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Fri, 07 Apr 2023 01:09:33 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=2694#comment-7689</guid>
		<description>我手里没有M1机器，M1是arm64的cpu架构，在stack trace输出上估计会有差别，你那边输出的是什么信息呢？</description>
		<content:encoded><![CDATA[<p>我手里没有M1机器，M1是arm64的cpu架构，在stack trace输出上估计会有差别，你那边输出的是什么信息呢？</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：weitefeng</title>
		<link>https://tonybai.com/2019/04/04/notes-about-fixing-a-go-panic-problem/#comment-7688</link>
		<dc:creator>weitefeng</dc:creator>
		<pubDate>Thu, 06 Apr 2023 02:32:53 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=2694#comment-7688</guid>
		<description>“关于Stack trace输出信息的识别，总体遵循几个要点：”
这部分规则，在苹果的M系列芯片上似乎有些差别？我无法在M1芯片的机器上复现出这些结果，也无法找到更多的解释，想问问Tony有没有更多的研究</description>
		<content:encoded><![CDATA[<p>“关于Stack trace输出信息的识别，总体遵循几个要点：”<br />
这部分规则，在苹果的M系列芯片上似乎有些差别？我无法在M1芯片的机器上复现出这些结果，也无法找到更多的解释，想问问Tony有没有更多的研究</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：haoc7</title>
		<link>https://tonybai.com/2019/04/04/notes-about-fixing-a-go-panic-problem/#comment-7353</link>
		<dc:creator>haoc7</dc:creator>
		<pubDate>Thu, 11 Apr 2019 08:21:57 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=2694#comment-7353</guid>
		<description>哈哈，有ok先判断ok，这个坑我也踩过。</description>
		<content:encoded><![CDATA[<p>哈哈，有ok先判断ok，这个坑我也踩过。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2019/04/04/notes-about-fixing-a-go-panic-problem/#comment-7351</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Sat, 06 Apr 2019 12:03:48 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=2694#comment-7351</guid>
		<description>当局者迷吧，调试三年前的代码难免疏漏。另外内联函数最初是无法在stack traceback信息中出现的；后来这个问题fix了。inline函数的函数名出现在stack traceback中。但参数列表只会显示（...)。go 1.11及后续版本均是如此。</description>
		<content:encoded><![CDATA[<p>当局者迷吧，调试三年前的代码难免疏漏。另外内联函数最初是无法在stack traceback信息中出现的；后来这个问题fix了。inline函数的函数名出现在stack traceback中。但参数列表只会显示（&#8230;)。go 1.11及后续版本均是如此。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：aaa</title>
		<link>https://tonybai.com/2019/04/04/notes-about-fixing-a-go-panic-problem/#comment-7349</link>
		<dc:creator>aaa</dc:creator>
		<pubDate>Thu, 04 Apr 2019 09:26:23 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=2694#comment-7349</guid>
		<description>这个一眼就能看出吧……ok后面必然会有个if的，你这里没有

内联的函数也会有栈帧的</description>
		<content:encoded><![CDATA[<p>这个一眼就能看出吧……ok后面必然会有个if的，你这里没有</p>
<p>内联的函数也会有栈帧的</p>
]]></content:encoded>
	</item>
</channel>
</rss>
