mmap failures in KPixmapCache
Andreas Pakulat
apaku at gmx.de
Thu Nov 19 22:41:52 GMT 2009
On 19.11.09 14:49:06, David Nolden wrote:
> Am Donnerstag 19 November 2009 13:57:18 schrieb Thiago Macieira:
> > 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.
>
> This is definitely not the case for KDevelop. On my system, alone this simple
> test application fails:
>
> "
> #include <QFile>
>
> int main(int argc, char** argv)
> {
> {
> QFile f("maptest.data");
> f.open(QIODevice::WriteOnly);
> f.write("aaaaaaaaaaaaaaaaaaaa", 20);
> }
> {
> QFile f("maptest.data");
> f.open(QIODevice::ReadOnly);
> Q_ASSERT(f.isOpen());
> Q_ASSERT(f.map(0, f.size()));
> }
> }
> "
>
> It happens with both kernel versions 2.6.31 and 2.6.27. I'm using a 64-bit
> kernel and userspace.
>
> Is this failure reproducible somewhere else? Unfortunately, I don't have the
> qt sources installed, else I would dig into them and check for the actual
> problem.
I can't reproduce any problem here either (Qt4.6 from kde-qt, last commit
is 69720650b2283). I'll probably do the full rebuild cycle tomorrow
night, will retry after updating Qt.
Andreas
--
In the stairway of life, you'd best take the elevator.
More information about the kde-core-devel
mailing list