mailer | 27 Jan 08:59
Favicon

Fix FS#12559: sigaltstack threads fortify failure

commit f4954c4a9bda0edbdc8e93314b713c036c4ebfdd
Author: Boris Gjenero <boris.gjenero <at> gmail.com>
Date:   Thu Jan 26 20:33:28 2012 -0500

    Fix FS#12559: sigaltstack threads fortify failure

    Ubuntu defines _FORTIFY_SOURCE=2, which causes glibc longjmp() to check sp
    when gcc optimization is enabled. The check does not allow longjmp() to be
    used for switching threads and results in a "longjmp causes uninitialized
    stack frame" error. This disables the check.

    Change-Id: Idb8877b43ce711df880ca88875ba5477445a577a

diff --git a/firmware/thread.c b/firmware/thread.c
index 5e543c5..4c15fcc 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -19,6 +19,15 @@
  *
  ****************************************************************************/
 #include "config.h"
+
+#ifdef HAVE_SIGALTSTACK_THREADS
+/*
+ * The sp check in glibc __longjmp_chk() will cause
+ * a fatal error when switching threads via longjmp().
+ */
+#undef _FORTIFY_SOURCE
+#endif
+
 #include <stdbool.h>
 #include <stdio.h>
 #include "thread.h"
_______________________________________________
rockbox-cvs mailing list
rockbox-cvs <at> cool.haxx.se
http://cool.haxx.se/cgi-bin/mailman/listinfo/rockbox-cvs


Gmane