<?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>Shawn Wilsher &#187; Mozilla</title>
	<atom:link href="http://shawnwilsher.com/archives/category/mozilla/feed" rel="self" type="application/rss+xml" />
	<link>http://shawnwilsher.com</link>
	<description></description>
	<lastBuildDate>Fri, 05 Feb 2010 06:18:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>sdwilsh Status Update: 2010-02-05</title>
		<link>http://shawnwilsher.com/archives/377</link>
		<comments>http://shawnwilsher.com/archives/377#comments</comments>
		<pubDate>Fri, 05 Feb 2010 06:18:24 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[status]]></category>

		<guid isPermaLink="false">tag:weeklyupdates.benjamin.smedbergs.us,2009-10-05:sdwilsh:2010-02-05</guid>
		<description><![CDATA[
      
          
            Done: 
Work on bug 461199
Work on bug 542592 (learning oh so much about content/)
CMU career fair

          
          
            Next: 
Finish (no, really!) bug 461199and bug 542592

          
      
    ]]></description>
			<content:encoded><![CDATA[
      
          <div class="completed">
            <h4 class="posthead">Done:</h4> <ul>
<li>Work on <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=461199">bug 461199</a></li>
<li>Work on <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=542592">bug 542592</a> (learning oh so much about content/)</li>
<li>CMU career fair</li>
</ul>
          </div>
          <div class="planned">
            <h4 class="posthead">Next:</h4> <ul>
<li>Finish (no, really!) <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=461199">bug 461199</a>and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=542592">bug 542592</a></li>
</ul>
          </div>
      
    ]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/377/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sdwilsh Status Update: 2010-02-01</title>
		<link>http://shawnwilsher.com/archives/376</link>
		<comments>http://shawnwilsher.com/archives/376#comments</comments>
		<pubDate>Mon, 01 Feb 2010 11:09:10 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[status]]></category>

		<guid isPermaLink="false">tag:weeklyupdates.benjamin.smedbergs.us,2009-10-05:sdwilsh:2010-02-01</guid>
		<description><![CDATA[
      
          
            Done: 
Work on bug 461199

          
          
            Next: 
Work on bug 461199 and a career fair at CMU, so not much is going to get done.

          
          
            Coordination: 
Need review from dbaron ...]]></description>
			<content:encoded><![CDATA[
      
          <div class="completed">
            <h4 class="posthead">Done:</h4> <ul>
<li>Work on <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=461199">bug 461199</a></li>
</ul>
          </div>
          <div class="planned">
            <h4 class="posthead">Next:</h4> <ul>
<li>Work on <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=461199">bug 461199</a> and a career fair at CMU, so not much is going to get done.</li>
</ul>
          </div>
          <div class="tags">
            <h4 class="posthead">Coordination:</h4> <ul>
<li>Need review from dbaron on <a href="https://bugzilla.mozilla.org/attachment.cgi?id=423681">attachment 423681</a> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=461199">bug 461199</a>)</li>
</ul>
          </div>
      
    ]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/376/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sdwilsh Status Update: 2010-01-23</title>
		<link>http://shawnwilsher.com/archives/375</link>
		<comments>http://shawnwilsher.com/archives/375#comments</comments>
		<pubDate>Sat, 23 Jan 2010 10:22:18 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[status]]></category>

		<guid isPermaLink="false">tag:weeklyupdates.benjamin.smedbergs.us,2009-10-05:sdwilsh:2010-01-23</guid>
		<description><![CDATA[
      
          
            Done: 
Hammered away on getting tests passing on bug 461199
Created &#34;New Tabs at the End&#34; add-on for the support team
Created a control flow diagram of how mozilla::IHistory and mozilla::dom::Link interact to he...]]></description>
			<content:encoded><![CDATA[
      
          <div class="completed">
            <h4 class="posthead">Done:</h4> <ul>
<li>Hammered away on getting tests passing on <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=461199">bug 461199</a></li>
<li>Created <a href="https://addons.mozilla.org/en-US/firefox/addon/61766">&quot;New Tabs at the End&quot;</a> add-on for the support team</li>
<li><a href="https://bugzilla.mozilla.org/attachment.cgi?id=423103">Created a control flow diagram</a> of how mozilla::IHistory and mozilla::dom::Link interact to help other folks understand</li>
</ul>
          </div>
          <div class="planned">
            <h4 class="posthead">Next:</h4> <ul>
<li>Finish up <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=461199">bug 461199</a></li>
<li>Start working on <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=536978">bug 536978</a> (async cookie writing)</li>
<li>Refine <a href="https://wiki.mozilla.org/Firefox/Goals/2010Q1/IO_Reduction_Criteria">IO reduction goal criteria</a> to hit more common tasks</li>
</ul>
          </div>
          <div class="tags">
            <h4 class="posthead">Coordination:</h4> <ul>
<li>Need <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=540896">bug 540896</a> completed by releng before I can complete <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=461199">bug 461199</a></li>
<li>Need review from dbaron on <a href="https://bugzilla.mozilla.org/attachment.cgi?id=421905&amp;action=edit">attachment 421905</a> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=461199">bug 461199</a>)</li>
<li>Need review from sicking on <a href="https://bugzilla.mozilla.org/attachment.cgi?id=423032&amp;action=edit">attachment 423032</a> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=461199">bug 461199</a>)</li>
</ul>
          </div>
      
    ]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/375/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sdwilsh Status Update: 2010-01-15</title>
		<link>http://shawnwilsher.com/archives/374</link>
		<comments>http://shawnwilsher.com/archives/374#comments</comments>
		<pubDate>Fri, 15 Jan 2010 16:52:47 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[status]]></category>

		<guid isPermaLink="false">tag:weeklyupdates.benjamin.smedbergs.us,2009-10-05:sdwilsh:2010-01-15</guid>
		<description><![CDATA[
      
          
            Done: 
Q1 I/O Reduction goal page up and running (https://wiki.mozilla.org/Firefox/Goals/2010Q1/IO_Reduction) with numbers and bugs
Review queue neutralized
Bug 461199 (async visited checks) nearly ready.  Working on fixi...]]></description>
			<content:encoded><![CDATA[
      
          <div class="completed">
            <h4 class="posthead">Done:</h4> <ul>
<li>Q1 I/O Reduction goal page up and running (https://wiki.mozilla.org/Firefox/Goals/2010Q1/IO_Reduction) with numbers and bugs</li>
<li>Review queue neutralized</li>
<li>Bug 461199 (async visited checks) nearly ready.  Working on fixing last remaining failing tests.  Two more issues remain to be fixed (other than tests).</li>
</ul>
          </div>
          <div class="planned">
            <h4 class="posthead">Next:</h4> <ul>
<li>Finish up bug 461199 (bit of a stretch, but we'll see if it can happen)</li>
</ul>
          </div>
      
    ]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/374/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NetUtil.jsm Just Got More Useful</title>
		<link>http://shawnwilsher.com/archives/366</link>
		<comments>http://shawnwilsher.com/archives/366#comments</comments>
		<pubDate>Tue, 29 Dec 2009 19:21:56 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[asynchronous]]></category>
		<category><![CDATA[NetUtil]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=366</guid>
		<description><![CDATA[Recently, a few bugs have landed enabling a bunch of nice things for consumers of NetUtil.jsm:

NetUtil.newURI can take a string (plus optional character set and base URI) or an nsIFile.
A new method for creating channels has been created.  NetUtil.newChannel can take an nsIURI, a string (plus optional character set and base URI), or an [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=532143" title="NetUtil.newURI should take a string or nsIFile">a</a> <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=532146" title="NetUtil.jsm needs a helper for creating new channels">few</a> <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=532147" title="NetUtil.asyncFetch should take an nsIURI, string, nsIFile, or nsIChannel">bugs</a> have landed enabling a bunch of nice things for consumers of <tt>NetUtil.jsm</tt>:</p>
<ul>
<li><tt>NetUtil.newURI</tt> can take a string (plus optional character set and base URI) or an <tt>nsIFile</tt>.</li>
<li>A new method for creating channels has been created.  <tt>NetUtil.newChannel</tt> can take an <tt>nsIURI</tt>, a string (plus optional character set and base URI), or an <tt>nsIFile</tt>.</li>
<li><tt>NetUtil.asyncFetch</tt> can take an <tt>nsIChannel</tt>,  an <tt>nsIURI</tt>, a string (plus optional character set and base URI), or an <tt>nsIFile</tt>.</li>
</ul>
<p>This means, among other things, that it now requires less code to read a file asynchronously than it does synchronously.  The old way to do this asynchronously <a href="https://developer.mozilla.org/en/Code_snippets/File_I%2f%2fO#Asynchronously" title="Asynchronously Reading a File">can be seen here on MDC</a>.  This would give the consumer a byte array of the data in the file.  Compared to the synchronous case, which <a href="https://developer.mozilla.org/index.php?title=en/Code_snippets/File_I%2F%2FO#Simple" title="Synchronously Reading a File">can be seen here</a>.  Both are pretty verbose and clunky to use.  The new way looks like this:</p>
<pre><code>
NetUtil.asyncFetch(file, function(aInputStream, aResult) {
  if (!Components.isSuccessCode(aResult)) {
    // Handle Error
    return;
  }
  // Consume input stream
});
</code></pre>
<p>One function call, with a callback passed in.  There is a slight difference from the old asynchronous method, however.  <tt>NetUtil.asyncFetch</tt> gives the consumer an <tt>nsIInputStream</tt> instead of a byte array.  The input stream is a bit more useful than a raw byte array, although it can be painful to use in JavaScript at times (maybe we need an easy method to convert an input stream to a string?).  I look forward to patches using this method to read files instead of doing it synchronously.</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/366/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Bugzilla Helper 0.3.0</title>
		<link>http://shawnwilsher.com/archives/364</link>
		<comments>http://shawnwilsher.com/archives/364#comments</comments>
		<pubDate>Tue, 01 Dec 2009 17:50:38 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Bugzilla Helper]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[Thunderbird]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=364</guid>
		<description><![CDATA[Version 0.3 of the Bugzilla Helper Add-on for Thunderbird has been released!  Current users will have to update manually since sandboxed add-ons do not automatically update.  New in this version:

Use version 0.3 of the REST API.
Enable spell checking in the comment field.
Allow replying to New: bugmail.
Offline support.

Found a bug?  E-mail me or [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://addons.mozilla.org/en-US/thunderbird/addon/45501/">Version 0.3 of the Bugzilla Helper Add-on for Thunderbird has been released</a>!  Current users will have to update manually since sandboxed add-ons do not automatically update.  New in this version:</p>
<ul>
<li>Use version 0.3 of the REST API.</li>
<li>Enable spell checking in the comment field.</li>
<li>Allow replying to New: bugmail.</li>
<li>Offline support.</li>
</ul>
<p>Found a bug?  E-mail me or leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/364/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Raindrop on Dreamhost</title>
		<link>http://shawnwilsher.com/archives/352</link>
		<comments>http://shawnwilsher.com/archives/352#comments</comments>
		<pubDate>Thu, 19 Nov 2009 01:28:36 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[Raindrop]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=352</guid>
		<description><![CDATA[It turns out that installing Raindrop is really hard.  Here&#8217;s what I didtried to get it running on Dreamhost.  Hope it helps anyone else who wants to play around with it, and I hope they can get further than I did.
Directory structure
In my home directory, I created a new folder called opt.
mkdir opt
You&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>It turns out that installing Raindrop is really hard.  Here&#8217;s what I <strike>did</strike>tried to get it running on Dreamhost.  Hope it helps anyone else who wants to play around with it, and I hope they can get further than I did.</p>
<h3>Directory structure</h3>
<p>In my home directory, I created a new folder called opt.<br />
<code>mkdir opt</code><br />
You&#8217;ll also want to add the following lines to your .bashrc file:<br />
<code>export CFLAGS="-I$HOME/opt/include -L$HOME/opt/lib $CFLAGS"<br />
export CXXFLAGS="-I$HOME/opt/include -L$HOME/opt/lib $CXXFLAGS"</code><br />
I also created a sources directory, where I&#8217;ll be putting all of my source files in.<br />
<code>mkdir sources</code><br />
We&#8217;ll want to be in the sources directory as we install everything.<br />
<code>cd sources</code></p>
<h3>Installation Fun</h3>
<h4>Install python</h4>
<p><code>wget http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tgz<br />
tar xvfz Python-2.6.4.tgz<br />
cd Python-2.6.4<br />
./configure --prefix=/home/sdwilsh/opt/<br />
make<br />
make install<br />
</code></p>
<h4>Install OpenSSL</h4>
<p>After you get the source from a mirror and untar it, enter that directory, and run these commands:<br />
<code>./config --prefix=/home/sdwilsh/opt --openssldir=/home/sdwilsh/opt/openssl shared<br />
make<br />
make install</code></p>
<h4>Install Erlang</h4>
<p>Note: I had to bump my memory on my PS up to 304 MB (from 150 MB) in order for this to compile.  I just doubled it, so you may be able to get by with less.  This also takes a while to install.<br />
<code>wget http://erlang.org/download/otp_src_R13B02-1.tar.gz<br />
tar xvfz otp_src_R13B02-1.tar.gz<br />
cd otp_src_R13B02-1<br />
./configure --prefix=/home/sdwilsh/opt/ --with-ssl=/home/sdwilsh/opt/<br />
make<br />
make install</code></p>
<h4>Install ICU</h4>
<p><code>wget http://download.icu-project.org/files/icu4c/4.2.1/icu4c-4_2_1-src.tgz<br />
tar xvfz icu4c-4_2_1-src.tgz<br />
cd icu/<br />
chmod +x runConfigureICU configure install-sh<br />
./runConfigureICU Linux --prefix=/home/sdwilsh/opt<br />
make<br />
make check<br />
make install</code></p>
<h4>Install autoconf-2.13</h4>
<p><code>wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz<br />
tar xvfz autoconf-2.13.tar.gz<br />
./configure --prefix=/home/sdwilsh/opt/<br />
make<br />
make install</code></p>
<h4>Install Spidermonkey</h4>
<p>Note: You many need to install Mercurial.  I used <tt>easy_install</tt> to do.<br />
<code>hg clone http://hg.mozilla.org/releases/mozilla-1.9.2/<br />
cd mozilla-1.9.2/<br />
hg update -r FIREFOX_3_6b3_RELEASE<br />
cd js/src/<br />
autoconf<br />
mkdir build-release<br />
cd build-release<br />
../configure --prefix=/home/sdwilsh/opt/<br />
make<br />
make install</code></p>
<h4>Install libssh2</h4>
<p><code>wget http://www.libssh2.org/download/libssh2-1.2.2.tar.gz<br />
tar xvfz libssh2-1.2.2.tar.gz<br />
cd libssh2-1.2.2<br />
./configure --prefix=/home/sdwilsh/opt/  --with-openssl<br />
make<br />
make install</code></p>
<h4>Install curl</h4>
<p>After you get the source from a mirror and untar it, enter that directory, and run these commands:<br />
<code>cd curl-7.19.7<br />
./configure --prefix=/home/sdwilsh/opt/ --with-libssh2=/home/sdwilsh/opt --with-ssl=/home/sdwilsh/opt<br />
make<br />
make install</code></p>
<h4>Install couchdb</h4>
<p>After you get the source from a mirror and untar it, enter that directory, and run these commands:<br />
<code>./configure --prefix=/home/sdwilsh/opt/ --with-erlang=/home/sdwilsh/sources/otp_src_R13B02-1/include --with-js-include=/home/sdwilsh/opt/include --with-js-lib=/home/sdwilsh/opt/lib --with-erlang=/home/sdwilsh/opt/lib/erlang/usr/include<br />
make<br />
make install</code><br />
Note: I feel like I may have messed up how I installed erlang given the strange place it put its header files, but I wasn&#8217;t about to recompile it.</p>
<h3>Change Permissions &#038; Run</h3>
<p>CouchDB suggests you create a new user for to run it is, but this is hard to do it seems, so I skipped it.  I did change the permissions, however.<br />
<code>chmod -R 0770 /home/sdwilsh/opt/etc/couchdb<br />
chmod -R 0770 /home/sdwilsh/opt/var/lib/couchdb<br />
chmod -R 0770 /home/sdwilsh/opt/var/log/couchdb<br />
chmod -R 0770 /home/sdwilsh/opt/var/run/couchdb</code></p>
<p>And now to run CouchDB:<br />
<code>couchdb -b</code><br />
Sadly, this was taking something close to 500MB of memory.  This is far to high for my server to sustain, so I haven&#8217;t gotten any further.  If anyone has any ideas, I&#8217;d be glad to hear them.</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/352/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bugzilla Helper 0.2.0</title>
		<link>http://shawnwilsher.com/archives/350</link>
		<comments>http://shawnwilsher.com/archives/350#comments</comments>
		<pubDate>Thu, 05 Nov 2009 18:14:16 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[asynchronous]]></category>
		<category><![CDATA[Bugzilla Helper]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[Thunderbird]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=350</guid>
		<description><![CDATA[I just uploaded Bugzilla Helper 0.2.0.  This improves on the last release by making making the submission of comments an asynchronous operation.  It also uses the activity manager in Thunderbird to track the process of the submission, and retry it if an error occurs.
There are still some apparent issues with the REST API [...]]]></description>
			<content:encoded><![CDATA[<p>I just uploaded Bugzilla Helper 0.2.0.  This improves on <a href="http://shawnwilsher.com/archives/332">the last release</a> by making making the submission of comments an asynchronous operation.  It also uses the activity manager in Thunderbird to track the process of the submission, and retry it if an error occurs.</p>
<p>There are still some apparent issues with the REST API that the add-on is using, and I&#8217;ll likely include some workaround in upcoming versions.  <a href="https://addons.mozilla.org/en-US/thunderbird/addon/45501">0.2.0 is available on addons.mozilla.org</a> and is a recommended upgrade.  Current users will have to update since sandboxed add-ons do not automatically update.</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/350/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Crash!  Boom!  Bang!  But I just wanted to delete some history&#8230;</title>
		<link>http://shawnwilsher.com/archives/338</link>
		<comments>http://shawnwilsher.com/archives/338#comments</comments>
		<pubDate>Fri, 30 Oct 2009 22:31:00 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[CrashKill]]></category>
		<category><![CDATA[mozStorage]]></category>
		<category><![CDATA[overflow]]></category>
		<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=338</guid>
		<description><![CDATA[If you&#8217;ve been experiencing crashes when trying to delete a large set of history, I have great news for you!  We&#8217;ve identified the issue, and a fix will be coming to you shortly!

Background
This fix wouldn&#8217;t be in our hands if it was for the recent CrashKill effort here at Mozilla.  Sam Sidler gave [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve been experiencing crashes when trying to delete a large set of history, I have great news for you!  We&#8217;ve identified the issue, and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=523405">a fix will be coming to you</a> shortly!<br />
<span id="more-338"></span></p>
<h3>Background</h3>
<p>This fix wouldn&#8217;t be in our hands if it was for the recent <a href="https://wiki.mozilla.org/CrashKill">CrashKill</a> effort here at Mozilla.  Sam Sidler gave me <a href="https://wiki.mozilla.org/CrashKill/Signatures/Storage">a link to a list of crashes</a> that were reported to us during a 24 hour period in SQLite and mozStorage code.  I immediately started adding links to crash reports and filing bugs to some of the more frequent crashes so we could start tracking these issues.  I also informed the SQLite team about this page in case they found the data useful, and they sure did.  They started to look into <a href="http://crash-stats.mozilla.com/report/list?product=Firefox&#038;query_search=signature&#038;query_type=exact&#038;query=sqlite3VdbeExec&#038;date=&#038;range_value=1&#038;range_unit=weeks&#038;do_query=1&#038;signature=sqlite3VdbeExec">this particular crash</a>.  It turns out that there are <a href="http://crash-stats.mozilla.com/report/list?product=Firefox&#038;query_search=signature&#038;query_type=exact&#038;query=sqlite3Step&#038;date=&#038;range_value=1&#038;range_unit=weeks&#038;do_query=1&#038;signature=sqlite3Step">two</a> <a href="http://crash-stats.mozilla.com/report/list?product=Firefox&#038;query_search=signature&#038;query_type=exact&#038;query=sqlite3DbMallocRaw&#038;date=&#038;range_value=1&#038;range_unit=weeks&#038;do_query=1&#038;signature=sqlite3DbMallocRaw">other</a> signatures that are actually the same crash, but show up differently due to compiler optimizations causing differences in the generated program.</p>
<h3>Fix Details</h3>
<p>SQLite has a virtual machine that processes queries.  The virtual machine is register-based, which is different from the usual stack-based virtual machines you might encounter with Java.  This particular crash would surface when a SQL query used an <tt>IN</tt> operator with more than ~32 thousand entries on its right-hand side and the <tt>EXISTS</tt> expression.  If either of these conditions occurred on their own, SQLite could handle this just fine.  The <tt>IN</tt> operator stores each entry in a register, and when processing the <tt>EXISTS</tt> expression, SQLite would store the number of the register in which an expression was written into into a 16-bit integer on an <tt>Expr</tt> object.  However, once you try to write a number greater than 32,767 to a 16-bit integer, you get <a href="http://en.wikipedia.org/wiki/Arithmetic_overflow">overflow</a> and you will likely end up with a negative number.  This negative number was then used to index into an array, which is all sorts of bad (and led to the crash).</p>
<p>The workaround fix is to just use a 32-bit integer for now.  This means this issue will not happen unless you have over 2,147,483,647 entries on the right-hand side of the <tt>IN</tt> operator.  You&#8217;d hit other limitations of SQLite before that would ever happen, so overflow is no longer a concern.  The SQLite team is going to do a more complicated fix which stores the value separately from <tt>Expr</tt> object it was previously stored in.  The <tt>Expr</tt> object is used a lot, so they don&#8217;t want a long-term solution that increases memory usage.</p>
<p>You might be surprised that such a small and trivial seeming bug got through.  This type of bug is more common than you might think, and overflow bugs have even <a href="http://en.wikipedia.org/wiki/Ariane_5_Flight_501">caused the destruction of an Ariane 5 rocket</a>.  It&#8217;s an unfortunate reality of software that sometimes these edge cases get missed, but we must always try to remain vigilant.</p>
<p><em>Special thanks to the SQLite team for investigating this fix, and providing information for this blog post.</em><br />
<small><a href="http://rypple.com/sdwilsh/sqlite-op-if-crash-writeup">Provide anonymous feedback on this post with Rypple.</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/338/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hostility</title>
		<link>http://shawnwilsher.com/archives/335</link>
		<comments>http://shawnwilsher.com/archives/335#comments</comments>
		<pubDate>Thu, 29 Oct 2009 04:14:55 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[foul language]]></category>
		<category><![CDATA[hostile]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=335</guid>
		<description><![CDATA[I see some members of our community are taking lessons from hostile, abusive, rude community members.  Come on folks &#8211; really?  Can&#8217;t we all play nice, or do we really have to resort to cursing in posts to get our point across?  I don&#8217;t want to read a rant complete with foul [...]]]></description>
			<content:encoded><![CDATA[<p>I see some members of our community are taking lessons from <a href="http://groups.google.com/group/mozilla.dev.planning/msg/b2d466e9f5364b44">hostile, abusive, rude community members</a>.  Come on folks &#8211; really?  Can&#8217;t we all play nice, or do we really have to resort to cursing in posts to get our point across?  I don&#8217;t want to read a rant complete with foul language anymore than I want to have my teeth pulled, and I bet lots of others feel the same way.</p>
<p>Please think twice before publishing/committing something.  Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/335/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.283 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-02-09 02:48:45 -->
