On Thu, Dec 13, 2001 at 04:56:34PM +1300, Geoff Thorpe wrote:
> Thanks again, and please let me know if you observe any other problems. 
> FWIW: I'm currently looking to those SIGBUS problems.

Anyone seeing SIGBUS's with shmcb might want to try this patch: we found
some versions of gcc on some platforms could do dangerous optimisations.
Geoff helped out with this patch too - thanks Geoff.

--- pkg.sslmod/ssl_scache_shmcb.c.orig  Fri Mar 30 11:00:34 2001
+++ pkg.sslmod/ssl_scache_shmcb.c       Tue Jul 10 13:37:10 2001
@@ -354,6 +354,14 @@
     return ret;
 }
 
+/* This is necessary simply so that the size passed to memset() is not
+ * a compile-time constant, preventing the compiler from optimising
+ * it. */
+static void shmcb_safe_clear(void *ptr, size_t size)
+{
+    memset(ptr, 0, size);
+}
+
 static void shmcb_set_safe_time(time_t * ptr, time_t val)
 {
     unsigned char *to, *from;
@@ -1174,7 +1182,7 @@
                 "internal error");
         return FALSE;
     }
-    memset(idx, 0, sizeof(SHMCBIndex));
+    shmcb_safe_clear(idx, sizeof(SHMCBIndex));
     shmcb_set_safe_time(&(idx->expires), expiry_time);
     shmcb_set_safe_uint(&(idx->offset), new_offset);
 
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]

Reply via email to