KPixampCache crash

Rivo Laks rivolaks at hot.ee
Thu Aug 23 15:22:52 CEST 2007


Ühel kenal päeval (neljapäev 23 august 2007) kirjutas Jarosław Staniek:
> 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, msvc.net, 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 covered.
> 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.

Looks good, except that I think invalidateMmapFiles() shouldn't check whether 
the cache is valid anymore. This way even a cache that has become invalid can 
be invalidated.
Otherwise, please commit.

Rivo



More information about the Kde-windows mailing list