Open flymarq opened 2 days ago
Does it also crash if you are offline?
No!
Good idea, this way I can make backup and safe the current messages.
Do you have multiple accounts? It is probably crashing while accessing one of the accounts over the network or trying to process one of the recently received messages. You can try to figure out which account it is and remove some of the recently received messages from the server.
No. I have only one account configured.
But keep in mind: the configuration is 5 years old. If I changed the phone I used a deltachat backup to reinitialize deltachat on the new phone.
I suspect you have recently received some message that makes the core crash, and this may not be related to 1.48.3 upgrade. So removing some recent messages from the server over IMAP or web interface could help, then Delta Chat will not download them anymore and stop crashing. Would be nice to figure out what exact message it is, but at least this should make Delta Chat usable again for you. If you move the last week of messages out of the server and start uploading them one by one with Thunderbird, you can find which message is the problem.
I run my own IMAP-server (dovecot):
new
is empty)not
fix the crashIf you can export a backup, can you also import it into another version, like older F-Droid or the latest nightly (https://download.delta.chat/android/nightly/2024-11-16/) and see if it crashes?
Maybe the crash is related to the recently introduced IMAP COMPRESS support.
You can try to set minimal capabilities (excluding COMPRESS=DEFLATE
) in Dovecot config, restart Dovecot and see if Delta Chat stops crashing:
imap_capability = IMAP4rev1 IDLE MOVE QUOTA CONDSTORE
Minimal capabilities with imap_capability = IMAP4rev1 IDLE MOVE QUOTA CONDSTORE
still crashes.
Updating to https://download.delta.chat/android/nightly/2024-11-17/841c1d7f-foss-debug-1.48.3.apk DeltaChat still crashes.
Downgrading to FDroid Versions 1.46.14 or 1.46.13 also crashes with the same stack trace.
Deinstalling the app, reinstalling it and load the backup crashes too.
Tested with FDroid Version 1.48.3 and nichtly version 2024-11-17.
Are any values in the sqlite database in the backup of your interest?
I can try to build an .apk with debug symbols that produces proper stack traces with function names. Then you can load the backup there and capture the stack trace like in the first post but with actual function names instead of the addresses.
If you can build the core with Rust locally, a simpler way would be to download the source from https://github.com/deltachat/deltachat-core-rust/ and run cargo run --locked -p deltachat-repl -- deltachat.db
, then import a backup using the import-backup
command and run connect
.
I am still trying to build .apk with non-stripped symbols.
I managed to build unstripped .apk with these modifications:
diff --git a/build.gradle b/build.gradle
index 75e462c9a..5fee92da3 100644
--- a/build.gradle
+++ b/build.gradle
@@ -59,8 +59,9 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
+ doNotStrip "**/*.so"
jniLibs {
- keepDebugSymbols += ['*/mips/*.so', '*/mips64/*.so']
+ keepDebugSymbols += ['**/*.so']
}
resources {
excludes += ['LICENSE.txt', 'LICENSE', 'NOTICE', 'asm-license.txt', 'META-INF/LICENSE', 'META-INF/NOTICE']
diff --git a/jni/Application.mk b/jni/Application.mk
index c6d1bbbd4..70170b12b 100644
--- a/jni/Application.mk
+++ b/jni/Application.mk
@@ -5,4 +5,5 @@ APP_STL := none
ifneq ($(NDK_DEBUG),1)
APP_CFLAGS += -Oz -flto=full -fno-unwind-tables -fno-exceptions -fno-asynchronous-unwind-tables -fomit-frame-pointer
APP_LDFLAGS += -flto=full
+APP_STRIP_MODE := none
endif
diff --git a/jni/deltachat-core-rust b/jni/deltachat-core-rust
--- a/jni/deltachat-core-rust
+++ b/jni/deltachat-core-rust
@@ -1 +1 @@
-Subproject commit 88278fc826c7611f6d3fb30c57e4c8f4e95b8d05
+Subproject commit 88278fc826c7611f6d3fb30c57e4c8f4e95b8d05-dirty
diff --git a/scripts/ndk-make.sh b/scripts/ndk-make.sh
index 90bf70ac2..340ecd463 100755
--- a/scripts/ndk-make.sh
+++ b/scripts/ndk-make.sh
@@ -41,7 +41,7 @@
set -e
echo "starting time: `date`"
-export CFLAGS="-fno-unwind-tables -fno-exceptions -fno-asynchronous-unwind-tables -fomit-frame-pointer -fvisibility=hidden"
+#export CFLAGS="-fno-unwind-tables -fno-exceptions -fno-asynchronous-unwind-tables -fomit-frame-pointer -fvisibility=hidden"
: "${ANDROID_NDK_ROOT:=$ANDROID_NDK_HOME}"
: "${ANDROID_NDK_ROOT:=$ANDROID_NDK}"
And these modifications to the core:
diff --git a/Cargo.toml b/Cargo.toml
index ccf61341..687ca30f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,11 +25,11 @@ opt-level = 0
opt-level = "z"
[profile.release]
-lto = true
-panic = 'abort'
+lto = false
+#panic = 'abort'
opt-level = "z"
codegen-units = 1
-strip = true
+strip = false
[dependencies]
deltachat_derive = { path = "./deltachat_derive" }
Will upload it soon.
Here is the testing .apk with debug symbols: https://download.delta.chat/android/debug/deltachat-foss-debug-1.48.3.apk
Built from deltachat-android commit 00498b02b3a852e550b2966d502c8420ec431c02 (current main
) and core v1.148.6, using the patch above to avoid stripping symbols. Inside nix develop
ran scripts/ndk-make.sh --debug arm64-v8a
then ./gradlew assembleDebug
.
sha256sum = 036dc2055d516902e920927873c56dec63f10c61ded3498d72a06f2322bf34e3
To get useful log, install .apk above, import backup, let it crash. Then go offline, open the application again, go into Settings -> Advanced -> View log and save it. The log should contain backtrace with function names instead of addresses.
The way you collected backtrace before should also work.
@flymarq From the log it seems to be some message:
11-17 19:46:20.664 15023 15054 🔵 DeltaChat: [accId=1] src/imap.rs:1319: Starting a full FETCH of message set "8236,8373:8375,8378".
11-17 19:46:20.735 15023 15054 🔵 DeltaChat: [accId=1] src/imap.rs:1432: Passing message UID 8236 to receive_imf().
If you have access to the Dovecot server, you can run doveadm fetch -u username@example.org text uid 8236
(replace with your user email address) to see which message it is. Removing this from the server should stop the crash.
Would be great if you can send me a copy of the message to link2xt@testrun.org so I can reproduce the crash.
@flymarq Looking at the log again, seems the problem is while trying to load your secret key. Have you recently imported a new key into Delta Chat manually?
The issue looks similar to https://github.com/rpgp/rpgp/issues/259
No, I did not add a new key into DeltaChat.
doveadm fetch -u username@example.org text uid 8236
finds two messages. Removing both did not fix the problem, but it takes longer to crash ...
But: I tried with network permission disabled to export the key(s) to the storage and DeltaChat crashes ... no keys are saved to the storage.
rPGP was upgraded from 0.11 to 0.13 in v1.141.2
In Delta Chat Android v1.46.7 core was at version 1.140.2, using rPGP 0.11. In Delta Chat Android v1.46.8 core was upgraded to 1.142.2, using rPGP 0.13.
Could you try to downgrade to v1.46.8? I cannot find such old version in F-Droid, but gplay version is available at https://download.delta.chat/android/
But: I tried with network permission disabled to export the key(s) to the storage and DeltaChat crashes ... no keys are saved to the storage.
This means new rPGP somehow fails to parse your secret key stored in the database. Downgrading to the version of Delta Chat with old rPGP should help.
I have deleted the message with the log file above because it contains Message-IDs etc. rPGP devs are looking into eliminating the bugs like this but it will take a week or two to get a release that can be tested. I have also started https://github.com/deltachat/deltachat-core-rust/pull/6214 to eliminate possibilities for similar errors in the core itself.
I test the older version later ...
From my knowledge I still use the first key from 2018, which:
The key should still be supported, it's definitely a bug in Delta Chat that it crashes on old key generated by Delta Chat. The key is likely a 2048-bit RSA. Delta Chat later switched to generating Curve25519 keys, but using RSA is still supported and support for it is not going to be removed.
Version 1.46.7 fresh install restoring from backup works without crash. After upgrading to 1.46.8 still no crash.
After upgrading to 1.46.8 still no crash.
Even if you receive more messages or try to export the key?
No, exporting keys only works with version 1.46.7.
Then you can downgrade to 1.46.7 for now, otherwise it will crash as soon as you receive a new message and it tries to load the key.
rPGP devs are working on eliminating the code that resulted in this crash and core will update as soon as new version of the library is tagged, will take around a week likely.
Thank you so far for your time and efforts to find a workaround.
I use DeltaChat for more than 5 years and got this error after updating to version 1.48.3 from FDroid:
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- Abort message: 'range end index 33 out of range for slice of length 4'
backtrace:
00 pc 000000000005b004 /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 61deb31c5b39d5f735b66f2155a38a77)