Tarsnap / tarsnap-gui

Cross-platform GUI for the Tarsnap backup service.

Home Page:https://www.tarsnap.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Figure out crash in PersistentStore::deinit()

gperciva opened this issue · comments

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;
    }
}

This might not be relevant to the current code:

  • d8aba6f stopped having the database as a class member (which the Qt API warned against doing)
  • 049c09b moved the mutex from being a class member to a static variable.