diff -Nru siridb-server-2.0.45/debian/changelog siridb-server-2.0.45/debian/changelog --- siridb-server-2.0.45/debian/changelog 2022-02-07 10:09:39.000000000 -0500 +++ siridb-server-2.0.45/debian/changelog 2022-08-24 15:11:42.000000000 -0400 @@ -1,3 +1,10 @@ +siridb-server (2.0.45-1ubuntu1) kinetic; urgency=medium + + * debian/patches/0002-siri-db-add-NULL-check-before-calling-siridb_tasks_d.patch: + Fix hanging tests when linking against libuv1 1.44.2 (LP: #1987558). + + -- Nick Rosbrook Wed, 24 Aug 2022 15:11:42 -0400 + siridb-server (2.0.45-1) unstable; urgency=medium [ Ileana Dumitrescu ] diff -Nru siridb-server-2.0.45/debian/control siridb-server-2.0.45/debian/control --- siridb-server-2.0.45/debian/control 2022-02-07 10:09:39.000000000 -0500 +++ siridb-server-2.0.45/debian/control 2022-08-24 15:10:54.000000000 -0400 @@ -1,7 +1,8 @@ Source: siridb-server Section: database Priority: optional -Maintainer: SiriDB Maintainers +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: SiriDB Maintainers Uploaders: Jeroen van der Heijden , Paul Gevers , diff -Nru siridb-server-2.0.45/debian/patches/0002-siri-db-add-NULL-check-before-calling-siridb_tasks_d.patch siridb-server-2.0.45/debian/patches/0002-siri-db-add-NULL-check-before-calling-siridb_tasks_d.patch --- siridb-server-2.0.45/debian/patches/0002-siri-db-add-NULL-check-before-calling-siridb_tasks_d.patch 1969-12-31 19:00:00.000000000 -0500 +++ siridb-server-2.0.45/debian/patches/0002-siri-db-add-NULL-check-before-calling-siridb_tasks_d.patch 2022-08-24 15:11:42.000000000 -0400 @@ -0,0 +1,41 @@ +Description: siri/db: add NULL check before calling siridb_tasks_dec + When built against libuv1 1.44.2, siridb_query_free may call + siridb_tasks_dec on NULL, causing a segfault. Add a NULL check on siridb + before calling siridb_tasks_dec to avoid this. +Author: Nick Rosbrook +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/siridb-server/+bug/1987558 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1017748 +Forwarded: https://github.com/SiriDB/siridb-server/pull/182 +Last-Update: 2022-08-24 +--- +From 90c261499af260f3450b4a2e00ec828bca81211a Mon Sep 17 00:00:00 2001 +From: Nick Rosbrook +Date: Wed, 24 Aug 2022 14:57:07 -0400 +Subject: [PATCH] siri/db: add NULL check before calling siridb_tasks_dec + +When built against libuv1 1.44.2, siridb_query_free may call +siridb_tasks_dec on NULL, causing a segfault. Add a NULL check on siridb +before calling siridb_tasks_dec to avoid this. +--- + src/siri/db/query.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/siri/db/query.c b/src/siri/db/query.c +index 3f9f7a0a..555628e4 100644 +--- a/src/siri/db/query.c ++++ b/src/siri/db/query.c +@@ -156,7 +156,10 @@ void siridb_query_free(uv_handle_t * handle) + siridb_t * siridb = query->client->siridb; + + /* decrement active tasks */ +- siridb_tasks_dec(siridb->tasks); ++ if (siridb != NULL) ++ { ++ siridb_tasks_dec(siridb->tasks); ++ } + + /* free query */ + free(query->q); +-- +2.34.1 + diff -Nru siridb-server-2.0.45/debian/patches/series siridb-server-2.0.45/debian/patches/series --- siridb-server-2.0.45/debian/patches/series 2022-02-07 10:09:39.000000000 -0500 +++ siridb-server-2.0.45/debian/patches/series 2022-08-24 15:05:09.000000000 -0400 @@ -1 +1,2 @@ 0001-link-with-libatomic-for-test.patch +0002-siri-db-add-NULL-check-before-calling-siridb_tasks_d.patch