Fix Linux crash
authorMatt Caswell <matt@openssl.org>
Fri, 9 Oct 2015 14:48:30 +0000 (15:48 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 20 Nov 2015 23:35:19 +0000 (23:35 +0000)
If config'd without -d (--debug), asynctest was crashing with:
*** longjmp causes uninitialized stack frame ***

This is because gcc will add certain checks for some functions
(including longjmp). The checks assume you can only longjmp down the
stack not up. However, if we are actually jumping to a different
fibre then it can appear as if we are going up the stack when we are
not really. This change disables the check.

Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/async/async.c

index 8fdff52d995e9b389d2169362b4eef454c1762ed..d08ac132b7f7ff73624f40c93f282e0afa5779cc 100644 (file)
  * ====================================================================
  */
 
+/*
+ * Without this we start getting longjmp crashes because it thinks we're jumping
+ * up the stack when in fact we are jumping to an entirely different stack. The
+ * cost of this is not having certain buffer overrun/underrun checks etc for
+ * this source file :-(
+ */
+#undef _FORTIFY_SOURCE
+
 #include <openssl/err.h>
 #include <openssl/async.h>
 #include <string.h>