TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Tracking down a segfault in grep

61 点作者 loadzero超过 10 年前

4 条评论

loadzero超过 10 年前
Author here. Part 2 will be coming soon.<p>If you would like the immersive experience - try this at the mac terminal:<p>echo i860 | grep --color -e i860 -e i86
评论 #9068290 未加载
评论 #9069872 未加载
joshbaptiste超过 10 年前
Great read.. even prompted me to order &quot;The Linux Programmer&#x27;s Toolbox&quot; from the author&#x27;s affiliate link. For me there is no other way to REALLY learn about operating systems or hacking in general without tackling such problems that force you to dig more the further you look . This is the reason I prefer Dtrace as my investigative tool of choice and FreeBSD as my base OS for my side projects. Combined they allow one to see and investigate problems to a much deeper level without the severe overhead of other tools and understand the practical workings of a Unix derived OS without being a kernel hacker.
评论 #9068827 未加载
userbinator超过 10 年前
It&#x27;s certainly rather surprising to see that <i>colouring the output</i> would cause such different (and buggy) behaviour - the number of matches shouldn&#x27;t be affected by whether the output should be coloured or not... I would look carefully at how the execution flow diverges between the presence and absence of the --color option.
rian超过 10 年前
On your Mac the stack trace hints that the bug is due to a bad pointer&#x2F;offset&#x2F;size being passed to fwrite() but in the debug builds it looks like it&#x27;s in the fastcmp() function. Is this the descrepancy you&#x27;re talking about in the final paragraph?