KPixampCache crash

Jarosław Staniek js at
Thu Aug 23 15:10:02 CEST 2007

Rivo Laks pisze:

> Ühel kenal päeval (neljapäev 23 august 2007) kirjutasid sa:
>> Hello,
>> On first run, cache files in ~/.kde/cache-hostname/kpc are created. Then,
>> on second run, KPixmapCache opens and tries to mmap the data file. Then I
>> got the crash under win2000,, fresh kdelibs and Qt. Have anyone
>> encountered this or is the cache is working for you on win32?
>> 	msvcr71d.dll!memcpy(unsigned char * dst=0x00000019, unsigned char *
>> src=0x00d9f7ac, unsigned long count=4)  Line 218	Asm
> [...]
>>   	kdeui.dll!KIconCache::setThemeInfo(const QList<KIconTheme *> &
>> themes={...})  Line 260	C++
> [...]
> It looks like KPCMemoryDevice has an invalid memory pointer (0 perhaps?).
> I committed a small fix for KPCMemoryDevice which adds virtual keywords that 
> were previously missing. Maybe that has some effect for Windows.
> Also, the attached patch prints out memory address returned by mmap() and 
> checks for null pointer (although mmap() should never return 0). Could you 
> svn up, apply the patch and retry?

Thanks for your reply. Condition checked in your patch is not used in my case 
as    void* indexMem = mmap(0, info->available, PROT_READ | PROT_WRITE, 
MAP_SHARED, info->file->handle(), 0); returns indedxMem == -1, what's already 
Sorry for not tracking this down before, but now I can see mmapping is 
somewhat broken not at your level. We already are aware of this and will 
investigate this later.

In the patch below I have:
1. Used USE_MMAP everywhere instead of HAVE_MMAP (OK?)
2. Disabled using mmap for Windows (temporarily I suppose)
3. I've added some fixes so even if mmap is enabled on Windows, the cache now 
will not crash.

Please review.

> Also, how do you reproduce this? When you use the cache for the second time 
> then it should already have the theme infos and KIconCache::setThemeInfo() 
> shouldn't be called... If it still crashes, could you send me the cache files 
> created after the first run?

Please try to post there, I've added rivolaks at to the exception filter.

regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska ( to work on
  Kexi & KOffice:,
  KDE3 & KDE4 Libraries for MS Windows:,

More information about the Kde-windows mailing list