Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anki crashes everytime i sync #4691

Closed
Vaanen opened this issue Aug 29, 2017 · 36 comments · Fixed by #4744
Closed

Anki crashes everytime i sync #4691

Vaanen opened this issue Aug 29, 2017 · 36 comments · Fixed by #4744

Comments

@Vaanen
Copy link

Vaanen commented Aug 29, 2017

Research

Enter an [ x ] character to confirm the points below:

[ x ] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid

[ x ] I have checked the manual and the FAQ and could not find a solution to my issue

[ x ] I have searched for similar existing issues here and on the user forum

Reproduction Steps
  1. Do something that will require sync
  2. Sync
Expected Result

Go back to normal

Actual Result

Crash of the app

Debug info

Refer to the support page if you are unsure where to get the "debug info".

AnkiDroid Version = 2.8.2

Android Version = 8.0.0

ACRA UUID = 8ad98706-43aa-4b83-885e-5a857662aebe

Notes

I reinstalled Ankidroid, removed everything, tried the last beta, nothing solves it, it just crashes right after syncing. I can open the app afterwards and sync was successful but its very annoying since i set to sync very often to avoid forgetting. It appeared all of the sudden, was working fine before, i did some cleaning on my desktop Anki client and then this bug started to appear on Ankidroid. Tried rebuild databese, check media, nothing fixes it.

This also have the effect of not being able to restore collection from APKG. This time, Ankidroid crashes before even importing, so its actually not possible. I suspect there may be some incompatibility between how Anki computer builds the database vs how Ankidroid expects a database to be

@Vaanen
Copy link
Author

Vaanen commented Sep 7, 2017

Update : I have formatted my phone and installed Android 8.0 and i can confirm the issue is still there.

@timrae
Copy link
Member

timrae commented Sep 11, 2017 via email

@Vaanen
Copy link
Author

Vaanen commented Sep 11, 2017

unfortunately i don't have the option to send report, the app just crashes and android just asks me if i want to open it again and nothing else :
screenshot_20170911-225904

@timrae
Copy link
Member

timrae commented Sep 11, 2017 via email

@Vaanen
Copy link
Author

Vaanen commented Sep 11, 2017

surez it's pretty big so i'll probably have to upload it somewhere

@timrae timrae added the Needs Author Reply Waiting for a reply from the original author label Sep 13, 2017
@Vaanen
Copy link
Author

Vaanen commented Sep 16, 2017

Hello, i tried to send an email, but it said such adress didnt exist ? i added @gmail.com to what you wrote

@Vaanen
Copy link
Author

Vaanen commented Sep 23, 2017

Did you receive it ? I see it's still "awaiting for feedback", i tried to send it to "perceptual" and not "peceptual", maybe the r was the typo.

in any case, it's here https://drive.google.com/file/d/0B2BMxLA7EzgBN01yNktVTVRVZFk/view?usp=drivesdk

@4arlinesia
Copy link

GM... I started experiencing the same prob 2 days ago on my Android devices. Can u pls help?

@Brambo27
Copy link

Brambo27 commented Oct 9, 2017

Hi, I've had the same problem for at least the last 4 months, maybe longer.
Whenever anki completes a sync it crashes.
Here is my debug info:

AnkiDroid Version = 2.8.2

Android Version = 8.0.0

ACRA UUID = f517a5ec-65aa-4cb3-b5c5-346d967c84b6

@Brambo27
Copy link

Brambo27 commented Dec 7, 2017

Hi, I see this issue is still waiting on feedback. I've been experiencing these crashes too and am willing to give all the feedback you need to solve it.

@Vaanen
Copy link
Author

Vaanen commented Dec 8, 2017 via email

@timrae
Copy link
Member

timrae commented Dec 8, 2017

@Vaanen
Could you quickly email me again now so I can search through my emails to find yours again? If you can do it right now I have a little bit of time to check your collection.

@Vaanen
Copy link
Author

Vaanen commented Dec 8, 2017 via email

@timrae
Copy link
Member

timrae commented Dec 8, 2017

@Brambo27

Thanks for your ID, here's the stacktrace, it seems to be a problem with SSL authentication doing media sync. If you disable media sync does it work?

java.lang.RuntimeException: javax.net.ssl.SSLException: Read error: ssl=0x75eaffb8c0: I/O error during system call, Software caused connection abort
at com.ichi2.libanki.sync.RemoteMediaServer.downloadFiles(RemoteMediaServer.java:125)
at com.ichi2.libanki.sync.MediaSyncer._downloadFiles(MediaSyncer.java:240)
at com.ichi2.libanki.sync.MediaSyncer.sync(MediaSyncer.java:167)
at com.ichi2.async.Connection.doInBackgroundSync(Connection.java:388)
at com.ichi2.async.Connection.doOneInBackground(Connection.java:188)
at com.ichi2.async.Connection.doInBackground(Connection.java:178)
at com.ichi2.async.Connection.doInBackground(Connection.java:50)

@timrae
Copy link
Member

timrae commented Dec 8, 2017

@Vaanen

i linked the collection in a previous post also

Ah thanks, I didn't see that. Also, just in case it's changed, could you please check your UUID again? and post it if it's different?

@Vaanen
Copy link
Author

Vaanen commented Dec 8, 2017 via email

@timrae
Copy link
Member

timrae commented Dec 8, 2017

Thanks, there are some crashes there, but none seem to be related to sync, so I guess it's not going through. Does it happen as soon as you start syncing or just in the media sync part?

@Vaanen
Copy link
Author

Vaanen commented Dec 8, 2017 via email

@Brambo27
Copy link

Brambo27 commented Dec 8, 2017

Hi, I disabled "fetch media on sync" and it still crashes

@Brambo27
Copy link

Brambo27 commented Dec 8, 2017

My ACRA UUID Changed too it is now:

ACRA UUID = c895da83-c370-4a0c-a4fe-185f887e45df

@timrae
Copy link
Member

timrae commented Dec 8, 2017

@Vaanen

Good news, I could reproduce the issue with your collection, and found that the issue is the same as this one, except that you don't get a error message anymore [i.e. it just crashes instead] ever since we changed our SQLite library.

So I went through your collection and deleted all the unused note types, after that it was working fine.

@timrae
Copy link
Member

timrae commented Dec 8, 2017

@Brambo27

There are no crash reports listed for that UUID, so I suspect that your problem is the same as @Vaanen's... You have too many note types in your collection.

@timrae
Copy link
Member

timrae commented Dec 8, 2017

@dae

FYI, it looks like two more users with this "too many note types" issue, and now it causes a core dump at the C++ layer, so we can't just catch the Java IllegalStateException any longer.

@timrae timrae removed the Needs Author Reply Waiting for a reply from the original author label Dec 8, 2017
@Brambo27
Copy link

Brambo27 commented Dec 8, 2017 via email

@timrae
Copy link
Member

timrae commented Dec 8, 2017

Apologies for the delay in getting to this

@Vaanen
Copy link
Author

Vaanen commented Dec 8, 2017 via email

@timrae
Copy link
Member

timrae commented Dec 8, 2017 via email

@Vaanen
Copy link
Author

Vaanen commented Dec 8, 2017 via email

@timrae
Copy link
Member

timrae commented Dec 8, 2017

The only way is to open the database and inspect the col table. For example if you have linux you could get the length from the command line as follows:

cd $YOUR_ANKI_DIRECTORY
sqlite3 collection.anki2 "select length(hex(id))+length(hex(crt))+length(hex(mod))+length(hex(scm))+length(hex(ver))+length(hex(dty))+length(hex(usn))+length(hex(ls))+length(hex(conf))+length(hex(models))+length(hex(decks))+length(hex(dconf))+length(hex(tags)) as 'total' from col"

@timrae timrae closed this as completed Dec 8, 2017
@timrae timrae reopened this Dec 8, 2017
@timrae
Copy link
Member

timrae commented Dec 8, 2017

Sorry I accidentally closed and reopened the issue, I was having trouble with my browser. I also updated my comment to give a bit more information, but it's not something simple like just checking the size of a file.

@timrae
Copy link
Member

timrae commented Dec 8, 2017

Also, FYI the output of the command above before and after deleting all the unused models was:

384012
1168554

It needs to be less than 1048576.

timrae pushed a commit that referenced this issue Dec 11, 2017
fixes #4691 et al

editing the template seems to work, so the size limit only appears to
be when reading the column, not writing to it
mikehardy added a commit to mikehardy/Anki-Android that referenced this issue Dec 12, 2017
parameterized new loadModels method from dae so it could load any column,
used new parameterized method to load models as before, but also to
load decks, as hinted by timrae
timrae pushed a commit that referenced this issue Dec 12, 2017
parameterized new loadModels method from dae so it could load any column,
used new parameterized method to load models as before, but also to
load decks, as hinted by timrae
timrae pushed a commit that referenced this issue Apr 20, 2018
fixes #4691 et al

editing the template seems to work, so the size limit only appears to
be when reading the column, not writing to it
timrae pushed a commit that referenced this issue Apr 20, 2018
parameterized new loadModels method from dae so it could load any column,
used new parameterized method to load models as before, but also to
load decks, as hinted by timrae
@mikehardy
Copy link
Member

@timrae - this is pretty old at the moment, but I'm wondering if you remember the crash - was it in android:utf8toJavaCharArray? Because we have a much lower count of those from 2.8.3 -> 2.8.4 when this fix was released, but we still have a lot of them, I think it's our #2 crash. If this strategy (loading in chunks) worked for the 2 columns it was applied to, and that was the method you saw on local reproduction, I might go after attempting local reproduction and chunk-load of the other possible columns

@timrae
Copy link
Member

timrae commented Sep 15, 2018

Which columns? I think we already have all the columns with unbounded size...? I think this was a native crash...

@mikehardy
Copy link
Member

It is native, that's the name in the jni part of the native crash

@timrae
Copy link
Member

timrae commented Sep 15, 2018

Oh right, yeah I don't really remember, sorry. In general I'm not really a fan of reactively changing things in the code base to handle a specific stack trace from triage without a reproduction case, or at least a strong hypothesis for the cause of the error

@mikehardy
Copy link
Member

mikehardy commented Sep 15, 2018

I agree with that on triage. The IncompatibleClassChangeError on the other thread has documentation supporting that it is ABI breakage and it's out of library client code control, so its a different thread but that one is just hypothesis with a tough reproduction. This one, with as many crashes as are triggered by it still if I can't crash it locally with a test case I'm doing it wrong - I was just hoping you'd have recollection that it was that method as to motivate the repro effort. I'll hold on this for a bit then as it's not a feature-freeze blocker anyway, just something we'd want to release when 2.9 goes out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants