On Wed, 15 Jun 2011, Piotr Sikora wrote:
> Hi,
>
> >Regress tests fails with bus error on sparc64, but i don't know if it's
> >a failure from erlang or rabbitmq. I'll retest 2.4.1, and if it was
> >already failing on sparc64 i'll commit your update, but this should be
> >looked in.
>
> We looked into this with viq a while ago and it turned out that it
> was "erl_call" (part of Erlang) that SIGBUSes very early on:
> ---
> #0 0x0000000000108924 in ei_gethostbyname_r ()
> #1 0x0000000000107e6c in ei_connect_tmo ()
> #2 0x0000000000104074 in main ()
> ---
>
> If anyone with access to sparc64 (and possibly some Erlang
> knowledge) could look further into this, that would be great.
Hi all,
This fixes erlang on LP64 (and unbreak it on sparc64): typical
misaligned memory access...
Works for me with net/rabbitmq regression tests.
OK?
ciao,
David
Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/erlang/Makefile,v
retrieving revision 1.42
diff -u -p -r1.42 Makefile
--- Makefile 25 Jun 2011 07:48:43 -0000 1.42
+++ Makefile 29 Jun 2011 08:49:06 -0000
@@ -5,7 +5,7 @@ COMMENT= real-time, concurrent and distr
V= R13B04
DISTNAME= otp_src_${V}
PKGNAME= erlang-13b.04
-REVISION= 2
+REVISION= 3
CATEGORIES= lang
# Erlang Public License
Index: patches/patch-lib_erl_interface_src_connect_ei_resolve_c
===================================================================
RCS file: patches/patch-lib_erl_interface_src_connect_ei_resolve_c
diff -N patches/patch-lib_erl_interface_src_connect_ei_resolve_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_erl_interface_src_connect_ei_resolve_c 29 Jun 2011
08:49:06 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+--- lib/erl_interface/src/connect/ei_resolve.c.orig Wed Jun 29 09:20:55 2011
++++ lib/erl_interface/src/connect/ei_resolve.c Wed Jun 29 09:22:13 2011
+@@ -185,7 +185,12 @@ static int verify_dns_configuration(void)
+ * align: increment buf until it is dword-aligned, reduce len by same amount.
+ * advance: increment buf by n bytes, reduce len by same amount .
+ */
+-#define align_buf(buf,len) for (;(((unsigned)buf)&0x3); (buf)++, len--)
++#if defined(__LP64__)
++ #define ALIGNBYTES (sizeof(double) - 1)
++#else
++ #define ALIGNBYTES (sizeof(int) - 1)
++#endif
++#define align_buf(buf,len) for (;(((unsigned)buf)&ALIGNBYTES); (buf)++, len--)
+ #define advance_buf(buf,len,n) ((buf)+=(n),(len)-=(n))
+
+ /* "and now the tricky part..." */