[Forensics-changes] [yara] 05/06: Fix FTBFS due to failing tests on kFreeBSD

Hilko Bengen bengen at moszumanska.debian.org
Sun Nov 13 00:39:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch master
in repository yara.

commit 53a18d91d911610324175cd1c7f69db24985bf40
Author: Hilko Bengen <bengen at debian.org>
Date:   Sat Nov 5 12:27:18 2016 +0100

    Fix FTBFS due to failing tests on kFreeBSD
---
 ...andler-Unix-Install-a-handler-for-SIGSEGV.patch | 51 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 52 insertions(+)

diff --git a/debian/patches/0003-Exception-handler-Unix-Install-a-handler-for-SIGSEGV.patch b/debian/patches/0003-Exception-handler-Unix-Install-a-handler-for-SIGSEGV.patch
new file mode 100644
index 0000000..ea7708a
--- /dev/null
+++ b/debian/patches/0003-Exception-handler-Unix-Install-a-handler-for-SIGSEGV.patch
@@ -0,0 +1,51 @@
+From: Hilko Bengen <bengen at debian.org>
+Date: Sat, 5 Nov 2016 12:26:35 +0100
+Subject: Exception handler (Unix): Install a handler for SIGSEGV
+
+test-exception now passes on FreeBSD11/amd64, OpenBSD6/amd64.
+
+(cherry picked from upstream commit 35f01653ab162d4302faebcfa36b349b4141344a)
+---
+ libyara/exception.h | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/libyara/exception.h b/libyara/exception.h
+index c70ae63..a9698b3 100644
+--- a/libyara/exception.h
++++ b/libyara/exception.h
+@@ -81,7 +81,7 @@ static LONG CALLBACK exception_handler(
+ sigjmp_buf *exc_jmp_buf[MAX_THREADS];
+ 
+ static void exception_handler(int sig) {
+-  if (sig == SIGBUS)
++  if (sig == SIGBUS || sig == SIGSEGV)
+   {
+     int tidx = yr_get_tidx();
+ 
+@@ -97,12 +97,14 @@ typedef struct sigaction sa;
+ #define YR_TRYCATCH(_try_clause_, _catch_clause_)               \
+   do                                                            \
+   {                                                             \
+-    struct sigaction oldact;                                    \
++    struct sigaction old_sigbus_act;                            \
++    struct sigaction old_sigsegv_act;                           \
+     struct sigaction act;                                       \
+     act.sa_handler = exception_handler;                         \
+     act.sa_flags = 0; /* SA_ONSTACK? */                         \
+     sigfillset(&act.sa_mask);                                   \
+-    sigaction(SIGBUS, &act, &oldact);                           \
++    sigaction(SIGBUS, &act, &old_sigbus_act);                   \
++    sigaction(SIGSEGV, &act, &old_sigsegv_act);                 \
+     int tidx = yr_get_tidx();                                   \
+     assert(tidx != -1);                                         \
+     sigjmp_buf jb;                                              \
+@@ -112,7 +114,8 @@ typedef struct sigaction sa;
+     else                                                        \
+       { _catch_clause_ }                                        \
+     exc_jmp_buf[tidx] = NULL;                                   \
+-    sigaction(SIGBUS, &oldact, NULL);                           \
++    sigaction(SIGBUS, &old_sigbus_act, NULL);                   \
++    sigaction(SIGSEGV, &old_sigsegv_act, NULL);                 \
+   } while (0)
+ 
+ #endif
diff --git a/debian/patches/series b/debian/patches/series
index cfae7c6..89f7aff 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 0001-Fixes-for-big-endian-architectures.patch
 0002-Don-t-unmask-signals-when-setting-up-exception-handl.patch
+0003-Exception-handler-Unix-Install-a-handler-for-SIGSEGV.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list