KPixampCache crash

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Thu Aug 23 15:20:47 CEST 2007


> Von: "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.
>
That's fine - altough it's currently only crashed on windows, it can not work on other platforms too as QFile::handle() can be everything but the correct handle needed for mmap(). It's just luck that it works on other platforms.

Christian
-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail



More information about the Kde-windows mailing list