Bug: Crash when closing the app when a sync is running
The app potentially crashes when quitting while a sync is running.
Seen on macOS. A stack trace is below.
Call Stack.
Crashed Thread: 9 Thread (pooled)
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000008
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [37717]
VM Regions Near 0x8:
-->
__TEXT 000000010aa66000-000000010b5ff000 [ 11.6M] r-x/r-x SM=COW /Applications/OpenTodoList.app/Contents/MacOS/OpenTodoList
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff6bf57882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff6c018425 _pthread_cond_wait + 698
2 org.qt-project.QtCore 0x000000010ce498cb 0x10ce1f000 + 174283
3 org.qt-project.QtCore 0x000000010ce4980d QWaitCondition::wait(QMutex*, QDeadlineTimer) + 93
4 org.qt-project.QtCore 0x000000010ce46f73 QThreadPoolPrivate::waitForDone(int) + 179
5 org.qt-project.QtCore 0x000000010ce47562 QThreadPool::~QThreadPool() + 34
6 org.qt-project.QtCore 0x000000010ce48016 0x10ce1f000 + 167958
7 libsystem_c.dylib 0x00007fff6bebd13c __cxa_finalize_ranges + 319
8 libsystem_c.dylib 0x00007fff6bebd412 exit + 55
9 libdyld.dylib 0x00007fff6be13cd0 start + 8
Thread 1:: com.apple.CFSocket.private
0 libsystem_kernel.dylib 0x00007fff6bf5d0fe __select + 10
1 com.apple.CoreFoundation 0x00007fff31da5c53 __CFSocketManager + 641
2 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
3 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 2:: Thread (pooled)
0 libsystem_kernel.dylib 0x00007fff6bf57882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff6c018425 _pthread_cond_wait + 698
2 org.qt-project.QtCore 0x000000010ce49c1f 0x10ce1f000 + 175135
3 org.qt-project.QtCore 0x000000010ce498ee 0x10ce1f000 + 174318
4 org.qt-project.QtCore 0x000000010ce4980d QWaitCondition::wait(QMutex*, QDeadlineTimer) + 93
5 org.qt-project.QtCore 0x000000010ce4613d 0x10ce1f000 + 160061
6 org.qt-project.QtCore 0x000000010ce41a79 0x10ce1f000 + 141945
7 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 3:: Thread (pooled)
0 libsystem_kernel.dylib 0x00007fff6bf57882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff6c018425 _pthread_cond_wait + 698
2 org.qt-project.QtCore 0x000000010ce49c1f 0x10ce1f000 + 175135
3 org.qt-project.QtCore 0x000000010ce498ee 0x10ce1f000 + 174318
4 org.qt-project.QtCore 0x000000010ce4980d QWaitCondition::wait(QMutex*, QDeadlineTimer) + 93
5 org.qt-project.QtCore 0x000000010ce4613d 0x10ce1f000 + 160061
6 org.qt-project.QtCore 0x000000010ce41a79 0x10ce1f000 + 141945
7 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 4:: Thread (pooled)
0 libsystem_kernel.dylib 0x00007fff6bf57882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff6c018425 _pthread_cond_wait + 698
2 org.qt-project.QtCore 0x000000010ce49c1f 0x10ce1f000 + 175135
3 org.qt-project.QtCore 0x000000010ce498ee 0x10ce1f000 + 174318
4 org.qt-project.QtCore 0x000000010ce4980d QWaitCondition::wait(QMutex*, QDeadlineTimer) + 93
5 org.qt-project.QtCore 0x000000010ce4613d 0x10ce1f000 + 160061
6 org.qt-project.QtCore 0x000000010ce41a79 0x10ce1f000 + 141945
7 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 5:: Thread (pooled)
0 libsystem_kernel.dylib 0x00007fff6bf57882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff6c018425 _pthread_cond_wait + 698
2 org.qt-project.QtCore 0x000000010ce49c1f 0x10ce1f000 + 175135
3 org.qt-project.QtCore 0x000000010ce498ee 0x10ce1f000 + 174318
4 org.qt-project.QtCore 0x000000010ce4980d QWaitCondition::wait(QMutex*, QDeadlineTimer) + 93
5 org.qt-project.QtCore 0x000000010ce4613d 0x10ce1f000 + 160061
6 org.qt-project.QtCore 0x000000010ce41a79 0x10ce1f000 + 141945
7 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 6:: DirectoryWatcher
0 libsystem_kernel.dylib 0x00007fff6bf5b3d6 poll + 10
1 org.qt-project.QtCore 0x000000010d079180 qt_safe_poll(pollfd*, unsigned int, timespec const*) + 608
2 org.qt-project.QtCore 0x000000010d07a981 QEventDispatcherUNIX::processEvents(QFlags) + 849
3 org.qt-project.QtCore 0x000000010d012e0f QEventLoop::exec(QFlags) + 431
4 org.qt-project.QtCore 0x000000010ce40a63 QThread::exec() + 131
5 org.qt-project.QtCore 0x000000010ce41a79 0x10ce1f000 + 141945
6 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
7 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 7:: QQmlThread
0 libsystem_kernel.dylib 0x00007fff6bf5b3d6 poll + 10
1 org.qt-project.QtCore 0x000000010d079180 qt_safe_poll(pollfd*, unsigned int, timespec const*) + 608
2 org.qt-project.QtCore 0x000000010d07a981 QEventDispatcherUNIX::processEvents(QFlags) + 849
3 org.qt-project.QtCore 0x000000010d012e0f QEventLoop::exec(QFlags) + 431
4 org.qt-project.QtCore 0x000000010ce40a63 QThread::exec() + 131
5 org.qt-project.QtQml 0x000000010ca03839 0x10c771000 + 2697273
6 org.qt-project.QtCore 0x000000010ce41a79 0x10ce1f000 + 141945
7 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 8:: Thread (pooled)
0 libsystem_kernel.dylib 0x00007fff6bf57882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff6c018425 _pthread_cond_wait + 698
2 org.qt-project.QtCore 0x000000010ce49c1f 0x10ce1f000 + 175135
3 org.qt-project.QtCore 0x000000010ce498ee 0x10ce1f000 + 174318
4 org.qt-project.QtCore 0x000000010ce4980d QWaitCondition::wait(QMutex*, QDeadlineTimer) + 93
5 org.qt-project.QtCore 0x000000010ce4613d 0x10ce1f000 + 160061
6 org.qt-project.QtCore 0x000000010ce41a79 0x10ce1f000 + 141945
7 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 9 Crashed:: Thread (pooled)
0 org.qt-project.QtCore 0x000000010ce44a48 QReadWriteLock::tryLockForWrite(int) + 24
1 org.qt-project.QtSql 0x000000010cd85a38 0x10cd80000 + 23096
2 org.qt-project.QtSql 0x000000010cd8636a QSqlDatabase::addDatabase(QString const&, QString const&) + 122
3 net.rpdev.OpenTodoList 0x000000010aadacf1 WebDAVClient::openSyncDb() + 145
4 net.rpdev.OpenTodoList 0x000000010aad9498 WebDAVClient::syncDirectory(QString const&, QRegularExpression, QSet*) + 328
5 net.rpdev.OpenTodoList 0x000000010aae6f87 WebDAVSynchronizer::synchronize() + 3367
6 net.rpdev.OpenTodoList 0x000000010aad2a77 SyncJob::execute() + 1143
7 net.rpdev.OpenTodoList 0x000000010aad35ef SyncRunner::run() + 191
8 org.qt-project.QtCore 0x000000010ce45f4c 0x10ce1f000 + 159564
9 org.qt-project.QtCore 0x000000010ce41a79 0x10ce1f000 + 141945
10 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
11 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 10:: Thread (pooled)
0 org.qt-project.QtCore 0x000000010d0901cc 0x10ce1f000 + 2560460
1 org.qt-project.QtCore 0x000000010d0901a6 0x10ce1f000 + 2560422
2 org.qt-project.QtCore 0x000000010d093c65 QCborValue::dispose() + 37
3 org.qt-project.QtCore 0x000000010d0a1792 QJsonDocument::~QJsonDocument() + 50
4 net.rpdev.OpenTodoList 0x000000010aacf145 Synchronizer::loadLog() + 1877
5 net.rpdev.OpenTodoList 0x000000010aad2773 SyncJob::execute() + 371
6 net.rpdev.OpenTodoList 0x000000010aad35ef SyncRunner::run() + 191
7 org.qt-project.QtCore 0x000000010ce45f4c 0x10ce1f000 + 159564
8 org.qt-project.QtCore 0x000000010ce41a79 0x10ce1f000 + 141945
9 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
10 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 11:: Thread (pooled)
0 libsystem_kernel.dylib 0x00007fff6bf57882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff6c018425 _pthread_cond_wait + 698
2 org.qt-project.QtCore 0x000000010ce49c1f 0x10ce1f000 + 175135
3 org.qt-project.QtCore 0x000000010ce498ee 0x10ce1f000 + 174318
4 org.qt-project.QtCore 0x000000010ce4980d QWaitCondition::wait(QMutex*, QDeadlineTimer) + 93
5 org.qt-project.QtCore 0x000000010ce4613d 0x10ce1f000 + 160061
6 org.qt-project.QtCore 0x000000010ce41a79 0x10ce1f000 + 141945
7 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 12:: com.apple.NSEventThread
0 libsystem_kernel.dylib 0x00007fff6bf54dfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff6bf55170 mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff31d7cef5 __CFRunLoopServiceMachPort + 247
3 com.apple.CoreFoundation 0x00007fff31d7b9c2 __CFRunLoopRun + 1319
4 com.apple.CoreFoundation 0x00007fff31d7ae3e CFRunLoopRunSpecific + 462
5 com.apple.AppKit 0x00007fff2f18e954 _NSEventThread + 132
6 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
7 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 13:: Qt bearer thread
0 libsystem_kernel.dylib 0x00007fff6bf5b3d6 poll + 10
1 org.qt-project.QtCore 0x000000010d078f7a qt_safe_poll(pollfd*, unsigned int, timespec const*) + 90
2 org.qt-project.QtCore 0x000000010d07a981 QEventDispatcherUNIX::processEvents(QFlags) + 849
3 org.qt-project.QtCore 0x000000010d012e0f QEventLoop::exec(QFlags) + 431
4 org.qt-project.QtCore 0x000000010ce40a63 QThread::exec() + 131
5 org.qt-project.QtCore 0x000000010ce41a79 0x10ce1f000 + 141945
6 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
7 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 14:
0 libsystem_pthread.dylib 0x00007fff6c013b68 start_wqthread + 0
Thread 15:: FileInfoThread
0 libsystem_kernel.dylib 0x00007fff6bf57882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff6c018425 _pthread_cond_wait + 698
2 org.qt-project.QtCore 0x000000010ce498cb 0x10ce1f000 + 174283
3 org.qt-project.QtCore 0x000000010ce4980d QWaitCondition::wait(QMutex*, QDeadlineTimer) + 93
4 libqmlfolderlistmodelplugin.dylib 0x00000001e6b2c6f0 0x1e6b24000 + 34544
5 org.qt-project.QtCore 0x000000010ce41a79 0x10ce1f000 + 141945
6 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
7 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 16:: FileInfoThread
0 libsystem_kernel.dylib 0x00007fff6bf57882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff6c018425 _pthread_cond_wait + 698
2 org.qt-project.QtCore 0x000000010ce498cb 0x10ce1f000 + 174283
3 org.qt-project.QtCore 0x000000010ce4980d QWaitCondition::wait(QMutex*, QDeadlineTimer) + 93
4 libqmlfolderlistmodelplugin.dylib 0x00000001e6b2c6f0 0x1e6b24000 + 34544
5 org.qt-project.QtCore 0x000000010ce41a79 0x10ce1f000 + 141945
6 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
7 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 17:
0 libsystem_pthread.dylib 0x00007fff6c013b68 start_wqthread + 0
Thread 18:: CVDisplayLink
0 libsystem_kernel.dylib 0x00007fff6bf57882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff6c018457 _pthread_cond_wait + 748
2 com.apple.CoreVideo 0x00007fff33d0ed2b CVDisplayLink::waitUntil(unsigned long long) + 229
3 com.apple.CoreVideo 0x00007fff33d0e238 CVDisplayLink::runIOThread() + 482
4 libsystem_pthread.dylib 0x00007fff6c018109 _pthread_start + 148
5 libsystem_pthread.dylib 0x00007fff6c013b8b thread_start + 15
Thread 19:
0 libsystem_pthread.dylib 0x00007fff6c013b68 start_wqthread + 0
Thread 20:
0 libsystem_pthread.dylib 0x00007fff6c013b68 start_wqthread + 0
Thread 9 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x0000000000000008 rcx: 0x0000000000000002 rdx: 0x000000009a869940
rdi: 0x0000000000000008 rsi: 0x00000000ffffffff rbp: 0x00007000024eda10 rsp: 0x00007000024ed9e0
r8: 0x00000000000001ff r9: 0x00000000000007fb r10: 0x00000000000027e0 r11: 0x0000000000000020
r12: 0x0000000000000008 r13: 0x0000000000000000 r14: 0x00007000024edad0 r15: 0x00007000024edaf0
rip: 0x000000010ce44a48 rfl: 0x0000000000010246 cr2: 0x0000000000000008
Logical CPU: 1
Error Code: 0x00000006 (no mapping for user data write)
Trap Number: 14