Control: tags 918316 + patch pending Dear maintainer,
to fix the issues with this package, I've prepared an NMU for nocache (versioned as 1.1-1.1), debdiff below. An upload to DELAYED/5 will follow shortly. Please feel free to tell me if I should delay it longer. Regards, Christoph
diff -Nru nocache-1.1/debian/changelog nocache-1.1/debian/changelog --- nocache-1.1/debian/changelog 2019-01-04 04:37:54.000000000 +0100 +++ nocache-1.1/debian/changelog 2024-06-09 18:35:07.000000000 +0200 @@ -1,3 +1,14 @@ +nocache (1.1-1.1) unstable; urgency=medium + + * Non-maintainer upload + * Cherry-pick upstream commit "Cap the number of FDs nocache tracks + und thus bound its memory usage" so nocache still is usable with + increased file limits. Closes: #918316 + * Replace test command during build with "true" so timeouts are not + a problem. Closes: #918316 (again) + + -- Christoph Biedl <debian.a...@manchmal.in-ulm.de> Sun, 09 Jun 2024 18:35:07 +0200 + nocache (1.1-1) unstable; urgency=medium [ Ondřej Nový ] diff -Nru nocache-1.1/debian/patches/1546932589.v1.1-2-gb3016b5.cap-the-number-of-fds-nocache-tracks-und-thus-bound-its-memory-usage.patch nocache-1.1/debian/patches/1546932589.v1.1-2-gb3016b5.cap-the-number-of-fds-nocache-tracks-und-thus-bound-its-memory-usage.patch --- nocache-1.1/debian/patches/1546932589.v1.1-2-gb3016b5.cap-the-number-of-fds-nocache-tracks-und-thus-bound-its-memory-usage.patch 1970-01-01 01:00:00.000000000 +0100 +++ nocache-1.1/debian/patches/1546932589.v1.1-2-gb3016b5.cap-the-number-of-fds-nocache-tracks-und-thus-bound-its-memory-usage.patch 2024-06-09 18:23:12.000000000 +0200 @@ -0,0 +1,78 @@ +Subject: Cap the number of FDs nocache tracks und thus bound its memory usage +Origin: upstream, commit v1.1-2-gb3016b5 <https://github.com/Feh/nocache/commit/v1.1-2-gb3016b5> +Author: Julius Plenz <jul...@plenz.com> +Date: Tue Jan 8 18:29:49 2019 +1100 + + This implements option 2 layed out in issue #38. + + Also fix an embarassing off-by-one error. + +--- a/README ++++ b/README +@@ -132,6 +132,11 @@ + $ nocache -f cat ~/file.mp3 + $ env NOCACHE_FLUSHALL=1 make test + ++By default `nocache` will only keep track of file descriptors less than 1 ++million that are opened by your application, in order to bound its memory ++consumption. If you want to change this threshold, you can supply the ++environment variable `NOCACHE_MAX_FDS` and set it to a higher (or lower) value. ++ + + Alternate Approaches + -------------------- +--- a/nocache.c ++++ b/nocache.c +@@ -75,6 +75,9 @@ + static char *env_flushall = "NOCACHE_FLUSHALL"; + static char flushall; + ++static char *env_max_fds = "NOCACHE_MAX_FDS"; ++static rlim_t max_fd_limit = 1 << 20; ++ + #define DEBUG(...) \ + do { \ + if(debugfp != NULL) { \ +@@ -89,8 +92,16 @@ + char *error; + struct rlimit rlim; + ++ if((s = getenv(env_max_fds)) != NULL) ++ max_fd_limit = atoll(s); ++ + getrlimit(RLIMIT_NOFILE, &rlim); + max_fds = rlim.rlim_max; ++ if(max_fds > max_fd_limit) ++ max_fds = max_fd_limit; ++ ++ if(max_fds == 0) ++ return; /* There's nothing to do for us here. */ + + init_mutexes(); + /* make sure to re-initialize mutex if forked */ +@@ -398,7 +409,7 @@ + { + sigset_t mask, old_mask; + +- if(fd >= max_fds) ++ if(fd >= max_fds - 1) + return; + + /* We might know something about this fd already, so assume we have missed +--- /dev/null ++++ b/t/maxfd.t +@@ -0,0 +1,14 @@ ++#!/bin/sh ++ ++NR=0 ++ ++. ./testlib.sh ++ ++echo 1..3 ++ ++t "echo test > testfile.$$ && ../cachestats -q testfile.$$" "file is cached" ++t "while ../cachestats -q testfile.$$; do ../cachedel testfile.$$ && sleep 1; done" "file is not cached any more" ++t "env NOCACHE_MAX_FDS=1 LD_PRELOAD=../nocache.so cat testfile.$$ >/dev/null && ../cachestats -q testfile.$$" "file is in cache because it has an FD > 1" ++ ++# clean up ++rm -f testfile.$$ diff -Nru nocache-1.1/debian/patches/series nocache-1.1/debian/patches/series --- nocache-1.1/debian/patches/series 2019-01-02 23:28:53.000000000 +0100 +++ nocache-1.1/debian/patches/series 2024-06-09 18:23:04.000000000 +0200 @@ -0,0 +1 @@ +1546932589.v1.1-2-gb3016b5.cap-the-number-of-fds-nocache-tracks-und-thus-bound-its-memory-usage.patch diff -Nru nocache-1.1/debian/rules nocache-1.1/debian/rules --- nocache-1.1/debian/rules 2019-01-04 03:36:05.000000000 +0100 +++ nocache-1.1/debian/rules 2024-06-09 18:26:20.000000000 +0200 @@ -18,5 +18,5 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) # -NOCACHE_NR_FADVISE=2 dh_auto_test -v ## #916415 - timeout 11 ./nocache apt show coreutils 1>>/dev/null + timeout 11 ./nocache true endif
signature.asc
Description: PGP signature