On Fri, Feb 08, 2002 at 09:23:20PM +0100, Ralf S. Engelschall wrote:
>
> In article <[EMAIL PROTECTED]> you wrote:
>
> > I installed apache-1.3.22-1.0.0.src.rpm and apache-1.3.23-20020201.src.rpm
> > on a Solaris 8 Box (compiled on the machine with
> > openssl-0.9.6b-1.0.0.src.rpm and mm-1.1.3-1.0.0.src.rpm as well).
> > Now I get curious errors from dying apache processes in the error.log file:
> > [Fri Feb 8 13:21:05 2002] [notice] child pid 28802 exit signal Bus Error
> > (10)
> > The client does not get the request from such an instance and displays a
> > message about an empty document.
> >
> > Normally you get this errors from misalignment or hardware problems. No
> > other process on the system shows any problems, which makes hardware
> > failures relatively unlikely.
> >
> > Does anyone notice the same problem and found a solution?
>
> A few hints:
>
> 1. I've fixed session cache related problems in mod_ssl 2.8.6 which
> is used with Apache 1.3.23. So definetely try only this version.
Actually 2.8.6 does not contain all the shmcb SIGBUS fixes we have (from
the patch Geoff submitted to you, AFAIK). If I re-diff the patch I get
the following, though I haven't compiled or tested it:
--- ssl_scache_shmcb.c.orig Thu Jan 31 16:02:11 2002
+++ ssl_scache_shmcb.c Fri Feb 8 22:24:42 2002
@@ -262,13 +262,38 @@
memcpys can hardly make a dent on the massive memmove operations this
cache technique avoids, nor the overheads of ASN en/decoding. */
static unsigned int shmcb_get_safe_uint(unsigned int *);
-static void shmcb_set_safe_uint(unsigned int *, unsigned int);
+static void shmcb_set_safe_uint_ex(unsigned char *, const unsigned char *);
+#define shmcb_set_safe_uint(pdest, src) + do { + unsigned int tmp_uint
+= src; + shmcb_set_safe_uint_ex((unsigned char *)pdest, +
+ (const unsigned char *)(&tmp_uint)); + } while(0)
#if 0 /* Unused so far */
static unsigned long shmcb_get_safe_ulong(unsigned long *);
-static void shmcb_set_safe_ulong(unsigned long *, unsigned long);
+static void shmcb_set_safe_ulong_ex(unsigned char *, const unsigned char *);
+#define shmcb_set_safe_ulong(pdest, src) + do { + unsigned long
+tmp_ulong = src; + shmcb_set_safe_ulong_ex((unsigned char *)pdest, +
+ (const unsigned char *)(&tmp_ulong)); + } while(0)
#endif
static time_t shmcb_get_safe_time(time_t *);
-static void shmcb_set_safe_time(time_t *, time_t);
+static void shmcb_set_safe_time_ex(unsigned char *, const unsigned char *);
+#define shmcb_set_safe_time(pdest, src) + do { + time_t tmp_time = src;
++ shmcb_set_safe_time_ex((unsigned char *)pdest, +
+ (const unsigned char *)(&tmp_time)); + } while(0)
+
+/* 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);
+}
/* Underlying functions for session-caching */
static BOOL shmcb_init_memory(server_rec *, void *, unsigned int);
@@ -306,61 +331,46 @@
static unsigned int shmcb_get_safe_uint(unsigned int *ptr)
{
- unsigned char *from;
unsigned int ret;
-
- from = (unsigned char *)ptr;
- memcpy(&ret, from, sizeof(unsigned int));
+ shmcb_set_safe_uint_ex((unsigned char *)(&ret),
+ (const unsigned char *)ptr);
return ret;
}
-static void shmcb_set_safe_uint(unsigned int *ptr, unsigned int val)
+static void shmcb_set_safe_uint_ex(unsigned char *dest,
+ const unsigned char *src)
{
- unsigned char *to, *from;
-
- to = (unsigned char *)ptr;
- from = (unsigned char *)(&val);
- memcpy(to, from, sizeof(unsigned int));
+ memcpy(dest, src, sizeof(unsigned int));
}
#if 0 /* Unused so far */
static unsigned long shmcb_get_safe_ulong(unsigned long *ptr)
{
- unsigned char *from;
unsigned long ret;
-
- from = (unsigned char *)ptr;
- memcpy(&ret, from, sizeof(unsigned long));
+ shmcb_set_safe_ulong_ex((unsigned char *)(&ret),
+ (const unsigned char *)ptr);
return ret;
}
-static void shmcb_set_safe_ulong(unsigned long *ptr, unsigned long val)
+static void shmcb_set_safe_ulong_ex(unsigned char *dest,
+ const unsigned char *src)
{
- unsigned char *to, *from;
-
- to = (unsigned char *)ptr;
- from = (unsigned char *)(&val);
- memcpy(to, from, sizeof(unsigned long));
+ memcpy(dest, src, sizeof(unsigned long));
}
#endif
static time_t shmcb_get_safe_time(time_t * ptr)
{
- unsigned char *from;
time_t ret;
-
- from = (unsigned char *)ptr;
- memcpy(&ret, from, sizeof(time_t));
+ shmcb_set_safe_time_ex((unsigned char *)(&ret),
+ (const unsigned char *)ptr);
return ret;
}
-static void shmcb_set_safe_time(time_t * ptr, time_t val)
+static void shmcb_set_safe_time_ex(unsigned char *dest,
+ const unsigned char *src)
{
- unsigned char *to, *from;
-
- to = (unsigned char *)ptr;
- from = (unsigned char *)(&val);
- memcpy(to, from, sizeof(time_t));
+ memcpy(dest, src, sizeof(time_t));
}
/*
@@ -1176,7 +1186,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);
______________________________________________________________________
The OpenPKG Project www.openpkg.org
User Communication List [EMAIL PROTECTED]