是什么导致了 2010 年的错误?
有很多关于系统无法理解 2010 年的报告,但我不知道为什么。据我所知,我目前管理的系统运行良好,但我想知道实际问题是什么,以便更好地搜索。
有人可以解释一下吗?
编辑: http://www.rte.ie/business/2010/0105/ bug.html - 有关影响德国信用卡的信息
There are a lot of reports of systems failing to understand the year 2010 but I've no idea why. Current systems I look after are working fine as far as I could tell but I'd like to know what the actual problem is to search better.
Could anyone shed some light on it please?
Edit: http://www.rte.ie/business/2010/0105/bug.html - Information about it affecting credit cards in Germany
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
银行和电信中使用的多种协议 - 包括 SMS 协议 - 将年份编码为 < a href="http://en.wikipedia.org/wiki/Binary-coded_decimal" rel="nofollow noreferrer">BCD 在一个字节中。
从 2000 年到 2009 年,人们很容易犯将年份解释为标准二进制数的错误,因为编码是相同的:
这很可能是 Windows Mobile 错误的原因。
Several protocols used in banking and telecommunications - including the SMS protocol - encode the year as BCD in a single byte.
From 2000-2009 one could easily make the mistake of interpreting the year as a standard binary number since the encoding would be the same:
That is most probably the cause of the Windows Mobile bug.
一种可能的解释在下面的文章中
http://www.theregister.co .uk/2010/01/05/symantec_y2k10_bug/
One possible explanation is in the article below
http://www.theregister.co.uk/2010/01/05/symantec_y2k10_bug/
SpamAssassin 有一条规则,将未来太远的日期标记为垃圾邮件:
修复晚了几天,但很简单:
十年后再见。
SpamAssassin had a rule to mark dates too far in the future as spam:
The fix came a few days too late, but it's quite simple:
See you again in ten years.
我正在使用一个使用一位数年份字段的系统。是的。一位数。所以这个系统失败的原因是“2000”与“2010”的表达方式相同。
I've got a system at work that uses a one digit year field. Yes. One digit. So the reason this system is failing is that "2000" is expressed the same as "2010".
我听说的一个是人们在没有经过深思熟虑的情况下为千年虫问题所做的快速修复。所以如果 xx < 10 然后 20xx,否则 19xx。
The one I heard about was quick fixes people did for Y2K without thinking it through. So if xx < 10 then 20xx else 19xx.
这可能是因为年轻的开发者在千禧年之后开始了他们的职业生涯,并使用 1 位数来代表年份。
It might be due to the young developers who started their careers after Y2K and are using 1 digit to represent the year.
上周末,我在一个网站上处理了 2010 年的一个小故障,但这只是编码疏忽的结果。
有人认为,当列表仅包含 2009 年之前的项目时,将列表项的值设置为当前 dateTime.year.Now() 是个好主意。
I took care of a little 2010 fail in a site last weekend, it was just the result of an oversight in coding though.
Someone thought it would be a good idea to set the value of a list item to the current dateTime.year.Now() when the list only contained items up to 2009.
以下是 Norton symantec Endpoint Protection 的屏幕截图
替代文本 http://img695.imageshack .us/img695/4500/152010112800am.jpg
真的很好,@symantec 没有人通知他们的客户...
直到文章发布: http://www.theregister.co.uk /2010/01/05/symantec_y2k10_bug/
Here is a screen shot of the norton symantec endpoint protection
alt text http://img695.imageshack.us/img695/4500/152010112800am.jpg
Really nice that no one @ symantec informed their customers...
Till the article was posted: http://www.theregister.co.uk/2010/01/05/symantec_y2k10_bug/
组件中存在一个错误,将年份分为两部分。第二部分用于比较,因此数字 10 不是以 10 为基数,而是以 16 为基数,这意味着它是 0x10 = 16(十六进制)。
It is that there is a bug in a component that splits the year in two parts. The second part is used in a comparison so that the digit 10 is not in base 10, it's in base 16 meaning that it's 0x10 = 16 (hex).
我使用 Google 代码搜索查找开源软件中的 2010 年错误。我寻找了一种表明存在错误的特定模式(使用“200%d”作为 printf 格式字符串),并发现了几个存在该错误的项目。搜索模式的创造性应用可能会发现更多不同类型的错误。
I used Google Code Search to find y2010 bugs in open source software. I looked for one particular pattern that would indicate a bug (use of "200%d" as a printf format string), and found several projects with that bug. Creative application of search patterns could probably turn up more different kinds of bugs.