Solved: [Exim] 4.20 on OpenBSD 3.3, sparc64, dies.

Top Page
Delete this message
Reply to this message
Author: Vadim Vygonets
Date:  
To: Philip Hazel, exim-users
Subject: Solved: [Exim] 4.20 on OpenBSD 3.3, sparc64, dies.
Quoth Vadim Vygonets on Mon, Aug 11, 2003:
> Thanks for your help, I'll try to debug it and will post more
> information when I have it.


It's indeed the loop in os_common_find_running_interfaces(). In
this loop, cp is sometimes incremented by multiples of 4 which
are not multiples of 8, and Exim crashes on "ifreq = *ifr;".
Here's the patch (against 4.20):

=================================================================
--- os.c.original    Mon May 12 16:39:20 2003
+++ os.c    Mon Aug 11 21:09:25 2003
@@ -538,6 +538,9 @@
 #define FAMILY          AF_INET
 #endif


+#define alignment \
+ ((sizeof(void *) > sizeof(double))? sizeof(void *) : sizeof(double))
+
/* OK, after all that preliminary stuff, here's the code. */

 ip_address_item *
@@ -616,6 +619,8 @@
     sizeof(*ifr))
     #endif
   {
+  if (((unsigned long)cp % alignment) != 0)
+    cp += alignment - ((unsigned long)cp % alignment);
   ifr = (struct V_ifreq *)cp;


/* If not an IP interface, skip */
=================================================================

Thanks,
Vadik.

--
Smile! The Illuminati are watching.