title: How to throw an exception from C while using Android NDK?
body: <p>I have a random crash in my app deep inside the C++/C NDK layer. Backtraces are not helpful from Google Play Console. </p>
  
  <p>Here is the backtrace:</p>
  
  <pre><code>#00 pc 000000000004bba8 /system/lib/libc.so (tgkill+12) 
  #01 pc 000000000001aa13 /system/lib/libc.so (abort+54) 
  #02 pc 000000000001f2f9 /system/lib/libc.so (__libc_fatal+24) 
  #03 pc 000000000001aedd /system/lib/libc.so (__assert2+16) 
  </code></pre>
  
  <p>I am considering to change assert to in my assert wrapper to throw an exception instead.</p>
  
  <p>I saw suggestions from: <a href="https://stackoverflow.com/questions/2891766/how-to-throw-an-exception-in-c">How to throw an exception in C?</a> and not sure it's applicable for Android (portability to iOS as well.).</p>