Diffusion Krita ac020c6cb412

Fix random crash when swap-file location has not got enough disk space

Authored by dkazakov on Aug 20 2019, 4:09 PM.

Description

Fix random crash when swap-file location has not got enough disk space

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