{"id":75,"date":"2015-10-09T07:42:10","date_gmt":"2015-10-09T13:42:10","guid":{"rendered":"http:\/\/www.osdninja.com\/?p=75"},"modified":"2015-10-23T08:26:57","modified_gmt":"2015-10-23T14:26:57","slug":"core-gone-wild","status":"publish","type":"post","link":"http:\/\/www.osdninja.com\/?p=75","title":{"rendered":"Core gone wild"},"content":{"rendered":"<p>What would you do if someone called you and said every time a computer finished imaging, it was missing a bunch of software?\u00a0 Well, look at the logs of course, but after that is where things get interesting&#8230;.<\/p>\n<p>I had one computer in particular that was brought to me that was consistently throwing file errors, and the first thought was there had to be some download corruption.<\/p>\n<p id=\"kZswfTL\"><img decoding=\"async\" loading=\"lazy\" width=\"409\" height=\"316\" class=\"alignnone size-full wp-image-77 \" src=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617bc1a2b8ac.png\" alt=\"\" srcset=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617bc1a2b8ac.png 409w, http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617bc1a2b8ac-300x232.png 300w\" sizes=\"(max-width: 409px) 100vw, 409px\" \/><\/p>\n<p id=\"DryJSca\"><img decoding=\"async\" loading=\"lazy\" width=\"406\" height=\"303\" class=\"alignnone size-full wp-image-78 \" src=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617bc4b8031d.png\" alt=\"\" srcset=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617bc4b8031d.png 406w, http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617bc4b8031d-300x224.png 300w\" sizes=\"(max-width: 406px) 100vw, 406px\" \/><\/p>\n<p>But time and time again, everytime the image was loaded, errors would show up, not always on the same software, but at least a few various ones. \u00a0The hard drive was replaced first, but no improvement, then the RAM, and finally the motherboard. \u00a0No dice, issue still persisted. \u00a0The only thing left was to focus on the CPU.<\/p>\n<p>After swapping the CPU from a known working computer, walla! No more errors! \u00a0And more importantly, the &#8220;bad&#8221; CPU reproduced the same random issues in the known computer. \u00a0Now, to get that CPU replaced&#8230;<\/p>\n<p>Problem was, the PC OEM&#8217;s built in hardware diagnostics said everything was fine. \u00a0Even the Intel CPU diagnostics, came up clean. \u00a0In the process of installing all sorts of test utilities, I noticed a new pattern&#8230; There was no pattern.<\/p>\n<p>Sometimes while simply double clicking a download to run an install, I&#8217;d get an extraction error, and then a minute later, it would run fine. \u00a0Intel&#8217;s own diagnostics tool is one example, here&#8217;s the error:<\/p>\n<p id=\"pBtknkn\"><img decoding=\"async\" loading=\"lazy\" width=\"326\" height=\"207\" class=\"alignnone size-full wp-image-79 \" src=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617bf50701d3.png\" alt=\"\" srcset=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617bf50701d3.png 326w, http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617bf50701d3-300x190.png 300w\" sizes=\"(max-width: 326px) 100vw, 326px\" \/><\/p>\n<p>So how is this randomness possible? \u00a0When you run program, the Windows kernel will schedule the thread on an available logical processor, and considering this was a quad core computer, that means at random, it would be executing on one of the 4 cores. \u00a0To test the theory, I started setting the affinity to control which core it was running on. \u00a0Since processor affinity is inherited by child processes, I first open a command prompt and set \u00a0the affinity there, and started running my tests.<\/p>\n<p id=\"QuKhrKL\"><a href=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617c096c5603.png\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" width=\"877\" height=\"491\" class=\"alignnone size-full wp-image-81 \" src=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617c096c5603.png\" alt=\"\" srcset=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617c096c5603.png 877w, http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617c096c5603-300x168.png 300w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>In classic suspenseful style, each core that I ran it on worked correctly, until the very last one was tested, and boom, error popped up. \u00a0I now had a %100 repeatable test, every time I had the affinity set to CPU 3, it would error out %100 of the time, any of the other CPU&#8217;s selected, and there was no error %100 of the time.<\/p>\n<p>So why is a CPU issue manifesting as a file extract error? \u00a0Let&#8217;s look a little deeper at the files themselves. \u00a0Running Sysinternals Process Monitor, we see that the Setup.exe is extracting files to our Appdata temp folder, no surprises here:<\/p>\n<p id=\"hbDthiN\"><a href=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617c21d65a80.png\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" width=\"559\" height=\"450\" class=\"alignnone size-full wp-image-82 \" src=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617c21d65a80.png\" alt=\"\" srcset=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617c21d65a80.png 559w, http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617c21d65a80-300x242.png 300w\" sizes=\"(max-width: 559px) 100vw, 559px\" \/><\/a><\/p>\n<p>But let&#8217;s grab a these files out of the temp folder before closing the error, and then do the same with the extracted files when there is no error. \u00a0Then using your favorite hex editor\/comparison tool, look at the differences.<\/p>\n<p id=\"TBiECDV\"><a href=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617c3664f76f.png\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" width=\"1189\" height=\"495\" class=\"alignnone size-full wp-image-83 \" src=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617c3664f76f.png\" alt=\"\" srcset=\"http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617c3664f76f.png 1189w, http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617c3664f76f-300x125.png 300w, http:\/\/www.osdninja.com\/wp-content\/uploads\/2015\/10\/img_5617c3664f76f-1024x426.png 1024w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>If you look closely, every where there is a difference between the good file and the bad file, the data is off by a value of 4. \u00a0From this point I can only speculate what is going on in the CPU. \u00a0It is decompressing a file, so maybe there&#8217;s a math error, or maybe a transistor somewhere that thought it gets set to 1 is still a 0, not sure. \u00a0That&#8217;s another job and another career for someone else to figure out&#8230;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What would you do if someone called you and said every time a computer finished imaging, it was missing a bunch of software?\u00a0 Well, look at the logs of course, but after that is where things get interesting&#8230;. I had one computer in particular that was brought to me that was consistently throwing file errors, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.osdninja.com\/?p=75\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Core gone wild&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[7,6],"_links":{"self":[{"href":"http:\/\/www.osdninja.com\/index.php?rest_route=\/wp\/v2\/posts\/75"}],"collection":[{"href":"http:\/\/www.osdninja.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.osdninja.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.osdninja.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.osdninja.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=75"}],"version-history":[{"count":4,"href":"http:\/\/www.osdninja.com\/index.php?rest_route=\/wp\/v2\/posts\/75\/revisions"}],"predecessor-version":[{"id":104,"href":"http:\/\/www.osdninja.com\/index.php?rest_route=\/wp\/v2\/posts\/75\/revisions\/104"}],"wp:attachment":[{"href":"http:\/\/www.osdninja.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.osdninja.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.osdninja.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}