Bug#544905: libsigsegv: FTBFS on amd64: Test failure

Sebastian Andrzej Siewior sebastian at breakpoint.cc
Sun Oct 18 19:23:31 UTC 2009


reassign 544905 package linux-2.6
thanks

* Daniel Schepler | 2009-09-03 10:43:04 [-0700]:

>Package: libsigsegv
>Version: 2.5-3
>Severity: serious
>
>From my pbuilder build log (on amd64):
>
>...
># Make sure libsigsegv works
>Starting recursion pass 1.
>Stack overflow 1 caught.
>Starting recursion pass 2.
>Stack overflow 2 caught.
>Test passed.
>PASS: stackoverflow1
>/bin/sh: line 5:  4730 Segmentation fault      ${dir}$tst
>FAIL: stackoverflow2

This is actually an ancient Linux kernel bug. I've omitted the kernel
version so the Debian kernel team can decide in which kernels they push
it in in case they accept my patch :)

Sebastian
-------------- next part --------------
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 35e3bd9..520c489 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -70,6 +70,9 @@ config GENERIC_BUG
 	def_bool y
 	depends on BUG
 
+config STACK_STORE_POST
+	def_bool y
+
 source "init/Kconfig"
 
 source "kernel/Kconfig.freezer"
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 75e6e60..23e6eb6 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2086,11 +2086,31 @@ static inline int is_si_special(const struct siginfo *info)
 	return info <= SEND_SIG_FORCED;
 }
 
-/* True if we are on the alternate signal stack.  */
-
+/*
+ * True if we are on the alternate signal stack, based on the follwoing
+ * example: The alternative stack handler starts at 0x10 and its size is 0x20
+ * bytes. The numbers behind PRE and POST are aimed as the result.
+ * PRE means the stack is first decremented and than the content of the variale
+ * is stored. This means, the stack pointer points in the PRE case to the last
+ * variable on the stack. In the POST case it points to the first free slot.
+ *
+ *         0   5       10    15   30     40   80
+ *         +-----------+-----------+----------+
+ *         |           | SIG STACK |          |
+ *         +-----------+-----------+----------+
+ * POST        0       1     1     0     0
+ * PRE         0       0     1     1     0
+ */
 static inline int on_sig_stack(unsigned long sp)
 {
+#if defined(CONFIG_STACK_STORE_POST)
 	return (sp - current->sas_ss_sp < current->sas_ss_size);
+
+#else
+	if (!(sp - current->sas_ss_sp))
+		return 0;
+	return (sp - current->sas_ss_sp <= current->sas_ss_size);
+#endif
 }
 
 static inline int sas_ss_flags(unsigned long sp)
-- 
1.6.4.GIT

  


More information about the pkg-common-lisp-devel mailing list