Tarsnap / tarsnap-gui

Cross-platform GUI for the Tarsnap backup service.
https://www.tarsnap.com
BSD 2-Clause "Simplified" License
251 stars 25 forks source link

Figure out crash in PersistentStore::deinit() #564

Open gperciva opened 10 months ago

gperciva commented 10 months ago

Apparently tarsnap-gui 1.0.2 can crash in PersistentStore::deinit() (???)

Excerpt from crash log:

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   QtCore                                     0x10464bc84 QReadWriteLock::tryLockForWrite(int) + 36
1   QtSql                                      0x103058e84 0x103050000 + 36484
2   Tarsnap                                    0x102ae0038 PersistentStore::deinit() + 112
3   Tarsnap                                    0x102ae02f8 PersistentStore::~PersistentStore() + 36
4   libsystem_c.dylib                          0x18c827060 __cxa_finalize_ranges + 476
5   libsystem_c.dylib                          0x18c826de8 exit + 44

The code in question is:

void PersistentStore::deinit()
{   
    QMutexLocker locker(&_mutex);

    if(_initialized)
    {
        _db.close();
        _db = QSqlDatabase();
        _db.removeDatabase("tarsnap");
        _initialized = false;
    }
}
gperciva commented 10 months ago

This might not be relevant to the current code: