standardnotes / mobile

[Moved to https://github.com/standardnotes/app] Standard Notes for iOS and Android - https://standardnotes.com
GNU Affero General Public License v3.0
826 stars 112 forks source link

Android app crashes intermittently during editing #360

Open gotdown opened 3 years ago

gotdown commented 3 years ago

To Reproduce Steps to reproduce the behavior:

  1. Edit note(s) in SN
  2. Every so often, it hard crashes back to the phone's launcher
  3. Upon relaunching SN, occasionally (but not always) there's a conflicted copy of the note.

Expected behavior Doesn't crash.

Smartphone (please complete the following information):

Additional context This happened nine times during a ~1 hour note-editing session last night. Happened once during a short note editing session today.

smartfonreddit commented 3 years ago

This also happens on Samsung Galaxy S10e running Android 10 (One UI 2.5). The Version 3.5.15 (3000261) of the app crashes every few minutes as I type text into it. It goes straight to the phone's home screen. The note is often duplicated. Last time I used Standard Notes in 2020 and it was working without crashes.

I have a 21MB dump file generated from Developer Options after reproducing the crash. I can't share it because it contains lots of personal information. However, if you know what I should look for specifically within the large log file, I can do a Ctrl+F, find that segment relevant specifically to Standard Notes, and copy it here. werwer

Screenshot_20210131-205648_Device care

moughxyz commented 3 years ago

Are you using a 3rd party keyboard by any chance?

smartfonreddit commented 3 years ago

Are you using a 3rd party keyboard by any chance?

I normally use Google Keyboard but it also crashes with Samsung's native keyboard.

lobo78 commented 3 years ago

I can confirm the same issue on a Pixel 3a. I use the standard, built-in keyboard. I'm unable to write more than a sentence or two before the app crashes.

JaspalSuri commented 3 years ago

Sorry to hear that; thanks for those details! For frequent crashes, clearing the app's storage might help. Just make sure to only do so if you have an account, can confirm that everything has been synced by signing into the web app, and don't reinstall the Android app afterwards (to avoid downloading a backup of the app).

smartfonreddit commented 3 years ago

clearing the app's storage might help.

Not OP here. It fixed the crashes. Thanks!

Edit: it's crashing again but less frequently.

pcrockett commented 3 years ago

I tried clearing data today and sadly that didn't help. I still got it to crash. :/

JaspalSuri commented 3 years ago

I tried clearing data today and sadly that didn't help. I still got it to crash. :/

I'm sorry to hear that. Do you notice a pattern of when the app typically crashes or is it somewhat random? Do you have several notes on your account? What keyboard and editor(s) are you using?

Not OP here. It fixed the crashes. Thanks!

That's great to hear! Thanks for letting us know!

pcrockett commented 3 years ago

I haven't noticed a consistent pattern yet. I am currently testing the theory that it only happens when editing somewhere in the middle of an existing note. And perhaps it's more prone to happen when I'm hitting backspace?

I also have the suspicion that it's a race condition: It may crash if I edit text at exactly the right moment when a sync is starting.

The number of notes I have is reported differently between the desktop and mobile versions of the app, but it looks like I have between 1500 and 2000 notes.

I'm using Simple Keyboard from F-Droid on /e/OS (based on LineageOS).

The crash doesn't happen to me often either, despite the fact that I spend a lot of time in this app. Perhaps 3-4 times per week.

smartfonreddit commented 3 years ago

That's great to hear! Thanks for letting us know!

I take that back. The app still crashes after clearing the data, but significantly less frequently. It no longer always duplicates the note after the crash.

Another user has mentioned that it could be happening when the note is being edited and the app tries to sync. For some reason, I recall having the same impression based on my observations. Might be worth looking into, if all else fails.

Pazuu commented 3 years ago

I can confirm until now, that i dont get the crash, when i turn off the internet connection, so it cant sync, while editing.

Device: Fairphone 2 OS: Android 7.1.2.

JaspalSuri commented 3 years ago

@pcrockett Thank you for following up with the additional details; I really appreciate it!

@smartfonreddit sorry to hear that. There appear to be two types of crashes, with one that can be resolved through clearing the app's storage and one that occurs less frequently.

@Pazuu, @smartfonreddit, @pcrockett, and everyone else: thanks for providing those insights! The dev team will look into that part of the code and attempt to reproduce it. We will update this thread when we have more to share. Currently the dev team is wrapping up the release an important security-focused feature update and will be able to focus on this issue after.

jknoxville commented 3 years ago

I reproduced this yesterday while my device was connected to see what logcat says. It was only the prod build though so I'm not sure the stack traces are very useful. But here they are for what it's worth: https://gist.github.com/jknoxville/ce3a256722530517e69d61829fab1947

Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 8124 (mqt_js), pid 7498 (m.standardnotes)

[I also built the app from source to try debugging, but it wouldn't accept my login credentials, don't know if there's any special trick to use production login on the dev build.]

kiwipxl commented 3 years ago

Hey John,

Just a tip regarding that last point - try going to advanced options (the button just below sign in) and changing " https://syncing-server-dev.standardnotes.org/" to " https://sync.standardnotes.org/"

Can't remember how I figured this out, but that should let you sign into the production sync server from a development build.

On Tue, 9 Mar 2021, 23:19 John Knox, notifications@github.com wrote:

I reproduced this yesterday while my device was connected to see what logcat says. It was only the prod build though so I'm not sure the stack traces are very useful. But here they are for what it's worth: https://gist.github.com/jknoxville/ce3a256722530517e69d61829fab1947

Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 8124 (mqt_js), pid 7498 (m.standardnotes)

[I also built the app from source to try debugging, but it wouldn't accept my login credentials, don't know if there's any special trick to login on the dev build.]

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/standardnotes/mobile/issues/360#issuecomment-793804688, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBHIAZWXGQNJ7IHOKQA7G3TCYG4PANCNFSM4WVTF45A .

moughxyz commented 3 years ago

We've made some updates here in recent releases. The issue is related to memory pressure overall so it's hard to tackle directly, but please let us know if you've noticed any improvements here from the releases starting from about 1 week ago.

pcrockett commented 3 years ago

I have been keeping an eye on it. So far two observations:

  1. Before the update, I had disabled storage encryption to reduce startup times. That seemed to also make the crashes much less frequent. It crashed maybe once in the several days before the update came out.
  2. After the update, I haven't noticed any crashes yet. I haven't been running it long enough to be 100% confident that it's fixed, but it's looking promising. I'll post here the moment I see another crash, if it ever happens.

Side note: Really liking the unrelated improvements in these latest updates as well! Especially search improvements. Good work!

moughxyz commented 3 years ago

The update in question only affected encryption, and not yet decryption performance.

Really liking the unrelated improvements in these latest updates as well! Especially search improvements. Good work!

Thank you ❤️

Pazuu commented 3 years ago

No crash so far. Thank you so much! :)

GianniRiva commented 3 years ago

In my case a crash happens every few seconds, on both the Android and Windows apps, when I edit archived notes.

JaspalSuri commented 3 years ago

Hi @GianniRiva, sorry to hear that! I'm afraid that I wasn't able to reproduce the issue. Do the apps crash when editing notes of certain lengths? Which editor(s) are you using when the apps crash? Around how many notes and tags does the app say are stored by the app or on your account?

Please share the names of the Android and Windows devices that you're using as well.

GianniRiva commented 3 years ago

Hi @JaspalSuri, I'm trying to reproduce it consistently but I'm still not sure. I'm using:

I have an archived note, a shopping list which is 1089 characters long.

Now I can't reproduce the problem at all, it just vanished abruptly. There's something about that shopping list that evades me. If you need the entire text I can share that in private.

JaspalSuri commented 3 years ago

Hi @GianniRiva, thank you for providing those details and for attempting to reproduce the issue! I'm glad that the issue has vanished. It appears that the note is not particularly large. If it happens again, please contact help@standardnotes.org and include a FileSend link that is set to expire after the text file is downloaded.

And just to make sure, are you using the Plain Editor or Task Editor for that note?

GianniRiva commented 3 years ago

@JaspalSuri I'm using the default editor on both Android and Windows. The error came back so I sent everything to help@standardnotes.org. Please know this minor issue is not a dealbreaker for me, I'm just trying to help.

JaspalSuri commented 3 years ago

Hi @GianniRiva, sorry for the delayed response. We've taken note of the issue for review and will keep an eye out for similar reports. Thank you so much for sharing additional details with us; I'm glad to hear that it isn't a dealbreaker! 🙂

pcrockett commented 3 years ago

Just thought I'd share an update: I have not experienced this issue since I updated the app in April.

JaspalSuri commented 3 years ago

Hi @pcrockett, that's great to hear! Thank you for taking the time to let us know!