[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: mmap failures in KPixmapCache
From:       Thiago Macieira <thiago () kde ! org>
Date:       2009-11-19 12:57:18
Message-ID: 200911191357.18773.thiago () kde ! org
[Download RAW message or body]


Em Quarta-feira 18 Novembro 2009, às 23:31:25, você escreveu:
> I see it here on "Linux parkotron 2.6.31-ARCH #1 SMP PREEMPT Tue Nov
> 10 19:01:40 CET 2009 x86_64 Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz
> GenuineIntel GNU/Linux"
> 
> Unfortunately, I know nothing about, mmapping or QFile::map. It
> doesn't makes sense for me to report it as I can't provide the
> relevant details. David, are you able to report it?

We found the issue. It's a KDE bug.

KPixmapCache was trying to extend the file by mapping a section of the file past 
the end, then writing to it. That was never guaranteed to work. In fact, it 
didn't work outside Linux.

In Qt 4.6, when testing mmap on other platforms, we realised that this didn't 
work on Mac, so we introduced a check to ensure that you don't rely on non-
cross-platform behaviour. That's what KDE was tripping on.

Note that Python has the same limitation:

$ python <<EOF
import os, mmap
f = os.open("/tmp/file", os.O_RDWR | os.O_CREAT, 0644)
mmap.mmap(f, 128
EOF
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
ValueError: mmap length is greater than file size


-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic