[erlang-bugs] Bus Error on Mac OS X 10.5.3 (R12B-2+hipe)

Geoff Cant nem@REDACTED
Thu May 29 04:10:00 CEST 2008

Hi all, I just upgraded to mac os x 10.5.3 and all of a sudden all
invocations of beam end immediately with a bus error.

An example crash report is:
Process:         beam.smp [1134]
Path:            /Library/DarwinPorts/lib/erlang/erts-5.6.2/bin/beam.smp
Identifier:      beam.smp
Version:         ??? (???)
Code Type:       X86 (Native)
Parent Process:  bash [382]

Date/Time:       2008-05-29 11:55:25.772 +1200
OS Version:      Mac OS X 10.5.3 (9D34)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000092665000
Crashed Thread:  0

Thread 0 Crashed:
0   beam.smp                      	0x0011a8a6 atomic_mov64 + 22
1   beam.smp                      	0x0011ae26 mach_override_ptr + 566
2   beam.smp                      	0x0011a0d4 hipe_signal_init + 164
3   beam.smp                      	0x000180d3 early_init + 617
4   beam.smp                      	0x000181c0 erl_start + 68
5   beam.smp                      	0x00001838 main + 24
6   beam.smp                      	0x000017e6 start + 54

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0x56e58955  ebx: 0x99a001e9  ecx: 0x20ec836c  edx: 0x20ec8353
  edi: 0x00000000  esi: 0x92664ffa  ebp: 0xbfffec08  esp: 0xbfffebf4
   ss: 0x0000001f  efl: 0x00010293  eip: 0x0011a8a6   cs: 0x00000017
   ds: 0x0000001f   es: 0x0000001f   fs: 0x00000000   gs: 0x00000037
  cr2: 0x92665000

Binary Images:
    0x1000 -   0x14fff3 +beam.smp ??? (???) <31d88f4f6a8c9c57e4c9e0ade2481620> /Library/DarwinPorts/lib/erlang/erts-5.6.2/bin/beam.smp
  0x1f7000 -   0x1f9fff  libutil.dylib ??? (???) <5ac8a5517aae408d0fdb6da13a2faf89> /usr/lib/libutil.dylib
  0x1fe000 -   0x229ff7 +libncurses.5.dylib ??? (???) /Library/DarwinPorts/lib/libncurses.5.dylib
0x8fe00000 - 0x8fe2da53  dyld 96.2 (???) <7af47d3b00b2268947563c7fa8c59a07> /usr/lib/dyld
0x90520000 - 0x90524fff  libmathCommon.A.dylib ??? (???) /usr/lib/system/libmathCommon.A.dylib
0x91170000 - 0x91177fe9  libgcc_s.1.dylib ??? (???) <a9ab135a5f81f6e345527df87f51bfc9> /usr/lib/libgcc_s.1.dylib
0x92625000 - 0x92785ff3  libSystem.B.dylib ??? (???) <a12f397abf2285077b89bd726bff5b18> /usr/lib/libSystem.B.dylib
0xffff0000 - 0xffff1780  libSystem.B.dylib ??? (???)

As near as I can make out, this means that hipe_signal_init is trying to
patch sigaction but mach_override_ptr is failing. Maybe this is some new
page protection or something in macos?

Rebuilding erlang r12b2 without hipe appears to avoid the problem.

Also, gcc is complaining that we should be using
dlopen/dlsym/dl... instead of NSCreateObjectFileImageFromFile and
friends. Perhaps the macos specific calls to the Mach-O loader functions
are no longer necessary.

Geoff Cant

More information about the erlang-bugs mailing list