<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Stabbymonkey.org &#187; mdworker</title>
	<atom:link href="http://www.stabbymonkey.org/archives/tag/mdworker/feed" rel="self" type="application/rss+xml" />
	<link>http://www.stabbymonkey.org</link>
	<description>Flash, Games, Movies, and Monkeys with Knives.</description>
	<lastBuildDate>Fri, 04 Dec 2009 02:41:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Problems with mdworker and ReportCrash in OS X: audio.mdimporter</title>
		<link>http://www.stabbymonkey.org/archives/66</link>
		<comments>http://www.stabbymonkey.org/archives/66#comments</comments>
		<pubDate>Thu, 24 Sep 2009 07:11:08 +0000</pubDate>
		<dc:creator>Mantic</dc:creator>
				<category><![CDATA[osx]]></category>
		<category><![CDATA[audio.mdimporter]]></category>
		<category><![CDATA[mdworker]]></category>
		<category><![CDATA[reportcrash]]></category>

		<guid isPermaLink="false">http://www.stabbymonkey.org/?p=66</guid>
		<description><![CDATA[Long story short: mdworker and audio.mdimporter crash with bad mp3 headers.]]></description>
			<content:encoded><![CDATA[<p>SO, I just spent the last 2 hours trying to debug a weird system behavior in OS X 10.5.8. Basically it goes something like this:</p>
<p>1. I noticed my computer was abnormally warm.</p>
<p>2. My battery was draining faster than normal.</p>
<p>3. A mysterious process called ReportCrash was opening, eating 60-90% of my CPU, and closing. It did this about every 3-5 seconds.</p>
<p>4. Likewise, another process kept opening and closing at the same interval: mdworker (owned by me, not by root)</p>
<p>5. I looked into the system logs (using Console) and saw that a log file was being generated for each crash report (from mdworker, apparently).</p>
<p>6. After some google research, mdworker is one of the apps in charge of indexing the hdd (with spotlight)</p>
<p>7. Looking into the crash logs:</p>
<p>It appears that &#8220;mdworker&#8221; hits a divide by zero error &#8220;EXC_I386_DIV (divide by zero)&#8221; running &#8220;MPEGAudioFile::ParseAudioFile()&#8221; from &#8220;/System/Library/Spotlight/Audio.mdimporter/Contents/MacOS/Audio&#8221;</p>
<p>8. I found an error in the logs reporting that an audio codec (/Library/Audio/Plug-Ins/HAL/DVCPROHDAudio.plugin) couldn&#8217;t be loaded because it was the wrong architecture. I removed the plugin and rebooted. No effect. <img src='http://www.stabbymonkey.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>9. Just a few days ago, I hit a snag trying to open a movie compressed with the DVCPRO HD codec.  Comparing the date of the plugin file (in #8) and version (2004 and 1.1) with the same file on a computer that has Final Cut Pro, I regain hope! The file on the Final Cut Pro computer is dated 2007 and is version 1.3. Replacing the old file w/ the new one, I rebooted. &#8230;. No plugin crashes reported in the logs!  But no effect on mdworker and Audio.mdimporter is still dividing by zero. <img src='http://www.stabbymonkey.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />   If only I could get what file it&#8217;s crashing on!</p>
<p>10. Well, after searching more forums, I learned that you can omit certain folders from Spotlight&#8217;s grasp through its preference pane. I have a work project that contains over 5,000 audio files. This problem started the same day I updated the project and downloaded all 5k files. Making that folder Private (from Spotlight) seemed to fix it immediately!</p>
<p>I still don&#8217;t know what the problem was, but I think it was some bad mp3 file in the project tree. A divide by zero error can be avoided in code with a simple check! Now if only I could convince Apple to fix the bug&#8230;.</p>
<p>Total time spent: 3 hours.</p>
<p><strong><span style="font-size:150%">UPDATE 2009 10 07</span></strong>  After filing a bug with Apple, I got the response that the problem is fixed in OSX 10.6. That&#8217;s about it. Upgrade to Snow Leopard if you want the proper fix.</p>
<p><strong><span style="font-size:150%">UPDATE 2009 11 2 </span></strong>  I figured out that you can manually call the mdimporter application, which will crash on the bad file. Run it with the following:</p>
<p>mdimport -d 2 /path/to/suspect/directory</p>
<p>Don&#8217;t just run it from root, it will take FOREVER. Also, when it does crash, note the last file it outputs to the terminal window. That isn&#8217;t the file at fault. If you navigate to the directory in Finder and list the files in a single column, it&#8217;ll be the following file.</p>
<p>One way to verify if a file is at fault, is to set Finder to Column view, and single click on the suspected file. If, in the details in the next column, you don&#8217;t see the mp3&#8217;s length, bitrate, etc, then that is a bad file. To fix it, try re-exporting it with moderate setting for the bitrate. My files at fault were about 0.5 seconds long, and had a bitrate of about 57 Mb/sec! Capping them at 1200 kb/s fixed the problem.</p>
<p><strong><span style="font-size:150%">UPDATE 2009 11 19</span></strong> Ok, the results are in! All of my problems were caused by bad mp3 headers. If you reconstruct / replace the headers then that will most likely fix the problem. You don&#8217;t have to actually re-encode or re-export the mp3 files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stabbymonkey.org/archives/66/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
