Question

I have a single-activity native application which uses the NativeActivity class. If the application crashes it is restarted immediately. I have been searching the Internet the whole day for this problem.

This happens when using any of the following (SIGSEGV is signalled):
- assert() from assert.h
- __android_log_assert() from android/log.h
- abort() - pthread_exit()

I did some research:

https://stackoverflow.com/a/7387659
Didn't work, sending SIGKILL causes another SIGSEGV sent and the application is restarted.

https://stackoverflow.com/a/6121393/1374605
https://stackoverflow.com/a/2632649
I tried with only having one activity running. Am I missing something?

The restart also occurs when a JNI function (JNIEnv member) call throws and another JNI function is called without calling ExceptionClear() in between them. Has this something to do with the JVM?

Any ideas why the app is restarted after a crash and how can it be prevented?

UPDATE (logcat):

// Previous memory dump ended here

09-26 15:36:48.771: I/BootReceiver(2374): Copying /data/tombstones/tombstone_06 to DropBox (SYSTEM_TOMBSTONE)  
09-26 15:36:48.781: I/ActivityManager(2374): Process net.devenec.devengine.sample (pid 4750) has died.  
09-26 15:36:48.791: I/ActivityManager(2374): Start proc net.devenec.devengine.sample for activity net.devenec.devengine.sample/android.app.NativeActivity: pid=4763 uid=10075 gids={50075, 1028}  
09-26 15:36:48.801: D/Zygote(1953): Process 4750 terminated by signal (11)  
09-26 15:36:48.801: D/dalvikvm(4763): Late-enabling CheckJNI  
09-26 15:36:48.826: I/dalvikvm(4763): Turning on JNI app bug workarounds for target SDK version 9...  
09-26 15:36:48.841: W/Trace(4763): error opening trace file: No such file or directory (2)  
// My code starts here  
09-26 15:36:48.856: D/DevEngine(4763): [Application] Create  
09-26 15:36:48.856: A/libc(4763): source/android/AndroidApplication.cpp:141: static void Platform::Application::create(ANativeActivity*): assertion "false" failed  
09-26 15:36:48.856: A/libc(4763): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 4763 (evengine.sample)  
09-26 15:36:48.956: I/DEBUG(1950): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***  
09-26 15:36:48.956: I/DEBUG(1950): Build fingerprint: 'samsung/m3xx/m3:4.1.2/JZO54K/I9305XXBMA6:user/release-keys'  
09-26 15:36:48.956: I/DEBUG(1950): Revision: '2'  
09-26 15:36:48.956: I/DEBUG(1950): pid: 4763, tid: 4763, name: evengine.sample  >>> net.devenec.devengine.sample <<<  
09-26 15:36:48.956: I/DEBUG(1950): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad  

// Memory dump starts here

EDIT:

About marking this question as a duplicate, I have explained why this is different right after the first link. The solution did not work in my case.

Was it helpful?

Solution

On my Galaxy S III (stock ROM), apps don't restart automatically after crash. So maybe whether they restart depends on which ROM you use?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top