{"id":58,"date":"2008-02-14T17:56:44","date_gmt":"2008-02-14T23:56:44","guid":{"rendered":"http:\/\/www.pervasivecode.com\/blog\/2008\/02\/14\/leopard-gui-crashes-solved-caused-by-outdated-parallels-kernel-modules\/"},"modified":"2008-04-28T17:42:37","modified_gmt":"2008-04-28T23:42:37","slug":"leopard-gui-crashes-solved-caused-by-outdated-parallels-kernel-modules","status":"publish","type":"post","link":"http:\/\/www.pervasivecode.com\/blog\/2008\/02\/14\/leopard-gui-crashes-solved-caused-by-outdated-parallels-kernel-modules\/","title":{"rendered":"Leopard GUI crashes, Part 1"},"content":{"rendered":"<p>I&#8217;ve had an average uptime over the last couple of months of approximately 48 hours on my MacBook Pro. This has been frustrating and very hard to diagnose, but I think I nailed it today.<br \/>\n<!--more--><br \/>\nRandom &#8220;graphics errors&#8221;, for lack of a better term, would appear on the screen from time to time. (See picture.)<br \/>\n<a href=\"\/images\/leopard_video_errors.png\"><img loading=\"lazy\" decoding=\"async\" src=\"\/images\/leopard_video_errors.png\" alt=\"Screen shots you never want to see on your own computer\" width=\"464\" height=\"290\" style=\"border:none\" \/><\/a><\/p>\n<p>These looked very software-ish to me, and forcing a window to repaint (resizing it, etc.) would make them go away. Eventually, the entire screen would freeze except for the cursor, which would remain as a pointer or insert bar despite being moved to various parts of the screen. Given that iTunes or a DVD would keep making noise, I guessed that this was not a systemwide freeze, and I discovered that I could ssh in from another machine and run <code>shutdown -h now<\/code> or <code>reboot<\/code> as root and usually get a clean shutdown.<\/p>\n<p>I later learned that I could use <code>pmset hibernatemode 1<\/code> to force hibernation instead of normal sleep mode, so that I could un-freeze the GUI by logging in remotely and forcing it to hibernate using <code>pmset sleepnow<\/code> and then manually waking it up.<\/p>\n<p>All this time I was still trying to figure out how to trigger a failure on demand, and to read log files to find some clues. I didn&#8217;t find any log file clues, but I did rule out a hardware problem using the Apple Hardware Diagnostic program that came on the installation DVDs with the computer. The recent 10.5.2 update and exciting-sounding &#8220;Leopard Graphics Update 1.0&#8221; didn&#8217;t solve the problem. In fact, after the 10.5.2 update and that graphics update, the time between failures dropped to about 5-6 hours.<\/p>\n<p>I learned that opening ~150 windows and triggering Expose (via F9) repeatedly would quickly freeze the GUI. At this point my question was, is this a generic Leopard quality problem or a problem specific to all the junk I have installed? Or perhaps a hardware issue not detectable by the diagnostic software?<\/p>\n<p><a href=\"http:\/\/docs.info.apple.com\/article.html?artnum=107392\">Safe boot<\/a> proved it to be very likely to be a problem with third party software; the problem was gone when Safe Booted. So then it was a matter of selectively disabling various things that Safe Boot disables and booting normally, until the problem goes away.<\/p>\n<p>I wrote a simple script to move all fonts not in the <a href=\"http:\/\/docs.info.apple.com\/article.html?artnum=307069\">list of fonts installed with Leopard<\/a> into a folder on my desktop; that didn&#8217;t make the problem go away. According to Font Book&#8217;s validation feature, I have about 2 dozen damaged fonts (including all of the music notation fonts installed by Sibelius, and Adobe&#8217;s Carta font family), but hey, Apple&#8217;s own Helvetica LT MM font fails validation too. In fact, all of the built-in &#8220;MM&#8221; fonts do. It seems that the Font Book validator considers any wacky glyph shapes (like the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Multiple_master_fonts\">Multiple Master<\/a> fonts that make PDFs possible, or music notation symbols, or dingbats) to be invalid.<\/p>\n<p>My next step was to disable any startup items in <code>\/System\/Library\/StartupItems<\/code> (which was empty) and <code>\/Library\/StartupItems<\/code>. There were some old HP printer and scanner drivers, some M-Audio Firewire audio drivers from my <a href=\"http:\/\/www.m-audio.com\/products\/en_us\/FireWireSolo-main.html\">Firewire Solo<\/a> (no Leopard drivers exist yet), <a href=\"http:\/\/en.wikipedia.org\/wiki\/Apple_Qmaster\">Qmaster<\/a>, <a href=\"http:\/\/www.dshadow.com\/software\/unlockupd\/\">Unlockupd<\/a>, and <a href=\"http:\/\/www.bresink.com\/osx\/TemperatureMonitor.html\">BRESINKx86Monitoring<\/a>. All seemed plausible as causes of problems but disabling all of them didn&#8217;t fix the problem. Now that I&#8217;ve looked up what they each do, though, I&#8217;m not going to put them back.<\/p>\n<p>Finally, I disabled the non-Apple stuff in <code>\/System\/Library\/Extensions<\/code>. There are almost 300 items in there, and most of them sound important. In fact, there&#8217;s even <code>Dont Steal Mac OS X.kext<\/code> which apparently contains a <a href=\"http:\/\/forums.macnn.com\/90\/mac-os-x\/335611\/dont-steal-mac-os-x-kernel\/\">pretty funny easter egg<\/a> (see the post by &#8220;kick52&#8221; on that page). I installed a fresh copy of Leopard from my install DVD onto an external drive and used <code>ls -1<\/code> and <code>diff<\/code> to compare the directory contents. I also performed my torture test and verified that Leopard 10.5.0 all by itself would not freeze when pushed. OK, so it&#8217;s definitely not hardware, nor is it a problem inherent to Leopard.<\/p>\n<p>I googled the filenames of the <code>.kext<\/code> bundles in <code>\/System\/Library\/Extensions<\/code> on my hard disk that weren&#8217;t in the base Leopard install, and found that there were some <a href=\"http:\/\/www.parallels.com\/\">Parallels<\/a> kernel extensions in there, from about two years ago when I was using Tiger. Uh oh. So I moved those to another directory. The modules I removed are called <code>helper.kext<\/code>, <code>hypervisor.kext<\/code>, <code>Pvsnet.kext<\/code>, and <code>vmmain.kext<\/code>. My Parallels.app version is 2.5 v3188, which is pretty old.<\/p>\n<p><strong>UPDATE:<\/strong> <em>I missed one: <code>ConnectUSB<\/code>. I found it by running <code>kextstat<\/code> while ssh&#8217;d in from another machine, after it froze again a day later. It was listed as com.parallels.kext.ConnectUSB, which stood out among all the com.apple stuff. I had used <code>locate parallels<\/code> and missed the stuff that shows up with <code>locate Parallels<\/code> &#8211; I didn&#8217;t realize it was case sensitive. Hopefully this is the last bit.<\/em><\/p>\n<p>The problems seem to be gone now. Woo hoo! I can do my torture test with > 300 finder windows, eight Quicktime movies open and playing, and  DVD Player showing a movie behind a partially transparent Terminal window.<\/p>\n<p><strong>UPDATE #2:<\/strong><em>I continued to have crash problems after this point. I now believe that the Canon MX310 scanner driver was the problem. <a href=\"http:\/\/www.pervasivecode.com\/blog\/2008\/02\/22\/leopard-gui-crashes-not-parallels-but-canon\/\">More details are here<\/a>.<\/em><\/p>\n<p>I could have saved myself a lot of pain with <a href=\"http:\/\/docs.info.apple.com\/article.html?artnum=107120\">Archive and Install<\/a>, but I think I&#8217;m still coming out ahead due to the time saved by not having to reinstall and relicense dozens of applications. However, for mainstream users (who aren&#8217;t willing or able to go through this amount of troubleshooting effort) I strongly recommend using the Archive and Install when installing Leopard on a machine that currently has Tiger installed.<\/p>\n<p><b>Update #3: It was actually an intermittent hardware problem and Apple has replaced the logic board of this computer.<\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve had an average uptime over the last couple of months of approximately 48 hours on my MacBook Pro. This has been frustrating and very hard to diagnose, but I think I nailed it today.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,51],"tags":[],"class_list":["post-58","post","type-post","status-publish","format-standard","hentry","category-mac","category-parallels"],"_links":{"self":[{"href":"http:\/\/www.pervasivecode.com\/blog\/wp-json\/wp\/v2\/posts\/58"}],"collection":[{"href":"http:\/\/www.pervasivecode.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.pervasivecode.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.pervasivecode.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.pervasivecode.com\/blog\/wp-json\/wp\/v2\/comments?post=58"}],"version-history":[{"count":0,"href":"http:\/\/www.pervasivecode.com\/blog\/wp-json\/wp\/v2\/posts\/58\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.pervasivecode.com\/blog\/wp-json\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.pervasivecode.com\/blog\/wp-json\/wp\/v2\/categories?post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.pervasivecode.com\/blog\/wp-json\/wp\/v2\/tags?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}