[erlang-bugs] SIGBUS on init:restart()

Filipe David Manana <>
Mon Aug 15 00:18:19 CEST 2011

If I compile OTP R14B03 (also tried R14B01, and got same issue) for
64bits mode in Mac OS X Lion, when calling init:restart() in my
application I get a SIGBUS signal, which causes the VM to terminate
(it happens very often, but not always) with the error message "Bus
error: 10".

Here's some information from gdb which might be useful:


Ignoring the SIGBUS signal prevents the crash, but this is likely
masking some bug:

diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c
index bafbbb0..86c3f57 100644
--- a/erts/emulator/sys/unix/sys.c
+++ b/erts/emulator/sys/unix/sys.c
@@ -3031,6 +3031,9 @@ erts_sys_main_thread(void)
        fd_set readfds;
        int res;

+    signal(SIGPIPE, SIG_IGN);
+    signal(SIGBUS, SIG_IGN);
        FD_SET(erts_darwin_main_thread_pipe[0], &readfds);
        res = select(erts_darwin_main_thread_pipe[0] + 1, &readfds,

OTP was configured like this:

$ CFLAGS="-O0" ./configure --enable-darwin-64bit --prefix=/opt/r14b03

Without the --enable-darwin-64bit option, the issue doesn't happen.

Is this a known issue or can it be application-specific? How to debug
it further?

This issue doesn't seem to happen on Linux and Mac OS X snowleopard systems.


Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

More information about the erlang-bugs mailing list