[Bug 160284] bad mmap causes cores in KPCMemoryDevice

Rivo Laks rivolaks at hot.ee
Fri May 30 15:30:56 CEST 2008


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=160284         




------- Additional Comments From rivolaks hot ee  2008-05-30 15:30 -------
With mmap disabled, you'll probably get extra file open+close operation whenever the cache is accessed. But it shouldn't be that slow, I remember using the cache was faster than not using cache even before I implemented the mmap support. So I think you can disable it safely until the problem gets sorted out.

deleteCache() might indeed be causing problems, it should probably do something like KPixmapCachePrivate::invalidateMmapFiles() to make all KPixmapCache objects re-mmap the files. The problem is that deleteCache() is static and therefore doesn't have the mmapped memory. Maybe it could temporarily mmap it, just to invalidate it?

It might also be worth it to check in KPixmapCache::Private::dataDevice() if the data file exists before opening KPCMemoryDevice on it (as the latter accesses the mmapped memory which could be invalid if the file has been deleted). Private::indexDevice already does that.


More information about the Kdelibs-bugs mailing list