title: Fatal signal 11 (SIGSEGV)
body: <p>I have a weird error and I can't find where it comes from. The only thing that appears in the logcat is :</p>
  
  <p><code>01-10 17:07:10.665: A/libc(20449): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)</code></p>
  
  <p>I don't get this error right away when I run my app, I get it after a random amount of time (something between 1 min to 5 min). I'm unable to reproduce this error, it seems random and since there are no other informations it's hard to debug. I tried to add some log informations to my library but I still can't say where the crash occurs.</p>
  
  <p>I ran the same app x times and I got different SIGSEGV address (sometimes it was the same address as before :</p>
  
  <p><code>01-10 17:29:04.650: A/libc(21588): Fatal signal 11 (SIGSEGV) at 0x6c707063 (code=1)</code></p>
  
  <p><code>01-10 17:25:55.165: A/libc(21473): Fatal signal 11 (SIGSEGV) at 0x0069004c (code=1)</code></p>
  
  <p><code>01-10 17:11:58.780: A/libc(20742): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)</code></p>
  
  <p><code>01-10 17:00:02.010: A/libc(20160): Fatal signal 11 (SIGSEGV) at 0x00000018 (code=1)</code></p>
  
  <p>My app is using a c++ library that has a NetworkThread that receives updates from a server. On the Java side there's a WorkerThread that check is there's new updates from the NetworkThread and if there's new updates it notifies all the listeners. I also have a LocationSpotter (on the Java side) that makes some JNI calls when the location is updated.</p>
  
  <p>Is there a way to debug this or to use the addresses I got from the SIGSEGV to debug the app ? Also I'm using a shared JavaVM object for some methods to retrieve the current JNIEnv (and call AttachCurrentThread). Is that thread safe ?</p>
  
  <p>I noticed that I still receive updates from the NetworkThread after I got the SIGSEGV error (before the app actually crashes). That means the NetworkThread is probably working.</p>
  
  <p>I also noticed a line that could be the source of my problem (in the notifyAll method) because the last message printed before SIGSEGV is "notifyAll1" :</p>
  
  <pre><code>for (unsigned i = 0; i &lt; listeners.size(); i++) {
      try {
          __android_log_print(ANDROID_LOG_INFO, "FROM C++", "notifyAll1");
          if (listeners.at(i) == NULL)
              __android_log_print(ANDROID_LOG_INFO, "FROM C++", "LISTENER NULL");
  
  
          listeners.at(i)-&gt;update(u); // &lt;- This line is a potential suspect
          __android_log_print(ANDROID_LOG_INFO, "FROM C++", "notifyAll2");
  </code></pre>
  
  <p>The logcat :</p>
  
  <pre><code>01-10 17:07:10.665: I/FROM C++(20449): notifyAll1
  01-10 17:07:10.665: A/libc(20449): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
  </code></pre>
  
  <p>I tried then to print a log in the first line of each listener's <code>update</code> method but none of them is printed (which is really weird I think).</p>
  
  <p>Any help will be greatly appreciated</p>