Foundry376 / Mailspring

:love_letter: A beautiful, fast and fully open source mail client for Mac, Windows and Linux.
https://getmailspring.com/
GNU General Public License v3.0
15.59k stars 906 forks source link

Bug: MailSync is unstable or not very reliable #1995

Closed RaitoBezarius closed 3 years ago

RaitoBezarius commented 4 years ago

Describe the bug Across my usage of one year of MailSpring, I had 894 crashes of mailsync.bin and have 894 coredumps (coredumpctl | grep -i /usr/share/mailspring/resources/app.asar.unpacked/mailsync.bin | wc -l).

Most of them have stack traces which looks like this:

       Message: Process 95285 (main) of user 1000 dumped core.

                Stack trace of thread 95288:
                #0  0x00007f9bf0a95755 raise (libc.so.6)
                #1  0x00007f9bf0a80851 abort (libc.so.6)
                #2  0x0000000000e05b8b _ZN10__cxxabiv111__terminateEPFvvE (mailsync.bin)
                #3  0x0000000000e05bd1 _ZSt9terminatev (mailsync.bin)
                #4  0x0000000000e581a8 execute_native_thread_routine (mailsync.bin)
                #5  0x00007f9bf0f8d57f start_thread (libpthread.so.0)
                #6  0x00007f9bf0b570e3 __clone (libc.so.6)

                Stack trace of thread 95285:
                #0  0x00007f9bf0f96a6c read (libpthread.so.0)
                #1  0x0000000000e5b407 _ZNSt12__basic_fileIcE6xsgetnEPcl (mailsync.bin)
                #2  0x0000000000e41f0c _ZNSt13basic_filebufIcSt11char_traitsIcEE9underflowEv (mailsync.bin)
                #3  0x0000000000e0acbe _ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RSbIS4_S5_T1_ES4_ (mailsync.bi>
                #4  0x00000000007cb2f6 _ZN11DeltaStream11waitForJSONEv (mailsync.bin)
                #5  0x000000000075e250 _Z21runListenOnMainThreadSt10shared_ptrI7AccountE (mailsync.bin)
                #6  0x000000000076065a main (mailsync.bin)
                #7  0x00007f9bf0a81ee3 __libc_start_main (libc.so.6)
                #8  0x000000000075a435 _start (mailsync.bin)

                Stack trace of thread 95286:
                #0  0x00007f9bf0f97145 __nanosleep (libpthread.so.0)
                #1  0x000000000077d4f3 _ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE (mailsync.bi>
                #2  0x000000000075c530 _Z12runFlushLoopv (mailsync.bin)
                #3  0x00000000007b7c3f _ZNSt12_Bind_simpleIFPFvvEvEE9_M_invokeIIEEEvSt12_Index_tupleIIXspT_EEE (mailsync.bin)
                #4  0x00000000007b724d _ZNSt12_Bind_simpleIFPFvvEvEEclEv (mailsync.bin)
                #5  0x00000000007b69fa _ZNSt6thread5_ImplISt12_Bind_simpleIFPFvvEvEEE6_M_runEv (mailsync.bin)
                #6  0x0000000000e580f0 execute_native_thread_routine (mailsync.bin)
                #7  0x00007f9bf0f8d57f start_thread (libpthread.so.0)
                #8  0x00007f9bf0b570e3 __clone (libc.so.6)

                Stack trace of thread 95291:
                #0  0x00007f9bf0f937ca pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0)
                #1  0x000000000075a5d5 _ZL24__gthread_cond_timedwaitP14pthread_cond_tP15pthread_mutex_tPK8timespec (mailsync.bin)
                #2  0x0000000000785831 _ZNSt18condition_variable17__wait_until_implINSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEEE>
                #3  0x000000000077e66b _ZNSt18condition_variable10wait_untilINSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEEEESt9cv_>
                #4  0x00000000007cb6dd _ZZN11DeltaStream11flushWithinEiENKUlvE_clEv (mailsync.bin)
                #5  0x00000000007ccb92 _ZNSt12_Bind_simpleIFZN11DeltaStream11flushWithinEiEUlvE_vEE9_M_invokeIJEEEvSt12_Index_tupleIJXs>
                #6  0x00000000007ccafb _ZNSt12_Bind_simpleIFZN11DeltaStream11flushWithinEiEUlvE_vEEclEv (mailsync.bin)
                #7  0x00000000007cca9a _ZNSt6thread5_ImplISt12_Bind_simpleIFZN11DeltaStream11flushWithinEiEUlvE_vEEE6_M_runEv (mailsync>
                #8  0x0000000000e580f0 execute_native_thread_routine (mailsync.bin)
                #9  0x00007f9bf0f8d57f start_thread (libpthread.so.0)
                #10 0x00007f9bf0b570e3 __clone (libc.so.6)

                Stack trace of thread 95289:
                #0  0x00007f9bf0f97145 __nanosleep (libpthread.so.0)
                #1  0x000000000081ebaf _ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1EEEEvRKNSt6chrono8durationIT_T0_EE (mailsync.bin)
                #2  0x000000000081da6d _ZN24MetadataExpirationWorker3runEv (mailsync.bin)
                #3  0x000000000075f112 _ZZ4mainENKUlvE3_clEv (mailsync.bin)
                #4  0x000000000076af1e _ZNSt12_Bind_simpleIFZ4mainEUlvE3_vEE9_M_invokeIJEEEvSt12_Index_tupleIJXspT_EEE (mailsync.bin)
                #5  0x000000000076accf _ZNSt12_Bind_simpleIFZ4mainEUlvE3_vEEclEv (mailsync.bin)
                #6  0x000000000076aa8e _ZNSt6thread5_ImplISt12_Bind_simpleIFZ4mainEUlvE3_vEEE6_M_runEv (mailsync.bin)
                #7  0x0000000000e580f0 execute_native_thread_routine (mailsync.bin)
                #8  0x00007f9bf0f8d57f start_thread (libpthread.so.0)
                #9  0x00007f9bf0b570e3 __clone (libc.so.6)

                Stack trace of thread 95287:
                #0  0x00007f9bf0f937ca pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0)
                #1  0x000000000075a5d5 _ZL24__gthread_cond_timedwaitP14pthread_cond_tP15pthread_mutex_tPK8timespec (mailsync.bin)
                #2  0x0000000000785831 _ZNSt18condition_variable17__wait_until_implINSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEEE>
                #3  0x000000000077e66b _ZNSt18condition_variable10wait_untilINSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEEEESt9cv_>
                #4  0x000000000080e1bc _ZN9MailUtils25sleepWorkerUntilWakeOrSecEi (mailsync.bin)
                #5  0x000000000075c9c4 _Z23runBackgroundSyncWorkerv (mailsync.bin)
                #6  0x000000000075f02a _ZZ4mainENKUlvE1_clEv (mailsync.bin)
                #7  0x000000000076afda _ZNSt12_Bind_simpleIFZ4mainEUlvE1_vEE9_M_invokeIJEEEvSt12_Index_tupleIJXspT_EEE (mailsync.bin)
                #8  0x000000000076ad17 _ZNSt12_Bind_simpleIFZ4mainEUlvE1_vEEclEv (mailsync.bin)
                #9  0x000000000076aace _ZNSt6thread5_ImplISt12_Bind_simpleIFZ4mainEUlvE1_vEEE6_M_runEv (mailsync.bin)
                #10 0x0000000000e580f0 execute_native_thread_routine (mailsync.bin)
                #11 0x00007f9bf0f8d57f start_thread (libpthread.so.0)
                #12 0x00007f9bf0b570e3 __clone (libc.so.6)

Or more recently (4h ago):

                Stack trace of thread 108778:
                #0  0x00007fe1e834348b __select (libc.so.6 + 0xf748b)
                #1  0x0000000000ac279d wait_read (mailsync.bin + 0x6c279d)
                #2  0x0000000000ac0ff0 mailstream_low_compress_read (mailsync.bin + 0x6c0ff0)
                #3  0x0000000000a93983 mailstream_low_read (mailsync.bin + 0x693983)
                #4  0x0000000000a93364 mailstream_feed_read_buffer (mailsync.bin + 0x693364)
                #5  0x0000000000ac1290 mailstream_read_line_append (mailsync.bin + 0x6c1290)
                #6  0x0000000000a988c5 mailimap_status (mailsync.bin + 0x6988c5)
                #7  0x0000000000a6747a _ZN8mailcore11IMAPSession12folderStatusEPNS_6StringEPNS_9ErrorCodeE (mailsync.bin + 0x66747a)
                #8  0x00000000008c8a68 _ZN10SyncWorker18idleCycleIterationEv (mailsync.bin + 0x4c8a68)
                #9  0x00000000007bdce8 _Z23runForegroundSyncWorkerv (mailsync.bin + 0x3bdce8)
                #10 0x00000000007be0ba _ZZ23runBackgroundSyncWorkervENKUlvE_clEv (mailsync.bin + 0x3be0ba)
                #11 0x00000000007ce4ac _ZNSt12_Bind_simpleIFZ23runBackgroundSyncWorkervEUlvE_vEE9_M_invokeIJEEEvSt12_Index_tupleIJXspT_>
                #12 0x00000000007ce0a9 _ZNSt12_Bind_simpleIFZ23runBackgroundSyncWorkervEUlvE_vEEclEv (mailsync.bin + 0x3ce0a9)
                #13 0x00000000007cddf0 _ZNSt6thread5_ImplISt12_Bind_simpleIFZ23runBackgroundSyncWorkervEUlvE_vEEE6_M_runEv (mailsync.bi>
                #14 0x0000000000edcbc0 execute_native_thread_routine (mailsync.bin + 0xadcbc0)
                #15 0x00007fe1e8782422 start_thread (libpthread.so.0 + 0x9422)
                #16 0x00007fe1e834bb83 __clone (libc.so.6 + 0xffb83)

To Reproduce Steps to reproduce the behavior:

  1. Use MailSpring and has some coredumps collector.
  2. Wait enough time, do work, ready our emails, sync!
  3. coredumpctl
  4. See coredumps.

Expected behavior Known bugs or explanations on this. I don't think it's okay for a program to crash, neither it's really good for its "battery-friendly" aspect I believe.


Note:

As it is closed source, I am personally in the dark, I just cannot run gdb and try to understand or fix it properly. I understand the reasons behind a closed source tree, but really I think it should be possible to get access to the source code upon request while accepting that we will never bother you about support for it. Something between closed source & open source, or just close all bugs reports, I can read C++0x or whatever you use nowadays.

MailSync would be an awesome piece of code for the email landscape on Linux, I find this is a shame we cannot really see it. But that's not the purpose of this bug report.

Screenshots I could attach a tarball of my 894 coredumps (or whatever is still on my disk, after garbage collection/rotation).

Setup: (please complete the following information):

Additional context AFAIK, I don't know what could be the reason for this. I have 5 accounts to synchronize, also I have one inbox which is always synchronizing a folder and I don't understand why (everything is IMAP).

CodeMouse92 commented 3 years ago

2020 prevented much development work on Mailspring, but rest assured, development has resumed!

Mailsync is something we particularly want to improve the stability of. Going through the GitHub Issues (would you believe it's at least 75% duplicates??), I've been able to isolate three major bugs so far:

https://community.getmailspring.com/t/the-eternal-sync-bug/334

https://community.getmailspring.com/t/disappearing-emails-desync/428

https://community.getmailspring.com/t/crash-on-sync-unknown-exception/419

https://community.getmailspring.com/t/syncfolderuidrange-errorconnection-on-one-of-the-folders/412

I've migrated your issue to Discourse as well:

https://community.getmailspring.com/t/mailsync-is-unstable-or-not-very-reliable-core-dumps/429

@RaitoBezarius Please join that community and comment on that article, and I'll reassign it to you so you get the credit.

We are in the process of migrating issues to Discourse, which can better facilitate discussion and discovery, and so GitHub Issues can focus on issues that are confirmed and slated for resolution in the near term. Learn more about the changes here.

We hope to see you there soon!

-The Mailspring Team