<?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"
	>
<channel>
	<title>Comments on: Guess What Happened to Me Today</title>
	<atom:link href="http://metastatic.org/text/Concern/2007/07/25/guess-what-happened-to-me-today/feed/" rel="self" type="application/rss+xml" />
	<link>http://metastatic.org/text/Concern/2007/07/25/guess-what-happened-to-me-today/</link>
	<description>In Which We Worry and Complain Out Loud in Our Outside Voice</description>
	<pubDate>Wed, 19 Nov 2008 04:21:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Gary Benson</title>
		<link>http://metastatic.org/text/Concern/2007/07/25/guess-what-happened-to-me-today/#comment-39287</link>
		<dc:creator>Gary Benson</dc:creator>
		<pubDate>Fri, 27 Jul 2007 12:42:43 +0000</pubDate>
		<guid isPermaLink="false">http://metastatic.org/text/Concern/2007/07/25/guess-what-happened-to-me-today/#comment-39287</guid>
		<description>Nice :)</description>
		<content:encoded><![CDATA[<p>Nice <img src='http://metastatic.org/text/Concern/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: csm</title>
		<link>http://metastatic.org/text/Concern/2007/07/25/guess-what-happened-to-me-today/#comment-39275</link>
		<dc:creator>csm</dc:creator>
		<pubDate>Fri, 27 Jul 2007 07:14:57 +0000</pubDate>
		<guid isPermaLink="false">http://metastatic.org/text/Concern/2007/07/25/guess-what-happened-to-me-today/#comment-39275</guid>
		<description>To explain:

At 1185410974 seconds past the epoch (Jan 1, 1970 or so), one thousand times that value not only overflows a signed 32-bit integer, but it will wrap around at that point from a negative integer to a positive integer.

OK. Now, say you had a timer class based on milliseconds since the epoch. You make timers that "expire" by adding a millisecond value to "now." You start to notice that on July 25, 2007, that timers scheduled twelve hours from now start firing immediately.

What's going on?

Well, at Wed Jul 25 17:49:34 PDT 2007, that time in milliseconds overflowed a 32-bit integer, and wrapped around to a positive integer again. This means that if "now" was before that time, and "now plus 12 hours" was after that time, that "now" would always be greater than "now plus 12 hours," IF you, say, happened to have a bug where the seconds value was cast from a 32 bit signed int, which you multiplied by 1000, then cast to a 64 bit integer, that times before then would be very very large (taking into account sign extension), and values after then would be very, very small.

Now say you had an event fire every 12 hours (in theory). Bad things would happen on that day, and that day only, where "now" was always immediately larger than "now plus 12 hours."

(note, no proof yet that this caused any power failures...)</description>
		<content:encoded><![CDATA[<p>To explain:</p>
<p>At 1185410974 seconds past the epoch (Jan 1, 1970 or so), one thousand times that value not only overflows a signed 32-bit integer, but it will wrap around at that point from a negative integer to a positive integer.</p>
<p>OK. Now, say you had a timer class based on milliseconds since the epoch. You make timers that &#8220;expire&#8221; by adding a millisecond value to &#8220;now.&#8221; You start to notice that on July 25, 2007, that timers scheduled twelve hours from now start firing immediately.</p>
<p>What&#8217;s going on?</p>
<p>Well, at Wed Jul 25 17:49:34 PDT 2007, that time in milliseconds overflowed a 32-bit integer, and wrapped around to a positive integer again. This means that if &#8220;now&#8221; was before that time, and &#8220;now plus 12 hours&#8221; was after that time, that &#8220;now&#8221; would always be greater than &#8220;now plus 12 hours,&#8221; IF you, say, happened to have a bug where the seconds value was cast from a 32 bit signed int, which you multiplied by 1000, then cast to a 64 bit integer, that times before then would be very very large (taking into account sign extension), and values after then would be very, very small.</p>
<p>Now say you had an event fire every 12 hours (in theory). Bad things would happen on that day, and that day only, where &#8220;now&#8221; was always immediately larger than &#8220;now plus 12 hours.&#8221;</p>
<p>(note, no proof yet that this caused any power failures&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: liava</title>
		<link>http://metastatic.org/text/Concern/2007/07/25/guess-what-happened-to-me-today/#comment-39226</link>
		<dc:creator>liava</dc:creator>
		<pubDate>Thu, 26 Jul 2007 08:24:19 +0000</pubDate>
		<guid isPermaLink="false">http://metastatic.org/text/Concern/2007/07/25/guess-what-happened-to-me-today/#comment-39226</guid>
		<description>Ouch</description>
		<content:encoded><![CDATA[<p>Ouch</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary Benson</title>
		<link>http://metastatic.org/text/Concern/2007/07/25/guess-what-happened-to-me-today/#comment-39225</link>
		<dc:creator>Gary Benson</dc:creator>
		<pubDate>Thu, 26 Jul 2007 08:11:23 +0000</pubDate>
		<guid isPermaLink="false">http://metastatic.org/text/Concern/2007/07/25/guess-what-happened-to-me-today/#comment-39225</guid>
		<description>Still non the wiser!</description>
		<content:encoded><![CDATA[<p>Still non the wiser!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 3.557 seconds -->
