[SCM] lame/master: debian/patches/force_align_arg_pointer.patch: Enable functions with SSE instructions to maintain their own properly aligned stack. Fixes crashes with a general protection error when called from the ocaml bindings (Closes: #786438). Thanks Detrick Merz for the bug report, Robert Hegemann and especially Bernhard Ãœbelacker with analyzing the bug.

fabian at users.alioth.debian.org fabian at users.alioth.debian.org
Thu Jun 11 07:40:11 UTC 2015


The following commit has been merged in the master branch:
commit 6da2a12bda23856ef2fa56c6fef0bc1bd1e5052b
Author: Fabian Greffrath <fabian at debian.org>
Date:   Thu Jun 11 08:57:08 2015 +0200

    debian/patches/force_align_arg_pointer.patch: Enable functions with SSE instructions to maintain their own properly aligned stack. Fixes crashes with a general protection error when called from the ocaml bindings (Closes: #786438). Thanks Detrick Merz for the bug report, Robert Hegemann and especially Bernhard Übelacker with analyzing the bug.

diff --git a/debian/patches/force_align_arg_pointer.patch b/debian/patches/force_align_arg_pointer.patch
new file mode 100644
index 0000000..e90293a
--- /dev/null
+++ b/debian/patches/force_align_arg_pointer.patch
@@ -0,0 +1,52 @@
+Author: Fabian Greffrath <fabian at debian.org>
+Subject: Enable functions with SSE instructions to maintain their own properly aligned stack
+ Operands in SSE instructions must be aligned on 16-byte boundaries. In the
+ init_xrpow_core_sse() function these operands are variables on the stack.
+ However, when the code is called from the ocaml bindings, the stack is
+ allocated by ocaml which does not adhere to the 16-byte boundary rule and thus
+ causes the code to crash with a general protection error.
+ What is needed is a means enable functions calling SSE instructions to
+ maintain their own properly aligned stack. The "force_align_arg_pointer"
+ attribute does exactly this, see
+ <https://gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html>.
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786438
+Forwarded: https://sourceforge.net/p/lame/bugs/449/
+Last-Update: 2015-06-10
+
+--- a/libmp3lame/vector/xmm_quantize_sub.c
++++ b/libmp3lame/vector/xmm_quantize_sub.c
+@@ -51,8 +51,14 @@ static const FLOAT costab[TRI_SIZE * 2]
+ };
+ 
+ 
++/* make sure functions with SSE instructions maintain their own properly aligned stack */
++#if defined (__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)))
++#define SSE_FUNCTION __attribute__((force_align_arg_pointer))
++#else
++#define SSE_FUNCTION
++#endif
+ 
+-void
++SSE_FUNCTION void
+ init_xrpow_core_sse(gr_info * const cod_info, FLOAT xrpow[576], int upper, FLOAT * sum)
+ {
+     int     i;
+@@ -113,7 +119,8 @@ init_xrpow_core_sse(gr_info * const cod_
+ }
+ 
+ 
+-static void store4(__m128 v, float* f0, float* f1, float* f2, float* f3)
++SSE_FUNCTION static void
++store4(__m128 v, float* f0, float* f1, float* f2, float* f3)
+ {
+     vecfloat_union r;
+     r._m128 = v;
+@@ -124,7 +131,7 @@ static void store4(__m128 v, float* f0,
+ }
+ 
+ 
+-void
++SSE_FUNCTION void
+ fht_SSE2(FLOAT * fz, int n)
+ {
+     const FLOAT *tri = costab;
diff --git a/debian/patches/series b/debian/patches/series
index 3dae2e2..6fc5e03 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,6 +3,7 @@ parallel-builds-fix.patch
 ansi2knr2devnull.patch
 privacy-breach.patch
 msse.patch
+force_align_arg_pointer.patch
 0001-Add-check-for-invalid-input-sample-rate.patch
 bits_per_sample.patch
 int_resample_ratio.patch

-- 
lame packaging



More information about the pkg-multimedia-commits mailing list