title: Android v8 - works on ARM, crashes on x86
body: <p>I have an existing Android app that uses an embedded v8.  We have previously only built for ARM and are able to run without crashing.  Now we want to add x86 support.  I built a release version of v8 targeting x86 (and rebuilt my NDK code targeting x86) and my app crashed with an error from inside v8, so I rebuilt a debug version of v8 and used ndk-stack to get detailed error information:</p>
  
  <pre><code>03-29 19:31:59.257: E/v8(7626): #
  03-29 19:31:59.257: E/v8(7626): # Fatal error in src/api.h, line 453
  03-29 19:31:59.257: E/v8(7626): # 
  03-29 19:31:59.257: E/v8(7626): CHECK(entered_contexts_.length() == 0) failed
  03-29 19:31:59.257: E/v8(7626): #
  </code></pre>
  
  <p>In the version of v8 I am building, this is line 453:</p>
  
  <pre><code>ASSERT(entered_contexts_.length() == 0);
  </code></pre>
  
  <p>And here is the function it is part of for context:</p>
  
  <pre><code>  void Free() {
      ASSERT(blocks_.length() == 0);
      ASSERT(entered_contexts_.length() == 0);
      ASSERT(saved_contexts_.length() == 0);
      blocks_.Free();
      entered_contexts_.Free();
      saved_contexts_.Free();
      if (spare_ != NULL) {
        DeleteArray(spare_);
        spare_ = NULL;
      }
      ASSERT(call_depth_ == 0);
    }
  </code></pre>
  
  <p>It's certainly possibile that I somehow built v8 for x86 incorrectly, but I verified that v8 is initializing and interpreting scripts successfully prior to crashing (on x86), so I'm guessing that there is a problem with our code that uses v8 - maybe the ARM build is more forgiving than the x86 build?  </p>
  
  <p>Any ideas for how to isolate this issue?  Any ideas what could cause me to get into the assertion failure inside Free()? I don't think I am explicitly calling Free() anywhere, so I'm guessing this might be a garbage-collected object that is in an invalid state?  </p>
  
  <p>Thanks in advance for any input.</p>