K9 Mail consistently crashing on email delete
See original GitHub issueExpected behaviour
Email should be deleted and the next email in the list should be displayed
Actual behaviour
I have K9 Mail installed on a Android Tablet Samsung Tab A and a Smartphone Moto G 1. I remember having problems with crashes a while back that stopped when I cleaned my trash folder.
Now, around the same day, K9 Mail crashes every time I delete an Email. I can see parts of the next email in the list sometimes, but not always. I cleaned the trash folder (now empty) and restarted the IMAP server. (No other program accessing the server has any trouble). I found a consistent error logging from K9 Mail when deleting emails:
W/CursorWindow(27940): Window is full: requested allocation 525 bytes, free space 363 bytes, window size 2097152 bytes
W/cr_AwContents(27940): onDetachedFromWindow called when already detached. Ignoring
E/libEGL (27940): validate_display:255 error 3008 (EGL_BAD_DISPLAY)
W/VideoCapabilities(27940): Unrecognized profile 2130706433 for video/avc
W/AudioCapabilities(27940): Unsupported mime audio/amr-wb-plus
W/VideoCapabilities(27940): Unsupported mime video/mpeg2
W/cr_BindingManager(27940): Cannot call determinedVisibility() - never saw a connection for the pid: 27940
W/CursorWindow(27940): Window is full: requested allocation 525 bytes, free space 363 bytes, window size 2097152 bytes
W/CursorWindow(27940): Window is full: requested allocation 525 bytes, free space 363 bytes, window size 2097152 bytes
W/CursorWindow(27940): Window is full: requested allocation 525 bytes, free space 363 bytes, window size 2097152 bytes
W/cr_BindingManager(27940): Cannot call determinedVisibility() - never saw a connection for the pid: 27940
W/cr_BindingManager(27940): Cannot call determinedVisibility() - never saw a connection for the pid: 27940
W/CursorWindow(27940): Window is full: requested allocation 525 bytes, free space 363 bytes, window size 2097152 bytes
W/CursorWindow(27940): Window is full: requested allocation 525 bytes, free space 363 bytes, window size 2097152 bytes
W/CursorWindow(27940): Window is full: requested allocation 525 bytes, free space 363 bytes, window size 2097152 bytes
W/CursorWindow(27940): Window is full: requested allocation 525 bytes, free space 363 bytes, window size 2097152 bytes
W/CursorWindow(27940): Window is full: requested allocation 525 bytes, free space 363 bytes, window size 2097152 bytes
E/WifiStateMachine( 827): WifiStateMachine CMD_START_SCAN source -2 txSuccessRate=7,84 rxSuccessRate=7,34 targetRoamBSSID=any RSSI=-69
E/WifiStateMachine( 827): startDelayedScan send -> 22742 milli 20000
E/WifiStateMachine( 827): WifiStateMachine CMD_START_SCAN with age=20003 interval=151875 maxinterval=300000
E/WifiStateMachine( 827): WifiStateMachine CMD_START_SCAN full=false
E/WifiStateMachine( 827): WifiStateMachine starting scan for "WLAN-001C4AA14D4E"WPA_PSK with 2437
E/WifiStateMachine( 827): [1.471.092.449.031 ms] noteScanstart no scan source uid -2
E/WifiStateMachine( 827): [1.471.092.449.093 ms] noteScanEnd no scan source onTime=0
E/WifiStateMachine( 827): wifi setScanResults statecom.android.server.wifi.WifiStateMachine$ConnectedState@c6e54e7 sup_state=COMPLETED debouncing=false mConnectionRequests=1 selection=<none>
E/FastThread( 290): did not receive expected priority boost
W/CursorWindow(27940): Window is full: requested allocation 525 bytes, free space 363 bytes, window size 2097152 bytes
W/cr_AwContents(27940): onDetachedFromWindow called when already detached. Ignoring
W/CursorWindow(27940): Window is full: requested allocation 525 bytes, free space 363 bytes, window size 2097152 bytes
W/CursorWindow(27940): Window is full: requested allocation 525 bytes, free space 363 bytes, window size 2097152 bytes
W/CursorWindow(27940): Window is full: requested allocation 525 bytes, free space 363 bytes, window size 2097152 bytes
W/CursorWindow(27940): Window is full: requested allocation 525 bytes, free space 363 bytes, window size 2097152 bytes
W/cr_BindingManager(27940): Cannot call determinedVisibility() - never saw a connection for the pid: 27940
W/CursorWindow(27940): Window is full: requested allocation 270 bytes, free space 261 bytes, window size 2097152 bytes
E/CursorWindow(27940): Failed to read row 927, column 16 from a CursorWindow which has 927 rows, 18 columns.
E/AndroidRuntime(27940): FATAL EXCEPTION: main
E/AndroidRuntime(27940): Process: com.fsck.k9, PID: 27940
E/AndroidRuntime(27940): java.lang.IllegalStateException: Couldn't read row 927, col 16 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
E/AndroidRuntime(27940): at android.database.CursorWindow.nativeGetString(Native Method)
E/AndroidRuntime(27940): at android.database.CursorWindow.getString(CursorWindow.java:438)
E/AndroidRuntime(27940): at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:51)
E/AndroidRuntime(27940): at android.database.CursorWrapper.getString(CursorWrapper.java:114)
E/AndroidRuntime(27940): at android.database.CursorWrapper.getString(CursorWrapper.java:114)
E/AndroidRuntime(27940): at com.fsck.k9.provider.EmailProvider$SpecialColumnsCursor.getString(EmailProvider.java:796)
E/AndroidRuntime(27940): at android.database.CursorWrapper.getString(CursorWrapper.java:114)
E/AndroidRuntime(27940): at android.database.CursorWrapper.getString(CursorWrapper.java:114)
E/AndroidRuntime(27940): at com.fsck.k9.fragment.MessageListFragment.getReferenceForPosition(MessageListFragment.java:3069)
E/AndroidRuntime(27940): at com.fsck.k9.fragment.MessageListFragment.isLast(MessageListFragment.java:3062)
E/AndroidRuntime(27940): at com.fsck.k9.activity.MessageList.configureMenu(MessageList.java:1002)
E/AndroidRuntime(27940): at com.fsck.k9.activity.MessageList.onPrepareOptionsMenu(MessageList.java:938)
E/AndroidRuntime(27940): at android.app.Activity.onPreparePanel(Activity.java:2851)
E/AndroidRuntime(27940): at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:577)
E/AndroidRuntime(27940): at com.android.internal.policy.impl.PhoneWindow.doInvalidatePanelMenu(PhoneWindow.java:921)
E/AndroidRuntime(27940): at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:259)
E/AndroidRuntime(27940): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
E/AndroidRuntime(27940): at android.view.Choreographer.doCallbacks(Choreographer.java:580)
E/AndroidRuntime(27940): at android.view.Choreographer.doFrame(Choreographer.java:549)
E/AndroidRuntime(27940): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
E/AndroidRuntime(27940): at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime(27940): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(27940): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(27940): at android.app.ActivityThread.main(ActivityThread.java:5343)
E/AndroidRuntime(27940): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(27940): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(27940): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
E/AndroidRuntime(27940): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
W/ActivityManager( 827): Force finishing activity 1 com.fsck.k9/.activity.MessageList
W/ActivityManager( 827): Activity pause timeout for ActivityRecord{dea196 u0 com.fsck.k9/.activity.MessageList t6129 f}
Steps to reproduce
- Hmm, good question. Have lots of emails in various folders and start deleting? 2. 3.
Environment
K-9 Mail version: 5.010 Android version: 5.1 Account type (IMAP, POP3, WebDAV/Exchange): IMAP
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
K9 Mail consistently crashing on email delete #1561 - GitHub
I have K9 Mail installed on a Android Tablet Samsung Tab A and a Smartphone Moto G 1. I remember having problems with...
Read more >[Solved] App crashes when opening an email - K-9 Mail Forum
So the app will crash every time you try to open a message. You could try uninstalling Chrome and WebView updates.
Read more >How to delete all messages in the Trash directory?
There is a setting in K9 that you can check to delete emails from the server when deleted in K9. It is in...
Read more >k9mail - Archive - Google Code
6261, Done, k9mail always tries Tod send an email who is too large for the server ... 6253, Duplicate, Deleted message not set...
Read more >K-9 Mail Reviews 2022: Details, Pricing, & Features - G2
K-9 is an opensource email client based on the Email application shipped with the initial release of Android. K-9 is focused on making...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This happens from message view, when you click on the delete menu item, right?
There is no definite culprit here, but I can see a couple of things which look questionable and might help if they are changed or moved around. For instance, the subsequential calls to
isLast
andisFirst
, which move the message list cursor to the beginning and the end, are very bad for caching and would probably be better off in a query of their own. It also seems weird that they are called on the message list fragment, which might not even be displayed at the time.(From the stack trace, this doesn’t seem to be the same as 1468)
Duplicate of #783. Both are MessageProvider->SpecialColumnsCursor.
Closing as duplicate.