summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Mozes <hydrapolic@gmail.com>2019-09-20 13:10:20 +0000
committerJoonas Niilola <juippis@gentoo.org>2019-09-20 18:42:39 +0300
commit1096ec7003531d803fc88fe60abc4f6e6368dffa (patch)
tree800a694a3cd7ee154a86d11c8f07cb4a65f38867 /app-admin/syslog-ng
parentnet-misc/networkmanager-wireguard: pkgmove to net-vpn (diff)
downloadgentoo-1096ec7003531d803fc88fe60abc4f6e6368dffa.tar.gz
gentoo-1096ec7003531d803fc88fe60abc4f6e6368dffa.tar.bz2
gentoo-1096ec7003531d803fc88fe60abc4f6e6368dffa.zip
app-admin/syslog-ng: fix daemon crashes on x86
Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com> Closes: https://bugs.gentoo.org/695176 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'app-admin/syslog-ng')
-rw-r--r--app-admin/syslog-ng/files/patches/syslog-ng-3.23.1-fix-sigabrt.patch72
-rw-r--r--app-admin/syslog-ng/syslog-ng-3.23.1-r1.ebuild (renamed from app-admin/syslog-ng/syslog-ng-3.23.1.ebuild)3
2 files changed, 75 insertions, 0 deletions
diff --git a/app-admin/syslog-ng/files/patches/syslog-ng-3.23.1-fix-sigabrt.patch b/app-admin/syslog-ng/files/patches/syslog-ng-3.23.1-fix-sigabrt.patch
new file mode 100644
index 000000000000..6d27e88abf71
--- /dev/null
+++ b/app-admin/syslog-ng/files/patches/syslog-ng-3.23.1-fix-sigabrt.patch
@@ -0,0 +1,72 @@
+diff --git a/lib/logsource.c b/lib/logsource.c
+index 3f38b66e8b..83c61a8e93 100644
+--- a/lib/logsource.c
++++ b/lib/logsource.c
+@@ -633,7 +633,20 @@ log_source_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_options
+ evt_tag_printf("msg", "%p", msg));
+
+ msg_set_context(NULL);
++}
++
++static void
++_initialize_window(LogSource *self, gint init_window_size)
++{
++ self->window_initialized = TRUE;
++ window_size_counter_set(&self->window_size, init_window_size);
++ self->full_window_size = init_window_size;
++}
+
++static gboolean
++_is_window_initialized(LogSource *self)
++{
++ return self->window_initialized;
+ }
+
+ void
+@@ -645,11 +658,9 @@ log_source_set_options(LogSource *self, LogSourceOptions *options,
+ * configuration and we received a SIGHUP. This means that opened
+ * connections will not have their window_size changed. */
+
+- if ((gint)window_size_counter_get(&self->window_size, NULL) == -1)
+- {
+- window_size_counter_set(&self->window_size, options->init_window_size);
+- self->full_window_size = options->init_window_size;
+- }
++ if (!_is_window_initialized(self))
++ _initialize_window(self, options->init_window_size);
++
+ self->options = options;
+ if (self->stats_id)
+ g_free(self->stats_id);
+@@ -679,7 +690,7 @@ log_source_init_instance(LogSource *self, GlobalConfig *cfg)
+ self->super.free_fn = log_source_free;
+ self->super.init = log_source_init;
+ self->super.deinit = log_source_deinit;
+- window_size_counter_set(&self->window_size, (gsize)-1);
++ self->window_initialized = FALSE;
+ self->ack_tracker = NULL;
+ }
+
+@@ -696,7 +707,9 @@ log_source_free(LogPipe *s)
+
+ ack_tracker_free(self->ack_tracker);
+ self->ack_tracker = NULL;
+- _release_dynamic_window(self);
++
++ if (G_UNLIKELY(dynamic_window_is_enabled(&self->dynamic_window)))
++ _release_dynamic_window(self);
+ }
+
+ void
+diff --git a/lib/logsource.h b/lib/logsource.h
+index 370842efc2..75d4926046 100644
+--- a/lib/logsource.h
++++ b/lib/logsource.h
+@@ -71,6 +71,7 @@ struct _LogSource
+ gchar *stats_instance;
+ WindowSizeCounter window_size;
+ DynamicWindow dynamic_window;
++ gboolean window_initialized;
+ /* full_window_size = static + dynamic */
+ gsize full_window_size;
+ atomic_gssize window_size_to_be_reclaimed;
diff --git a/app-admin/syslog-ng/syslog-ng-3.23.1.ebuild b/app-admin/syslog-ng/syslog-ng-3.23.1-r1.ebuild
index 3cb8ad6b096a..bc13ee0fdc78 100644
--- a/app-admin/syslog-ng/syslog-ng-3.23.1.ebuild
+++ b/app-admin/syslog-ng/syslog-ng-3.23.1-r1.ebuild
@@ -51,6 +51,9 @@ DOCS=( AUTHORS NEWS.md CONTRIBUTING.md contrib/syslog-ng.conf.{HP-UX,RedHat,SunO
contrib/syslog2ng "${T}/syslog-ng.conf.gentoo.hardened"
"${T}/syslog-ng.logrotate.hardened" "${FILESDIR}/README.hardened" )
+# bug #695176
+PATCHES=( "${FILESDIR}/patches/${PN}-3.23.1-fix-sigabrt.patch" )
+
pkg_setup() {
use python && python-single-r1_pkg_setup
}