title: Invalid heap address and fatal signal 11
body: <p>Every so often my app will crash and my log will read:</p>
  
  <pre><code>@@@ ABORTING: INVALID HEAP ADDRESS IN dlfree
  Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
  </code></pre>
  
  <p>Sometimes <code>code=2</code>, but always <code>Fatal signal 11</code> and <code>invalid heap address</code>.</p>
  
  <p>I've tried researching what this means and how to fix it. <a href="https://stackoverflow.com/q/4973310/420015">This thread has been the most helpful</a>; however, I'm still without a solution. </p>
  
  <p>The error occurs when I run a couple of <code>AsyncTasks</code> to download several images.</p>
  
  <p>This is my main <code>AsyncTask</code></p>
  
  <pre><code>public class FetchArtistImages extends AsyncTask&lt;Void, Integer, String[]&gt; implements Constants {
  
  private final WeakReference&lt;Context&gt; contextReference;
  
  public FetchArtistImages(Context context) {
      contextReference = new WeakReference&lt;Context&gt;(context);
  }
  
  @Override
  protected String[] doInBackground(Void... params) {
      String[] projection = new String[] {
              Audio.Artists._ID, Audio.Artists.ARTIST
      };
      String sortOrder = Audio.Artists.DEFAULT_SORT_ORDER;
      Uri uri = Audio.Artists.EXTERNAL_CONTENT_URI;
      Cursor c = contextReference.get().getContentResolver()
              .query(uri, projection, null, null, sortOrder);
      ArrayList&lt;String&gt; artistIds = new ArrayList&lt;String&gt;();
      if (c != null) {
          int count = c.getCount();
          if (count &gt; 0) {
              final int ARTIST_IDX = c.getColumnIndex(Audio.Artists.ARTIST);
              for (int i = 0; i &lt; count; i++) {
                  c.moveToPosition(i);
                  artistIds.add(c.getString(ARTIST_IDX));
              }
          }
          c.close();
          c = null;
      }
      return artistIds.toArray(new String[artistIds.size()]);
  }
  
  @Override
  protected void onPostExecute(String[] result) {
      for (int i = 0; i &lt; result.length; i++) {
              new LastfmGetArtistImages(contextReference.get()).executeOnExecutor(
                      AsyncTask.THREAD_POOL_EXECUTOR, result[i]);
      }
      super.onPostExecute(result);
  }
  </code></pre>
  
  <p>Even though I've tried researching what's up with this, I still find myself lost when it comes to fixing it. If anyone has some insight, I'd definitely appreciate seeing it. The error isn't thrown every time I <code>execute</code> my <code>AsyncTasks</code>, but I can't find much of a pattern to help isolate why this is occurring. There are a couple of other threads on SO about <code>fatal signal 11</code>, but they don't provide much help in my case.</p>