summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2018-03-20 19:11:02 +0100
committerUlrich Müller <ulm@gentoo.org>2018-03-20 19:11:02 +0100
commit0541f0c50f49fa434c8888b1bbe8f95c1866b520 (patch)
tree1ea8455a1974394f77398e70c73d3edb786a9e58
parentRemove 25.2 patchset. (diff)
downloademacs-patches-0541f0c50f49fa434c8888b1bbe8f95c1866b520.tar.gz
emacs-patches-0541f0c50f49fa434c8888b1bbe8f95c1866b520.tar.bz2
emacs-patches-0541f0c50f49fa434c8888b1bbe8f95c1866b520.zip
Fix segmentation fault on sparc, bug 647238.emacs-25.3-patches-1
-rw-r--r--emacs/25.3/01_all_gc-align-sparc.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/emacs/25.3/01_all_gc-align-sparc.patch b/emacs/25.3/01_all_gc-align-sparc.patch
new file mode 100644
index 0000000..b76cf99
--- /dev/null
+++ b/emacs/25.3/01_all_gc-align-sparc.patch
@@ -0,0 +1,31 @@
+Fix segmentation fault on sparc64 with 32 bit userland.
+https://bugs.gentoo.org/647238
+
+Backported from upstream git:
+
+commit db64a866f6971c5d63565253c0c8d8db15d4a4dc
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Tue Mar 20 09:54:20 2018 -0700
+
+ Port to 32-bit sparc64
+
+ Problem reported by Ulrich Mueller; fix suggested by Eli Zaretskii
+ and Andreas Schwab (Bug#30855).
+ * src/alloc.c (mark_memory): Call mark_maybe_object only on
+ pointers that are properly aligned for Lisp_Object.
+
+--- emacs-25.3-orig/src/alloc.c
++++ emacs-25.3/src/alloc.c
+@@ -4892,7 +4892,11 @@
+ for (pp = start; (void *) pp < end; pp += GC_POINTER_ALIGNMENT)
+ {
+ mark_maybe_pointer (*(void **) pp);
+- mark_maybe_object (*(Lisp_Object *) pp);
++
++ verify (alignof (Lisp_Object) % GC_POINTER_ALIGNMENT == 0);
++ if (alignof (Lisp_Object) == GC_POINTER_ALIGNMENT
++ || (uintptr_t) pp % alignof (Lisp_Object) == 0)
++ mark_maybe_object (*(Lisp_Object *) pp);
+ }
+ }
+