From: Waldemar Kozaczuk <
jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <
jwkoz...@gmail.com>
Branch: master
keydb: pin down to the version 5.3.1 and patch to disable setproctitle
Keybd would crash quite randomly on startyp and I discovered
it happens around logic calling setproctitle. Please
note that Linux does not implement this function, so keydb
provides its own version which causes some buggy
behavior on OSv related possibly in setenv() implementation (??)
and seems to be overwriting some kernel memory fragment.
Please see KeyDB implementation of setproctitle() -
https://github.com/JohnSully/KeyDB/blob/40d7a701feefd36e9e3fdb6d516228c4a70fcf3d/src/setproctitle.c.
Please see
https://www.freebsd.org/cgi/man.cgi?query=setproctitle&sektion=3.
Signed-off-by: Waldemar Kozaczuk <
jwkoz...@gmail.com>
---
diff --git a/keydb/.gitignore b/keydb/.gitignore
--- a/keydb/.gitignore
+++ b/keydb/.gitignore
@@ -0,0 +1,2 @@
+usr.manifest
+dump.rdb
diff --git a/keydb/Makefile b/keydb/Makefile
--- a/keydb/Makefile
+++ b/keydb/Makefile
@@ -2,7 +2,8 @@ SRC = $(shell readlink -f ../..)
upstream/KeyDB/.git:
mkdir -p upstream
- cd upstream && git clone --depth 1
https://github.com/JohnSully/KeyDB.git
+ cd upstream && git clone -b v5.3.1 --depth 1
https://github.com/JohnSully/KeyDB.git
+ cd $(SRC)/apps/keydb && patch upstream/KeyDB/src/server.cpp proctitle.patch
upstream/KeyDB/src/keydb-server: upstream/KeyDB/.git
cd upstream/KeyDB && make MALLOC=libc
@@ -12,4 +13,4 @@ module: upstream/KeyDB/src/keydb-server
strip upstream/KeyDB/src/keydb-server
clean:
- rm -rf upstream
+ rm -rf upstream usr.manifest
diff --git a/keydb/proctitle.patch b/keydb/proctitle.patch
--- a/keydb/proctitle.patch
+++ b/keydb/proctitle.patch
@@ -0,0 +1,11 @@
+--- a/upstream/KeyDB/src/server.cpp
++++ b/upstream/KeyDB/src/server.cpp
+@@ -5232,7 +5232,7 @@ int main(int argc, char **argv) {
+ initNetworking(cserver.cthreads > 1 /* fReusePort */);
+
+ if (background || cserver.pidfile) createPidFile();
+- redisSetProcTitle(argv[0]);
++ //redisSetProcTitle(argv[0]);
+ redisAsciiArt();
+ checkTcpBacklogSettings();
+
diff --git a/keydb/usr.manifest b/keydb/usr.manifest
--- a/keydb/usr.manifest
+++ b/keydb/usr.manifest
@@ -1,7 +0,0 @@
-# (PIE) Position Independent Executable
-/keydb-server: /home/wkozaczuk/projects/osv/apps/keydb/upstream/KeyDB/src/keydb-server
-# --------------------
-# Dependencies
-# --------------------
-/usr/lib/libuuid.so.1: /lib/x86_64-linux-gnu/libuuid.so.1
-# --------------------