From 192a086ea8c322e5a4d83bfc8bfe0b04d1e18c84 Mon Sep 17 00:00:00 2001 From: Johannes Huber Date: Thu, 4 Oct 2012 07:25:15 +0000 Subject: Revision bump backports upstream patches to fix bug #435112. Remove unused patches. (Portage version: 2.2.0_alpha134/cvs/Linux x86_64) --- kde-base/nepomuk-core/ChangeLog | 13 ++- ...nepomuk-core-4.9.0-kinotify-infinite-loop.patch | 21 ----- .../nepomuk-core-4.9.0-kinotify-memleak.patch | 105 --------------------- .../files/nepomuk-core-4.9.2-dirwatch-null.patch | 44 +++++++++ .../files/nepomuk-core-4.9.2-kinotify-delete.patch | 25 +++++ kde-base/nepomuk-core/nepomuk-core-4.9.2-r1.ebuild | 27 ++++++ kde-base/nepomuk-core/nepomuk-core-4.9.2.ebuild | 22 ----- 7 files changed, 108 insertions(+), 149 deletions(-) delete mode 100644 kde-base/nepomuk-core/files/nepomuk-core-4.9.0-kinotify-infinite-loop.patch delete mode 100644 kde-base/nepomuk-core/files/nepomuk-core-4.9.0-kinotify-memleak.patch create mode 100644 kde-base/nepomuk-core/files/nepomuk-core-4.9.2-dirwatch-null.patch create mode 100644 kde-base/nepomuk-core/files/nepomuk-core-4.9.2-kinotify-delete.patch create mode 100644 kde-base/nepomuk-core/nepomuk-core-4.9.2-r1.ebuild delete mode 100644 kde-base/nepomuk-core/nepomuk-core-4.9.2.ebuild diff --git a/kde-base/nepomuk-core/ChangeLog b/kde-base/nepomuk-core/ChangeLog index 7eccb3b5d671..9a6b83e48351 100644 --- a/kde-base/nepomuk-core/ChangeLog +++ b/kde-base/nepomuk-core/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for kde-base/nepomuk-core # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/nepomuk-core/ChangeLog,v 1.10 2012/10/02 18:11:48 johu Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/nepomuk-core/ChangeLog,v 1.11 2012/10/04 07:25:15 johu Exp $ + +*nepomuk-core-4.9.2-r1 (04 Oct 2012) + + 04 Oct 2012; Johannes Huber + +files/nepomuk-core-4.9.2-dirwatch-null.patch, + +files/nepomuk-core-4.9.2-kinotify-delete.patch, + +nepomuk-core-4.9.2-r1.ebuild, + -files/nepomuk-core-4.9.0-kinotify-infinite-loop.patch, + -files/nepomuk-core-4.9.0-kinotify-memleak.patch, -nepomuk-core-4.9.2.ebuild: + Revision bump backports upstream patches to fix bug #435112. Remove unused + patches. *nepomuk-core-4.9.2 (02 Oct 2012) diff --git a/kde-base/nepomuk-core/files/nepomuk-core-4.9.0-kinotify-infinite-loop.patch b/kde-base/nepomuk-core/files/nepomuk-core-4.9.0-kinotify-infinite-loop.patch deleted file mode 100644 index 95554867c498..000000000000 --- a/kde-base/nepomuk-core/files/nepomuk-core-4.9.0-kinotify-infinite-loop.patch +++ /dev/null @@ -1,21 +0,0 @@ -commit 7322b28f46969adb721daecf5a7fb67b8e0c6ae4 -Author: Vishesh Handa -Date: Wed Aug 8 14:33:02 2012 +0530 - - Break out of kinotify's _k_addWatches loop - - Didn't test the patch out after making a super trivial change in the - review request. Stupid Stupid me! - -diff --git a/services/filewatch/kinotify.cpp b/services/filewatch/kinotify.cpp -index 47eb8ed..509abff 100644 ---- a/services/filewatch/kinotify.cpp -+++ b/services/filewatch/kinotify.cpp -@@ -152,6 +152,7 @@ public: - } - else { - delete dirIterators.dequeue(); -+ break; - } - } - diff --git a/kde-base/nepomuk-core/files/nepomuk-core-4.9.0-kinotify-memleak.patch b/kde-base/nepomuk-core/files/nepomuk-core-4.9.0-kinotify-memleak.patch deleted file mode 100644 index 806f6c924ef5..000000000000 --- a/kde-base/nepomuk-core/files/nepomuk-core-4.9.0-kinotify-memleak.patch +++ /dev/null @@ -1,105 +0,0 @@ -commit a81f05034baef438eacd346fcbc97dd818a0b5bf -Author: Vishesh Handa -Date: Mon Aug 6 15:01:14 2012 +0530 - - kinotify: Do not store the paths to be added - - kinotify used a QQueue to store all the directories which - need to be added. Since we use QDirIterator, each path is presented as a - QString which is then encoded to its QByteArray (QFile::encodeName). - This results in *large* chunks of memory being allocated, and then - slowly being deallocated. - - Instead, we now use a QDirIterator, and do not store all the directories - which need to be added, we simply iterate over them. This way we do not - allocate large amounts of memory. - - There is a large performance improvement as well. On my system, with - 38829 directories, adding all the watches now takes only about 10 seconds, - instead of about 65. - - Patch possible due to massif output provided by Jure Repinc . - Thanks a lot. - - tldr: Use DFS instead of BFS -> Less memory consumption - - BUG: 304476 - REVIEW: 105892 - DIGEST: Fix massive memory leak in Nepomuk File Monitoring Service - -diff --git a/services/filewatch/kinotify.cpp b/services/filewatch/kinotify.cpp -index e8843c8..47eb8ed 100644 ---- a/services/filewatch/kinotify.cpp -+++ b/services/filewatch/kinotify.cpp -@@ -79,8 +79,8 @@ public: - QHash watchPathHash; - QHash pathWatchHash; - -- /// queue of paths to install watches for -- QQueue pathsToWatch; -+ /// A list of all the current dirIterators -+ QQueue dirIterators; - - unsigned char eventBuffer[EVENT_BUFFER_SIZE]; - -@@ -136,20 +136,6 @@ public: - } - } - -- bool addWatchesRecursively( const QByteArray& path ) -- { -- if ( !addWatch( path ) ) -- return false; -- -- const QString stringPath = QFile::decodeName(path); -- QDirIterator iter( stringPath, QDir::Dirs | QDir::NoDotAndDotDot ); -- while( iter.hasNext() ) { -- pathsToWatch.enqueue( QFile::encodeName(iter.next()) ); -- } -- -- return true; -- } -- - void removeWatch( int wd ) { - kDebug() << wd << watchPathHash[wd]; - pathWatchHash.remove( watchPathHash.take( wd ) ); -@@ -159,19 +145,20 @@ public: - void _k_addWatches() { - // add the next batch of paths - for ( int i = 0; i < 100; ++i ) { -- if ( pathsToWatch.isEmpty() || -- !addWatchesRecursively( pathsToWatch.dequeue() ) ) { -- return; -+ QDirIterator* it = dirIterators.front(); -+ if( it->hasNext() ) { -+ it->next(); -+ addWatch( QFile::encodeName(it->filePath()) ); -+ } -+ else { -+ delete dirIterators.dequeue(); - } - } - - // asyncroneously add the next batch -- if ( !pathsToWatch.isEmpty() ) { -+ if ( !dirIterators.isEmpty() ) { - QMetaObject::invokeMethod( q, "_k_addWatches", Qt::QueuedConnection ); - } -- else { -- kDebug() << "All watches installed"; -- } - } - - private: -@@ -245,7 +232,10 @@ bool KInotify::addWatch( const QString& path, WatchEvents mode, WatchFlags flags - - d->mode = mode; - d->flags = flags; -- d->pathsToWatch.append( QFile::encodeName( path ) ); -+ d->addWatch( QFile::encodeName(path) ); -+ QDirIterator* iter = new QDirIterator( path, QDir::Dirs | QDir::NoDotAndDotDot, -+ QDirIterator::Subdirectories ); -+ d->dirIterators.append( iter ); - d->_k_addWatches(); - return true; - } diff --git a/kde-base/nepomuk-core/files/nepomuk-core-4.9.2-dirwatch-null.patch b/kde-base/nepomuk-core/files/nepomuk-core-4.9.2-dirwatch-null.patch new file mode 100644 index 000000000000..fb08140536bf --- /dev/null +++ b/kde-base/nepomuk-core/files/nepomuk-core-4.9.2-dirwatch-null.patch @@ -0,0 +1,44 @@ +commit 32b44881dda4f243932c59c11bf39c91f30c224b +Author: Dan Vrátil +Date: Wed Oct 3 13:27:22 2012 +0200 + + Add null-crash guards for m_dirWatch to FileWatch + + BUG: 307388 + +diff --git a/services/filewatch/nepomukfilewatch.cpp b/services/filewatch/nepomukfilewatch.cpp +index 94db504..83045da 100644 +--- a/services/filewatch/nepomukfilewatch.cpp ++++ b/services/filewatch/nepomukfilewatch.cpp +@@ -114,6 +114,7 @@ namespace { + + Nepomuk2::FileWatch::FileWatch( QObject* parent, const QList& ) + : Service( parent ) ++ , m_dirWatch( 0 ) + { + // Create the configuration instance singleton (for thread-safety) + // ============================================================== +@@ -324,8 +325,10 @@ void Nepomuk2::FileWatch::slotInotifyWatchUserLimitReached() + { + // we do it the brutal way for now hoping with new kernels and defaults this will never happen + // Delete the KInotify and switch to KDirNotify dbus signals +- m_dirWatch->deleteLater(); +- m_dirWatch = 0; ++ if( m_dirWatch ) { ++ m_dirWatch->deleteLater(); ++ m_dirWatch = 0; ++ } + connectToKDirWatch(); + } + #endif +@@ -413,7 +416,9 @@ void Nepomuk2::FileWatch::slotDeviceMounted(const Nepomuk2::RemovableMediaCache: + void Nepomuk2::FileWatch::slotDeviceTeardownRequested(const Nepomuk2::RemovableMediaCache::Entry* entry ) + { + #ifdef BUILD_KINOTIFY +- m_dirWatch->removeWatch( entry->mountPath() ); ++ if( m_dirWatch ) { ++ m_dirWatch->removeWatch( entry->mountPath() ); ++ } + #endif + } + diff --git a/kde-base/nepomuk-core/files/nepomuk-core-4.9.2-kinotify-delete.patch b/kde-base/nepomuk-core/files/nepomuk-core-4.9.2-kinotify-delete.patch new file mode 100644 index 000000000000..a683c133b336 --- /dev/null +++ b/kde-base/nepomuk-core/files/nepomuk-core-4.9.2-kinotify-delete.patch @@ -0,0 +1,25 @@ +commit 804e54f83ade8a377d392d350981ead07f60a9d3 +Author: David Faure +Date: Tue Oct 2 20:27:03 2012 +0200 + + Fix crash when watchUserLimitReached() leads to deleting the KInotify instance + + ... which emitted the signal. So don't use a direct delete. + + BUG: 307388 + FIXED-IN: 4.9.3 + +diff --git a/services/filewatch/nepomukfilewatch.cpp b/services/filewatch/nepomukfilewatch.cpp +index 9fd5d9c..94db504 100644 +--- a/services/filewatch/nepomukfilewatch.cpp ++++ b/services/filewatch/nepomukfilewatch.cpp +@@ -323,7 +323,8 @@ void Nepomuk2::FileWatch::connectToKDirWatch() + void Nepomuk2::FileWatch::slotInotifyWatchUserLimitReached() + { + // we do it the brutal way for now hoping with new kernels and defaults this will never happen +- delete m_dirWatch; ++ // Delete the KInotify and switch to KDirNotify dbus signals ++ m_dirWatch->deleteLater(); + m_dirWatch = 0; + connectToKDirWatch(); + } diff --git a/kde-base/nepomuk-core/nepomuk-core-4.9.2-r1.ebuild b/kde-base/nepomuk-core/nepomuk-core-4.9.2-r1.ebuild new file mode 100644 index 000000000000..ded05864b4fa --- /dev/null +++ b/kde-base/nepomuk-core/nepomuk-core-4.9.2-r1.ebuild @@ -0,0 +1,27 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/nepomuk-core/nepomuk-core-4.9.2-r1.ebuild,v 1.1 2012/10/04 07:25:15 johu Exp $ + +EAPI=4 + +inherit kde4-base + +DESCRIPTION="Nepomuk core libraries" +KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux" +IUSE="debug" + +DEPEND=" + >=app-misc/strigi-0.7.7[dbus,qt4] + >=dev-libs/soprano-2.8.0[dbus,raptor,redland,virtuoso] +" +RDEPEND="${DEPEND}" + +add_blocker nepomuk '<4.8.80' + +RESTRICT="test" +# bug 392989 + +PATCHES=( + "${FILESDIR}/${P}-kinotify-delete.patch" + "${FILESDIR}/${P}-dirwatch-null.patch" +) diff --git a/kde-base/nepomuk-core/nepomuk-core-4.9.2.ebuild b/kde-base/nepomuk-core/nepomuk-core-4.9.2.ebuild deleted file mode 100644 index 75d33a4b53dc..000000000000 --- a/kde-base/nepomuk-core/nepomuk-core-4.9.2.ebuild +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/nepomuk-core/nepomuk-core-4.9.2.ebuild,v 1.1 2012/10/02 18:11:48 johu Exp $ - -EAPI=4 - -inherit kde4-base - -DESCRIPTION="Nepomuk core libraries" -KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux" -IUSE="debug" - -DEPEND=" - >=app-misc/strigi-0.7.7[dbus,qt4] - >=dev-libs/soprano-2.8.0[dbus,raptor,redland,virtuoso] -" -RDEPEND="${DEPEND}" - -add_blocker nepomuk '<4.8.80' - -RESTRICT="test" -# bug 392989 -- cgit v1.2.3-65-gdbad