Anki-android: Native crash in database in user collection - reproducible, same trace as top play console crash

Created on 11 Oct 2018  路  10Comments  路  Source: ankidroid/Anki-Android

Reproduction Steps
  1. Import the attached collection.apkg to an emulator (I used Android 7.0 to match the user report) using the hotfix-2.8.5 branch builds
  2. Open the card browser on the MySQL deck
  3. Scroll down almost to the end
Expected Result

You see all the cards

Actual Result

Native crash, pasted in below

2.8.x Accepted Bug Priority-High

All 10 comments

You have not followed these instructions: https://docs.ankidroid.org/help.html#_support

You need to send a crash report, and provide a crash id here or we can't figure out why it is crashing.

Also, does it work in AnkiWeb and AnkiDesktop? Your database is likely corrupt somehow, we just don't know how

Yes, version is 2.8.4, on Android 7.0, and the phone is a Doogee Mix.
The only dialog that appears (even with the 'ask before send reports' option enabled), is one saying 'Ankidroid app has stopped.' and two options: 'Open it again' and 'Send comments'. The latter is the one I have been chosen until now.
In other occasions the app simply restarts itself, going to the decks view.

Okay - that means you are never getting to our crash reporting system, you are crashing in native code which only goes to our google play console. I see it now:

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.ichi2.anki <<<

backtrace:
  #00  pc 00000000000186fc  /data/app/com.ichi2.anki-1/lib/arm64/libsqlite3x.so (_ZN7android19utf8ToJavaCharArrayEPKcPti)
  #01  pc 00000000000167cc  /data/app/com.ichi2.anki-1/lib/arm64/libsqlite3x.so
  #02  pc 0000000000637434  /data/app/com.ichi2.anki-1/oat/arm64/base.odex

This is in the database code, and I've seen a few of these but we have no way to debug them.

What it implies is that some piece of data you added into Anki is not digestible by the database for some reason. I don't know what, but if you use Anki Desktop or perhaps a database editor directly (there are many Sqllite editors available for desktop or android) you may be able to find the data and alter or remove it.

I wish I could be more help but crashes in native code are not possible for us to debug

If you have a backup from prior to all the crashing (implying the data addition that created the problem) I would use that. You may be able to export decks one by one and avoid the one with the data that crashes. You can take your collection file (.anki2 file from /sdcard/AnkiDroid) and manually copy it to your desktop through some file manager program and try on the desktop. As I said before, there's almost nothing on AnkiDroid we can do if our underlying database library crashes in native code unfortunately - so other than offering these suggestions I can't help much. That said, if you were able to post the collection somewhere we may be able to help. You could even attach it here and it's possible we could use it to find out what sort of data is able to crash our database library and work with the upstream library maintainers to get a real fix - that would be slow work but valuable

Anki.zip
Thanks. Here are *.anki2 and *.apkg

Success! Sort of. Es como decir que si con este base de datos la app se cayo pero para reproducir caidas como este es bien dificil, y logramos. So I can reproduce it now and we can figure this out.

Note id 1538991667833 seems to be the problem - it is a pretty big blob of text but that shouldn't cause a crash.

I've deleted that note from your database and re-packaged the collection with the modified database, and I'm attaching it here so you can import it, replacing your current collection. You'll want to run check database etc to clean things up but this should get you going.

It's named collection.zip so github will allow the upload, you'll want to rename it to collection.apkg and put it on /sdcard/AnkiDroid to do the import
collection.zip

I cleaned up this thread by deleting the comments related to the anki crash reporting system, now that we know this is a native crash.

Hmm. Good news and bad news - this appears to be fixed in the latest alphas (where the database library has been upgraded a great deal). They are forwards and backwards compatible with 2.8.x if you want to try it I think you're current collection will be just fine - the trick is to join the google group https://groups.google.com/forum/#!forum/ankidroidalphatesters here and then use google play on your device to join the beta testing program for ankidroid. "a little while" (maybe a day?) after that you should start seeing updates like 2.9alpha44 come through and your collection will be fine

Ok, thanks a lot. So I will wait for 2.9 version. Anyways, after dowload and check the fixed collection uploaded for you, I'll give feedback. Regarding to the testing group, it sounds like an atractive idea for me, so maybe I'll try.

Hi. After being trying the whole collection, evertything seems working fine. Muchas gracias por toda esta ayuda, and kindly regards!

Was this page helpful?
0 / 5 - 0 ratings