diff --git a/doc/index.html b/doc/index.html
index fe6f4f1..4aa2480 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -184,7 +184,7 @@ regular rsa key for greatest compatibility.
Change Log
-- 2019/08/11 Version 21: Fix restarting after a crash.
+
- 2019/08/11 Version 21: Fix restarting after a crash. Fix SIGSEGV on some Android 9 devices.
- 2019/06/16 Version 20: Update SDK. Support x86_64, arm64.
Fix finding support libraries. Fix colors again. Fix start-on-boot on
new Android. Update to dropbear 2019.78.
diff --git a/jni/interface.c b/jni/interface.c
index 54583d6..fd4bfe4 100644
--- a/jni/interface.c
+++ b/jni/interface.c
@@ -116,6 +116,16 @@ from_java_string(jobject s)
return ret;
}
+
+/* this makes sure that no previously-added atexit gets called (some users have
+ * an atexit registered by libGLESv2_adreno.so */
+static void
+null_atexit(void)
+{
+ _Exit(0);
+}
+
+
JNIEXPORT jint JNICALL
Java_org_galexander_sshd_SimpleSSHDService_start_1sshd(JNIEnv *env_,
jclass cl,
@@ -146,6 +156,8 @@ Java_org_galexander_sshd_SimpleSSHDService_start_1sshd(JNIEnv *env_,
int retval;
int i;
+ atexit(null_atexit);
+
logfn = conf_path_file("dropbear.err");
logfn_old = conf_path_file("dropbear.err.old");
unlink(logfn_old);