[source] gdb: fix invalid sigprocmask call
LEDE Commits
lede-commits at lists.infradead.org
Thu Mar 23 20:10:54 PDT 2017
yousong pushed a commit to source.git, branch master:
https://git.lede-project.org/46e390322a58bdc632ee43fdf9d14115dac26e7a
commit 46e390322a58bdc632ee43fdf9d14115dac26e7a
Author: Yousong Zhou <yszhou4tech at gmail.com>
AuthorDate: Fri Mar 24 10:37:08 2017 +0800
gdb: fix invalid sigprocmask call
Fixes FS#637
Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
package/devel/gdb/Makefile | 2 +-
.../gdb/patches/120-sigprocmask-invalid-call.patch | 43 ++++++++++++++++++++++
2 files changed, 44 insertions(+), 1 deletion(-)
diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile
index 159a635..84e7926 100644
--- a/package/devel/gdb/Makefile
+++ b/package/devel/gdb/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gdb
PKG_VERSION:=7.12.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/gdb
diff --git a/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch b/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch
new file mode 100644
index 0000000..7090db1
--- /dev/null
+++ b/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch
@@ -0,0 +1,43 @@
+From 56893a61aa4f0270fa8d1197b9848247f90fce0d Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech at gmail.com>
+Date: Fri, 24 Mar 2017 10:36:03 +0800
+Subject: [PATCH] Fix invalid sigprocmask call
+
+The POSIX document says
+
+ The pthread_sigmask() and sigprocmask() functions shall fail if:
+
+ [EINVAL]
+ The value of the how argument is not equal to one of the defined values.
+
+and this is how musl-libc is currently doing. Fix the call to be safe
+and correct
+
+ [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html
+
+gdb/ChangeLog:
+2017-03-24 Yousong Zhou <yszhou4tech at gmail.com>
+
+ * common/signals-state-save-restore.c (save_original_signals_state):
+ Fix invalid sigprocmask call.
+---
+ gdb/ChangeLog | 5 +++++
+ gdb/common/signals-state-save-restore.c | 2 +-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/gdb/common/signals-state-save-restore.c b/gdb/common/signals-state-save-restore.c
+index d11a9ae..734335c 100644
+--- a/gdb/common/signals-state-save-restore.c
++++ b/gdb/common/signals-state-save-restore.c
+@@ -41,7 +41,7 @@ save_original_signals_state (void)
+ int i;
+ int res;
+
+- res = sigprocmask (0, NULL, &original_signal_mask);
++ res = sigprocmask (SIG_BLOCK, NULL, &original_signal_mask);
+ if (res == -1)
+ perror_with_name (("sigprocmask"));
+
+--
+2.6.4
+
More information about the lede-commits
mailing list