Skip to content
  • Dmitry Kazakov's avatar
    Fix random crash when swap-file location has not got enough disk space · ac020c6c
    Dmitry Kazakov authored
    Lockfree hash table iterators have a requirement of no-concurrent-inserts,
    so we must ensure that the swapper and pooler do *not* insert any tiles,
    why iteration is in progress. KisTileDataStore::trySwapTileData() is called
    exactly from inside of the swapper iteration loop.
    
    If we break this requirement, the insert operation may request a table
    migration, and the iterator will continue iterating the old, invalid,
    table.
    
    The actual crash happened after line 'item = iter->next()' in
    KisTileDataSwapper::pass(), which actually returned value '1', meaning
    "Redirect". Address 0x0000000000000029 is a fetch of
    KisTileData::m_mementoFlag (offset 0x28) with 'this' set to 0x01 :)
    
    BUG:411081
    ac020c6c