Backport upstream patch to avoid use of setrlimit (RH #1133924)

This commit is contained in:
Debarshi Ray 2014-11-10 16:03:17 +01:00
parent 668f85c55f
commit cad5ab190c
3 changed files with 70 additions and 30 deletions

View File

@ -1,26 +0,0 @@
From 5d841e9bdf3dc2a8e39e67d52c0b547fd6a26c88 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Tue, 12 Nov 2013 16:09:57 +0100
Subject: [PATCH] Bump the minimum memory requirement to 768M
http://bugzilla.gnome.org/show_bug.cgi?id=712142
---
src/libtracker-common/tracker-os-dependant-unix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libtracker-common/tracker-os-dependant-unix.c b/src/libtracker-common/tracker-os-dependant-unix.c
index 24108f4..2fa7c93 100644
--- a/src/libtracker-common/tracker-os-dependant-unix.c
+++ b/src/libtracker-common/tracker-os-dependant-unix.c
@@ -39,7 +39,7 @@
/* Maximum here is a G_MAXLONG, so if you want to use > 2GB, you have
* to set MEM_LIMIT to RLIM_INFINITY
*/
-#define MEM_LIMIT_MIN 256 * 1024 * 1024
+#define MEM_LIMIT_MIN 768 * 1024 * 1024
#if defined(__OpenBSD__) && !defined(RLIMIT_AS)
#define RLIMIT_AS RLIMIT_DATA
--
1.8.4.2

View File

@ -0,0 +1,63 @@
From 35dbe5e46ad7c8e2c6343349b87d44e71fa32eb8 Mon Sep 17 00:00:00 2001
From: Martyn Russell <martyn@lanedo.com>
Date: Mon, 13 Oct 2014 11:41:57 +0100
Subject: [PATCH] tracker-extract: Avoid the use of setrlimit() it's causing
problems
Part of the solution is this commit, see:
https://bugzilla.gnome.org/show_bug.cgi?id=737663
The other part is to use cgroups
---
src/tracker-extract/tracker-main.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/tracker-extract/tracker-main.c b/src/tracker-extract/tracker-main.c
index f7e3e55..22af4b2 100644
--- a/src/tracker-extract/tracker-main.c
+++ b/src/tracker-extract/tracker-main.c
@@ -29,9 +29,9 @@
#include <sys/types.h>
#include <unistd.h>
-#include <glib.h>
#include <glib-object.h>
#include <glib/gi18n.h>
+#include <glib/gprintf.h>
#include <gio/gio.h>
#ifndef G_OS_WIN32
@@ -42,12 +42,7 @@
#include <libmediaart/mediaart.h>
#endif
-#include <libtracker-common/tracker-log.h>
-#include <libtracker-common/tracker-dbus.h>
-#include <libtracker-common/tracker-os-dependant.h>
-#include <libtracker-common/tracker-ioprio.h>
-#include <libtracker-common/tracker-locale.h>
-#include <libtracker-common/tracker-sched.h>
+#include <libtracker-common/tracker-common.h>
#include <libtracker-data/tracker-db-manager.h>
@@ -278,8 +273,6 @@ run_standalone (TrackerConfig *config)
return EXIT_FAILURE;
}
- tracker_memory_setrlimits ();
-
tracker_extract_get_metadata_by_cmdline (object, uri, mime_type);
g_object_unref (object);
@@ -364,7 +357,6 @@ main (int argc, char *argv[])
/* This makes sure we don't steal all the system's resources */
initialize_priority_and_scheduling (tracker_config_get_sched_idle (config),
tracker_db_manager_get_first_index_done () == FALSE);
- tracker_memory_setrlimits ();
extract = tracker_extract_new (TRUE, force_module);
--
2.1.0

View File

@ -16,7 +16,7 @@
Name: tracker
Version: 1.2.4
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Desktop-neutral search tool and indexer
Group: Applications/System
@ -28,8 +28,8 @@ Source0: https://download.gnome.org/sources/%{name}/1.2/%{name}-%{version
# https://bugzilla.redhat.com/show_bug.cgi?id=771601
Patch1: tracker-0.15-onlyshowin.patch
# https://bugzilla.gnome.org/show_bug.cgi?id=712142
Patch3: 0001-Bump-the-minimum-memory-requirement-to-768M.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1133924
Patch2: 0001-Bump-the-minimum-memory-requirement-to-768M.patch
BuildRequires: desktop-file-utils
BuildRequires: firefox
@ -170,7 +170,7 @@ This package contains the documentation for tracker
%setup -q
%patch1 -p1 -b .onlyshowin
%patch3 -p1 -b .memory
%patch2 -p1 -b .rlimits
## nuke unwanted rpaths, see also
## https://fedoraproject.org/wiki/Packaging/Guidelines#Beware_of_Rpath
@ -316,6 +316,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%changelog
* Mon Nov 10 2014 Debarshi Ray <rishi@fedoraproject.org> - 1.2.4-2
- Backport upstream patch to avoid use of setrlimit (RH #1133924)
* Thu Nov 06 2014 Kalev Lember <kalevlember@gmail.com> - 1.2.4-1
- Update to 1.2.4