public
Last active

Erlang OTP R14B, Mac OS X Lion 64bits and XCode 4.1

  • Download Gist
gistfile1.md
Markdown

Issue

On Mac OS X Lion (64bits at least), we get random "Bus error 10" (or "Segmentation fault: 11") crashes if init:restart/0 is called and the crypto application is loaded. Why? XCode 4.1 ships an OpenSSL version that deprecates many functions used by OTP's crypto NIF (lib/crypto/c_src/crypto.c).

Example:

$ erl
Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:8:8] [rq:8] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.8.4  (abort with ^G)
1> crypto:start(), init:restart().
ok
2> Bus error: 10
$ erl
Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:8:8] [rq:8] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.8.4  (abort with ^G)
1> crypto:start(), init:restart().
ok
2> Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:8:8] [rq:8] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.8.4  (abort with ^G)
1> crypto:start(), init:restart().
ok
2> Bus error: 10

While compiling OTP, you get the following warnings (many others are omitted) when compiling the crypto NIF:

crypto.c: In function ‘rand_bytes_1’:
crypto.c:839: warning: ‘RAND_pseudo_bytes’ is deprecated (declared at /usr/include/openssl/rand.h:105)
crypto.c: In function ‘strong_rand_bytes_nif’:
crypto.c:852: warning: ‘RAND_bytes’ is deprecated (declared at /usr/include/openssl/rand.h:104)
crypto.c: In function ‘rand_bytes_3’:
crypto.c:871: warning: ‘RAND_pseudo_bytes’ is deprecated (declared at /usr/include/openssl/rand.h:105)
crypto.c: In function ‘strong_rand_mpint_nif’:
crypto.c:899: warning: ‘BN_new’ is deprecated (declared at /usr/include/openssl/bn.h:417)
crypto.c:905: warning: ‘BN_rand’ is deprecated (declared at /usr/include/openssl/bn.h:411)
crypto.c:910: warning: ‘BN_num_bits’ is deprecated (declared at /usr/include/openssl/bn.h:415)
crypto.c:913: warning: ‘BN_bn2bin’ is deprecated (declared at /usr/include/openssl/bn.h:423)
crypto.c:916: warning: ‘BN_free’ is deprecated (declared at /usr/include/openssl/bn.h:468)

Solution

Get an older OpenSSL, for example: http://www.openssl.org/source/openssl-0.9.8r.tar.gz

Extract the tarball and build openssl like this:

$ ./Configure --prefix=/Users/fdmanana/my-openssl  darwin64-x86_64-cc
$ make
$ make test
$ make install

Build Erlang OTP like this:

$ CC=gcc-4.2 CXX=g++-4.2 ./configure --prefix=/opt/otp-dev --enable-darwin-64bit --with-ssl=/Users/fdmanana/my-openssl
$ make
$ make install

Debug

A gdb session revealed this:

Thread 13 (process 63219):
#0  0x00000000177d6a4e in ?? ()
Cannot access memory at address 0x177d6a4e
#1  0x00007fff8c8e798b in EVP_DigestInit_ex ()
#2  0x00007fff8c8b9e86 in ssleay_rand_bytes ()
#3  0x00007fff8c8ba58e in ssleay_rand_pseudo_bytes ()
#4  0x00000000175657de in rand_bytes_1 (env=0xb0810360, argc=1, argv=0x16d49bc0) at crypto.c:839
#5  0x00000000166bb88e in process_main () at beam/beam_emu.c:3321
#6  0x0000000016601ddd in sched_thread_func (vesdp=0x16d49bc0) at beam/erl_process.c:3789
#7  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#8  0x00007fff8b7078bf in _pthread_start ()
#9  0x00007fff8b70ab75 in thread_start ()

The following gdb session gave the clue:

$ gdb -p 63219
GNU gdb 6.3.50-20050815 (Apple version gdb-1705) (Fri Jul  1 10:50:06 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
/Users/fdmanana/git/hub/membase/couchdb-sv/63219: No such file or directory
Attaching to process 63219.
Reading symbols for shared libraries . done
Reading symbols for shared libraries ................................... done
Reading symbols for shared libraries + done
0x00007fff8ad2cdf2 in select$DARWIN_EXTSN ()
(gdb) break erl_drv_thread.c:753
Breakpoint 1 at 0x1668ecdd: file beam/erl_drv_thread.c, line 753.
(gdb) cont
Continuing.
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00000000177d6a4e
[Switching to process 63219 thread 0x1e03]
0x00000000177d6a4e in ?? ()
(gdb) t a a bt

Thread 17 (process 63219):
#0  0x00000000165fb656 in erts_atomic32_read_acqb (var=0x16d1f910) at erl_threads.h:1354
#1  0x00000000165fb650 in erts_smp_atomic32_read_acqb (var=0x16d1f910) at erl_smp.h:1019
#2  0x00000000165fb608 in sched_spin_wait (ssi=0x16d1f900, spincount=10000) at beam/erl_process.c:967
#3  0x00000000165fb912 in scheduler_wait (fcalls=0xb1023fb8, esdp=0x16d81ec0, rq=0x16d1f000) at beam/erl_process.c:1067
#4  0x0000000016604bbb in schedule (p=0x17159a30, calls=121) at beam/erl_process.c:5428
#5  0x00000000166ad861 in process_main () at beam/beam_emu.c:1225
#6  0x0000000016601ddd in sched_thread_func (vesdp=0x16d81ec0) at beam/erl_process.c:3789
#7  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#8  0x00007fff8b7078bf in _pthread_start ()
#9  0x00007fff8b70ab75 in thread_start ()

Thread 16 (process 63219):
#0  0x00000000165fb68e in ethr_native_atomic32_read_acqb (var=0x16d1f8d0) at atomic.h:223
#1  0x00000000165fb67e in ethr_atomic32_read_acqb (var=0x16d1f8d0) at ethr_atomics.h:639
#2  0x00000000165fb667 in erts_atomic32_read_acqb (var=0x16d1f8d0) at erl_threads.h:1356
#3  0x00000000165fb650 in erts_smp_atomic32_read_acqb (var=0x16d1f8d0) at erl_smp.h:1019
#4  0x00000000165fb608 in sched_spin_wait (ssi=0x16d1f8c0, spincount=10000) at beam/erl_process.c:967
#5  0x00000000165fb912 in scheduler_wait (fcalls=0xb0e1efb8, esdp=0x16d73e00, rq=0x16d1ee00) at beam/erl_process.c:1067
#6  0x0000000016604bbb in schedule (p=0x17643558, calls=27) at beam/erl_process.c:5428
#7  0x00000000166ad861 in process_main () at beam/beam_emu.c:1225
#8  0x0000000016601ddd in sched_thread_func (vesdp=0x16d73e00) at beam/erl_process.c:3789
#9  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#10 0x00007fff8b7078bf in _pthread_start ()
#11 0x00007fff8b70ab75 in thread_start ()

Thread 15 (process 63219):
#0  0x00000000165fb61b in sched_spin_wait (ssi=0x16d1f880, spincount=10000) at beam/erl_process.c:973
#1  0x00000000165fb912 in scheduler_wait (fcalls=0xb0c19fb8, esdp=0x16d65d40, rq=0x16d1ec00) at beam/erl_process.c:1067
#2  0x0000000016604bbb in schedule (p=0x17155f68, calls=8) at beam/erl_process.c:5428
#3  0x00000000166ad861 in process_main () at beam/beam_emu.c:1225
#4  0x0000000016601ddd in sched_thread_func (vesdp=0x16d65d40) at beam/erl_process.c:3789
#5  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#6  0x00007fff8b7078bf in _pthread_start ()
#7  0x00007fff8b70ab75 in thread_start ()

Thread 14 (process 63219):
#0  0x00000000165fb61f in sched_spin_wait (ssi=0x16d1f840, spincount=10000) at beam/erl_process.c:973
#1  0x00000000165fb912 in scheduler_wait (fcalls=0xb0a14fb8, esdp=0x16d57c80, rq=0x16d1ea00) at beam/erl_process.c:1067
#2  0x0000000016604bbb in schedule (p=0x1869c170, calls=20) at beam/erl_process.c:5428
#3  0x00000000166ad861 in process_main () at beam/beam_emu.c:1225
#4  0x0000000016601ddd in sched_thread_func (vesdp=0x16d57c80) at beam/erl_process.c:3789
#5  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#6  0x00007fff8b7078bf in _pthread_start ()
#7  0x00007fff8b70ab75 in thread_start ()

Thread 13 (process 63219):
#0  0x00000000177d6a4e in ?? ()
Cannot access memory at address 0x177d6a4e
#1  0x00007fff8c8e798b in EVP_DigestInit_ex ()
#2  0x00007fff8c8b9e86 in ssleay_rand_bytes ()
#3  0x00007fff8c8ba58e in ssleay_rand_pseudo_bytes ()
#4  0x00000000175657de in rand_bytes_1 (env=0xb0810360, argc=1, argv=0x16d49bc0) at crypto.c:839
#5  0x00000000166bb88e in process_main () at beam/beam_emu.c:3321
#6  0x0000000016601ddd in sched_thread_func (vesdp=0x16d49bc0) at beam/erl_process.c:3789
#7  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#8  0x00007fff8b7078bf in _pthread_start ()
#9  0x00007fff8b70ab75 in thread_start ()

Thread 12 (process 63219):
#0  0x00000000165fb68c in ethr_native_atomic32_read_acqb (var=0x16d1f7d0) at atomic.h:223
#1  0x00000000165fb67e in ethr_atomic32_read_acqb (var=0x16d1f7d0) at ethr_atomics.h:639
#2  0x00000000165fb667 in erts_atomic32_read_acqb (var=0x16d1f7d0) at erl_threads.h:1356
#3  0x00000000165fb650 in erts_smp_atomic32_read_acqb (var=0x16d1f7d0) at erl_smp.h:1019
#4  0x00000000165fb608 in sched_spin_wait (ssi=0x16d1f7c0, spincount=10000) at beam/erl_process.c:967
#5  0x00000000165fb912 in scheduler_wait (fcalls=0xb060afb8, esdp=0x16d3bb00, rq=0x16d1e600) at beam/erl_process.c:1067
#6  0x0000000016604bbb in schedule (p=0x17156280, calls=2001) at beam/erl_process.c:5428
#7  0x00000000166ad861 in process_main () at beam/beam_emu.c:1225
#8  0x0000000016601ddd in sched_thread_func (vesdp=0x16d3bb00) at beam/erl_process.c:3789
#9  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#10 0x00007fff8b7078bf in _pthread_start ()
#11 0x00007fff8b70ab75 in thread_start ()

Thread 11 (process 63219):
#0  0x00007fff8ad2d7e6 in kevent ()
#1  0x00000000166ee14c in check_fd_events (ps=0x16c58390, tv=0xb0405e60, max_res=256, ps_locked=0xb0405620) at sys/common/erl_poll.c:1925
#2  0x00000000166ede33 in erts_poll_wait_kp (ps=0x16c58390, pr=0xb0405660, len=0xb0405e9c, utvp=0xb0405e60) at sys/common/erl_poll.c:2053
#3  0x00000000166f1489 in erts_check_io_kp (do_wait=1) at sys/common/erl_check_io.c:1161
#4  0x00000000166e7b69 in erl_sys_schedule (runnable=0) at sys/unix/sys.c:2854
#5  0x00000000165fbbfd in scheduler_wait (fcalls=0xb0405fb8, esdp=0x16d2da40, rq=0x16d1e400) at beam/erl_process.c:1228
#6  0x0000000016604bbb in schedule (p=0x17158dd0, calls=12) at beam/erl_process.c:5428
#7  0x00000000166ad861 in process_main () at beam/beam_emu.c:1225
#8  0x0000000016601ddd in sched_thread_func (vesdp=0x16d2da40) at beam/erl_process.c:3789
#9  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#10 0x00007fff8b7078bf in _pthread_start ()
#11 0x00007fff8b70ab75 in thread_start ()

Thread 10 (process 63219):
#0  0x00000000165fb61b in sched_spin_wait (ssi=0x16d1f740, spincount=10000) at beam/erl_process.c:973
#1  0x00000000165fb912 in scheduler_wait (fcalls=0xb0200fb8, esdp=0x16d1f980, rq=0x16d1e200) at beam/erl_process.c:1067
#2  0x0000000016604bbb in schedule (p=0x17642f28, calls=12) at beam/erl_process.c:5428
#3  0x00000000166ad861 in process_main () at beam/beam_emu.c:1225
#4  0x0000000016601ddd in sched_thread_func (vesdp=0x16d1f980) at beam/erl_process.c:3789
#5  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#6  0x00007fff8b7078bf in _pthread_start ()
#7  0x00007fff8b70ab75 in thread_start ()

Thread 9 (process 63219):
#0  0x00007fff8ad2d156 in __wait4 ()
#1  0x00000000166e7aae in child_waiter (unused=0x0) at sys/unix/sys.c:2822
#2  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff66179300) at pthread/ethread.c:106
#3  0x00007fff8b7078bf in _pthread_start ()
#4  0x00007fff8b70ab75 in thread_start ()

Thread 8 (process 63219):
#0  0x00007fff8ad2cbca in __psynch_cvwait ()
#1  0x00007fff8b70b274 in _pthread_cond_wait ()
#2  0x00000000167634d2 in ethr_cond_wait (cnd=0x16e22dd0, mtx=0x16e22d90) at common/ethr_mutex.c:1350
#3  0x00000000166680dd in erts_cnd_wait (cnd=0x16e22dd0, mtx=0x16e22d90) at erl_threads.h:695
#4  0x000000001666800d in async_get (q=0x16e22d90) at beam/erl_async.c:207
#5  0x0000000016668338 in async_main (arg=0x16e22d90) at beam/erl_async.c:274
#6  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff66179340) at pthread/ethread.c:106
#7  0x00007fff8b7078bf in _pthread_start ()
#8  0x00007fff8b70ab75 in thread_start ()

Thread 7 (process 63219):
#0  0x00007fff8ad2cbca in __psynch_cvwait ()
#1  0x00007fff8b70b274 in _pthread_cond_wait ()
#2  0x00000000167634d2 in ethr_cond_wait (cnd=0x16e22d40, mtx=0x16e22d00) at common/ethr_mutex.c:1350
#3  0x00000000166680dd in erts_cnd_wait (cnd=0x16e22d40, mtx=0x16e22d00) at erl_threads.h:695
#4  0x000000001666800d in async_get (q=0x16e22d00) at beam/erl_async.c:207
#5  0x0000000016668338 in async_main (arg=0x16e22d00) at beam/erl_async.c:274
#6  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff66179340) at pthread/ethread.c:106
#7  0x00007fff8b7078bf in _pthread_start ()
#8  0x00007fff8b70ab75 in thread_start ()

Thread 6 (process 63219):
#0  0x00007fff8ad2cbca in __psynch_cvwait ()
#1  0x00007fff8b70b274 in _pthread_cond_wait ()
#2  0x00000000167634d2 in ethr_cond_wait (cnd=0x16e22cb0, mtx=0x16e22c70) at common/ethr_mutex.c:1350
#3  0x00000000166680dd in erts_cnd_wait (cnd=0x16e22cb0, mtx=0x16e22c70) at erl_threads.h:695
#4  0x000000001666800d in async_get (q=0x16e22c70) at beam/erl_async.c:207
#5  0x0000000016668338 in async_main (arg=0x16e22c70) at beam/erl_async.c:274
#6  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff66179340) at pthread/ethread.c:106
#7  0x00007fff8b7078bf in _pthread_start ()
#8  0x00007fff8b70ab75 in thread_start ()

Thread 5 (process 63219):
#0  0x00007fff8ad2cbca in __psynch_cvwait ()
#1  0x00007fff8b70b274 in _pthread_cond_wait ()
#2  0x00000000167634d2 in ethr_cond_wait (cnd=0x16e22c20, mtx=0x16e22be0) at common/ethr_mutex.c:1350
#3  0x00000000166680dd in erts_cnd_wait (cnd=0x16e22c20, mtx=0x16e22be0) at erl_threads.h:695
#4  0x000000001666800d in async_get (q=0x16e22be0) at beam/erl_async.c:207
#5  0x0000000016668338 in async_main (arg=0x16e22be0) at beam/erl_async.c:274
#6  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff66179340) at pthread/ethread.c:106
#7  0x00007fff8b7078bf in _pthread_start ()
#8  0x00007fff8b70ab75 in thread_start ()

Thread 4 (process 63219):
#0  0x00007fff8ad2cbca in __psynch_cvwait ()
#1  0x00007fff8b70b274 in _pthread_cond_wait ()
#2  0x00000000167634d2 in ethr_cond_wait (cnd=0x16846b20, mtx=0x16846a80) at common/ethr_mutex.c:1350
#3  0x00000000165ca2e4 in erts_cnd_wait (cnd=0x16846b20, mtx=0x16846a80) at erl_threads.h:695
#4  0x00000000165ca2c5 in erts_smp_cnd_wait (cnd=0x16846b20, mtx=0x16846a80) at erl_smp.h:472
#5  0x00000000165c9e9f in sys_msg_dispatcher_func (unused=0x0) at beam/erl_trace.c:3238
#6  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff66179390) at pthread/ethread.c:106
#7  0x00007fff8b7078bf in _pthread_start ()
#8  0x00007fff8b70ab75 in thread_start ()

Thread 3 (process 63219):
#0  0x00007fff8ad2cbca in __psynch_cvwait ()
#1  0x00007fff8b70b274 in _pthread_cond_wait ()
#2  0x00000000167634d2 in ethr_cond_wait (cnd=0x1688cf70, mtx=0x1688cfc8) at common/ethr_mutex.c:1350
#3  0x00000000165d78e7 in erts_cnd_wait (cnd=0x1688cf70, mtx=0x1688cfc8) at erl_threads.h:695
#4  0x00000000165d78c8 in erts_smp_cnd_wait (cnd=0x1688cf70, mtx=0x1688cfc8) at erl_smp.h:472
#5  0x00000000165d852f in emergency_watchdog (unused=0x0) at beam/utils.c:3945
#6  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793a0) at pthread/ethread.c:106
#7  0x00007fff8b7078bf in _pthread_start ()
#8  0x00007fff8b70ab75 in thread_start ()

Thread 2 (process 63219):
#0  0x00007fff8ad2daf2 in read ()
#1  0x00000000166e7ca2 in signal_dispatcher_thread_func (unused=0x0) at sys/unix/sys.c:2907
#2  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff66179260) at pthread/ethread.c:106
#3  0x00007fff8b7078bf in _pthread_start ()
#4  0x00007fff8b70ab75 in thread_start ()

Thread 1 (process 63219):
#0  0x00007fff8ad2cdf2 in select$DARWIN_EXTSN ()
#1  0x00000000166e7f63 in erts_sys_main_thread () at sys/unix/sys.c:3036
#2  0x000000001659a727 in erl_start (argc=44, argv=0x7fff661796e8) at beam/erl_init.c:1439
#3  0x000000001657abe7 in main (argc=46, argv=0x7fff661796e8) at sys/unix/erl_main.c:29
(gdb) cont
Continuing.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00000000177d6a4e
0x00000000177d6a4e in ?? ()
(gdb) t a a bt

Thread 17 (process 63219):
#0  0x00000000165fb668 in erts_atomic32_read_acqb (var=0x16d1f910) at erl_threads.h:1360
#1  0x00000000165fb608 in sched_spin_wait (ssi=0x16d1f900, spincount=10000) at beam/erl_process.c:967
#2  0x00000000165fb912 in scheduler_wait (fcalls=0xb1023fb8, esdp=0x16d81ec0, rq=0x16d1f000) at beam/erl_process.c:1067
#3  0x0000000016604bbb in schedule (p=0x17159a30, calls=121) at beam/erl_process.c:5428
#4  0x00000000166ad861 in process_main () at beam/beam_emu.c:1225
#5  0x0000000016601ddd in sched_thread_func (vesdp=0x16d81ec0) at beam/erl_process.c:3789
#6  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#7  0x00007fff8b7078bf in _pthread_start ()
#8  0x00007fff8b70ab75 in thread_start ()

Thread 16 (process 63219):
#0  ethr_native_atomic32_read_acqb (var=0x16d1f8d0) at atomic.h:223
#1  0x00000000165fb67e in ethr_atomic32_read_acqb (var=0x16d1f8d0) at ethr_atomics.h:639
#2  0x00000000165fb667 in erts_atomic32_read_acqb (var=0x16d1f8d0) at erl_threads.h:1356
#3  0x00000000165fb650 in erts_smp_atomic32_read_acqb (var=0x16d1f8d0) at erl_smp.h:1019
#4  0x00000000165fb608 in sched_spin_wait (ssi=0x16d1f8c0, spincount=10000) at beam/erl_process.c:967
#5  0x00000000165fb912 in scheduler_wait (fcalls=0xb0e1efb8, esdp=0x16d73e00, rq=0x16d1ee00) at beam/erl_process.c:1067
#6  0x0000000016604bbb in schedule (p=0x17643558, calls=27) at beam/erl_process.c:5428
#7  0x00000000166ad861 in process_main () at beam/beam_emu.c:1225
#8  0x0000000016601ddd in sched_thread_func (vesdp=0x16d73e00) at beam/erl_process.c:3789
#9  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#10 0x00007fff8b7078bf in _pthread_start ()
#11 0x00007fff8b70ab75 in thread_start ()

Thread 15 (process 63219):
#0  0x00000000165fb61b in sched_spin_wait (ssi=0x16d1f880, spincount=10000) at beam/erl_process.c:973
#1  0x00000000165fb912 in scheduler_wait (fcalls=0xb0c19fb8, esdp=0x16d65d40, rq=0x16d1ec00) at beam/erl_process.c:1067
#2  0x0000000016604bbb in schedule (p=0x17155f68, calls=8) at beam/erl_process.c:5428
#3  0x00000000166ad861 in process_main () at beam/beam_emu.c:1225
#4  0x0000000016601ddd in sched_thread_func (vesdp=0x16d65d40) at beam/erl_process.c:3789
#5  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#6  0x00007fff8b7078bf in _pthread_start ()
#7  0x00007fff8b70ab75 in thread_start ()

Thread 14 (process 63219):
#0  0x00007fff8ad2b746 in swtch_pri ()
#1  0x00007fff8b708149 in sched_yield ()
#2  0x00000000165fb6a3 in erts_thr_yield () at erl_threads.h:1853
#3  0x00000000165fb62d in sched_spin_wait (ssi=0x16d1f840, spincount=10000) at beam/erl_process.c:975
#4  0x00000000165fb912 in scheduler_wait (fcalls=0xb0a14fb8, esdp=0x16d57c80, rq=0x16d1ea00) at beam/erl_process.c:1067
#5  0x0000000016604bbb in schedule (p=0x1869c170, calls=20) at beam/erl_process.c:5428
#6  0x00000000166ad861 in process_main () at beam/beam_emu.c:1225
#7  0x0000000016601ddd in sched_thread_func (vesdp=0x16d57c80) at beam/erl_process.c:3789
#8  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#9  0x00007fff8b7078bf in _pthread_start ()
#10 0x00007fff8b70ab75 in thread_start ()

Thread 13 (process 63219):
#0  0x00000000177d6a4e in ?? ()
Cannot access memory at address 0x177d6a4e
#1  0x00007fff8c8e798b in EVP_DigestInit_ex ()
#2  0x00007fff8c8b9e86 in ssleay_rand_bytes ()
#3  0x00007fff8c8ba58e in ssleay_rand_pseudo_bytes ()
#4  0x00000000175657de in rand_bytes_1 (env=0xb0810360, argc=1, argv=0x16d49bc0) at crypto.c:839
#5  0x00000000166bb88e in process_main () at beam/beam_emu.c:3321
#6  0x0000000016601ddd in sched_thread_func (vesdp=0x16d49bc0) at beam/erl_process.c:3789
#7  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#8  0x00007fff8b7078bf in _pthread_start ()
#9  0x00007fff8b70ab75 in thread_start ()

Thread 12 (process 63219):
#0  0x00000000165fb61f in sched_spin_wait (ssi=0x16d1f7c0, spincount=10000) at beam/erl_process.c:973
#1  0x00000000165fb912 in scheduler_wait (fcalls=0xb060afb8, esdp=0x16d3bb00, rq=0x16d1e600) at beam/erl_process.c:1067
#2  0x0000000016604bbb in schedule (p=0x17156280, calls=2001) at beam/erl_process.c:5428
#3  0x00000000166ad861 in process_main () at beam/beam_emu.c:1225
#4  0x0000000016601ddd in sched_thread_func (vesdp=0x16d3bb00) at beam/erl_process.c:3789
#5  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#6  0x00007fff8b7078bf in _pthread_start ()
#7  0x00007fff8b70ab75 in thread_start ()

Thread 11 (process 63219):
#0  0x0000000016618826 in bump_timer_internal (dt=134074) at beam/time.c:230
#1  0x0000000016618700 in erts_bump_timer (dt=134074) at beam/time.c:279
#2  0x00000000165fbc16 in scheduler_wait (fcalls=0xb0405fb8, esdp=0x16d2da40, rq=0x16d1e400) at beam/erl_process.c:1231
#3  0x0000000016604bbb in schedule (p=0x17158dd0, calls=12) at beam/erl_process.c:5428
#4  0x00000000166ad861 in process_main () at beam/beam_emu.c:1225
#5  0x0000000016601ddd in sched_thread_func (vesdp=0x16d2da40) at beam/erl_process.c:3789
#6  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#7  0x00007fff8b7078bf in _pthread_start ()
#8  0x00007fff8b70ab75 in thread_start ()

Thread 10 (process 63219):
#0  0x00000000165fb651 in erts_smp_atomic32_read_acqb (var=0x4400002114) at erl_smp.h:1023
#1  0x00000000165fb912 in scheduler_wait (fcalls=0xb0200fb8, esdp=0x16d1f980, rq=0x16d1e200) at beam/erl_process.c:1067
#2  0x0000000016604bbb in schedule (p=0x17642f28, calls=12) at beam/erl_process.c:5428
#3  0x00000000166ad861 in process_main () at beam/beam_emu.c:1225
#4  0x0000000016601ddd in sched_thread_func (vesdp=0x16d1f980) at beam/erl_process.c:3789
#5  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793d0) at pthread/ethread.c:106
#6  0x00007fff8b7078bf in _pthread_start ()
#7  0x00007fff8b70ab75 in thread_start ()

Thread 9 (process 63219):
#0  0x00007fff8ad2d156 in __wait4 ()
#1  0x00000000166e7aae in child_waiter (unused=0x0) at sys/unix/sys.c:2822
#2  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff66179300) at pthread/ethread.c:106
#3  0x00007fff8b7078bf in _pthread_start ()
#4  0x00007fff8b70ab75 in thread_start ()

Thread 8 (process 63219):
#0  0x00007fff8ad2cbca in __psynch_cvwait ()
#1  0x00007fff8b70b274 in _pthread_cond_wait ()
#2  0x00000000167634d2 in ethr_cond_wait (cnd=0x16e22dd0, mtx=0x16e22d90) at common/ethr_mutex.c:1350
#3  0x00000000166680dd in erts_cnd_wait (cnd=0x16e22dd0, mtx=0x16e22d90) at erl_threads.h:695
#4  0x000000001666800d in async_get (q=0x16e22d90) at beam/erl_async.c:207
#5  0x0000000016668338 in async_main (arg=0x16e22d90) at beam/erl_async.c:274
#6  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff66179340) at pthread/ethread.c:106
#7  0x00007fff8b7078bf in _pthread_start ()
#8  0x00007fff8b70ab75 in thread_start ()

Thread 7 (process 63219):
#0  0x00007fff8ad2cbca in __psynch_cvwait ()
#1  0x00007fff8b70b274 in _pthread_cond_wait ()
#2  0x00000000167634d2 in ethr_cond_wait (cnd=0x16e22d40, mtx=0x16e22d00) at common/ethr_mutex.c:1350
#3  0x00000000166680dd in erts_cnd_wait (cnd=0x16e22d40, mtx=0x16e22d00) at erl_threads.h:695
#4  0x000000001666800d in async_get (q=0x16e22d00) at beam/erl_async.c:207
#5  0x0000000016668338 in async_main (arg=0x16e22d00) at beam/erl_async.c:274
#6  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff66179340) at pthread/ethread.c:106
#7  0x00007fff8b7078bf in _pthread_start ()
#8  0x00007fff8b70ab75 in thread_start ()

Thread 6 (process 63219):
#0  0x00007fff8ad2cbca in __psynch_cvwait ()
#1  0x00007fff8b70b274 in _pthread_cond_wait ()
#2  0x00000000167634d2 in ethr_cond_wait (cnd=0x16e22cb0, mtx=0x16e22c70) at common/ethr_mutex.c:1350
#3  0x00000000166680dd in erts_cnd_wait (cnd=0x16e22cb0, mtx=0x16e22c70) at erl_threads.h:695
#4  0x000000001666800d in async_get (q=0x16e22c70) at beam/erl_async.c:207
#5  0x0000000016668338 in async_main (arg=0x16e22c70) at beam/erl_async.c:274
#6  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff66179340) at pthread/ethread.c:106
#7  0x00007fff8b7078bf in _pthread_start ()
#8  0x00007fff8b70ab75 in thread_start ()

Thread 5 (process 63219):
#0  0x00007fff8ad2cbca in __psynch_cvwait ()
#1  0x00007fff8b70b274 in _pthread_cond_wait ()
#2  0x00000000167634d2 in ethr_cond_wait (cnd=0x16e22c20, mtx=0x16e22be0) at common/ethr_mutex.c:1350
#3  0x00000000166680dd in erts_cnd_wait (cnd=0x16e22c20, mtx=0x16e22be0) at erl_threads.h:695
#4  0x000000001666800d in async_get (q=0x16e22be0) at beam/erl_async.c:207
#5  0x0000000016668338 in async_main (arg=0x16e22be0) at beam/erl_async.c:274
#6  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff66179340) at pthread/ethread.c:106
#7  0x00007fff8b7078bf in _pthread_start ()
#8  0x00007fff8b70ab75 in thread_start ()

Thread 4 (process 63219):
#0  0x00007fff8ad2cbca in __psynch_cvwait ()
#1  0x00007fff8b70b274 in _pthread_cond_wait ()
#2  0x00000000167634d2 in ethr_cond_wait (cnd=0x16846b20, mtx=0x16846a80) at common/ethr_mutex.c:1350
#3  0x00000000165ca2e4 in erts_cnd_wait (cnd=0x16846b20, mtx=0x16846a80) at erl_threads.h:695
#4  0x00000000165ca2c5 in erts_smp_cnd_wait (cnd=0x16846b20, mtx=0x16846a80) at erl_smp.h:472
#5  0x00000000165c9e9f in sys_msg_dispatcher_func (unused=0x0) at beam/erl_trace.c:3238
#6  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff66179390) at pthread/ethread.c:106
#7  0x00007fff8b7078bf in _pthread_start ()
#8  0x00007fff8b70ab75 in thread_start ()

Thread 3 (process 63219):
#0  0x00007fff8ad2cbca in __psynch_cvwait ()
#1  0x00007fff8b70b274 in _pthread_cond_wait ()
#2  0x00000000167634d2 in ethr_cond_wait (cnd=0x1688cf70, mtx=0x1688cfc8) at common/ethr_mutex.c:1350
#3  0x00000000165d78e7 in erts_cnd_wait (cnd=0x1688cf70, mtx=0x1688cfc8) at erl_threads.h:695
#4  0x00000000165d78c8 in erts_smp_cnd_wait (cnd=0x1688cf70, mtx=0x1688cfc8) at erl_smp.h:472
#5  0x00000000165d852f in emergency_watchdog (unused=0x0) at beam/utils.c:3945
#6  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff661793a0) at pthread/ethread.c:106
#7  0x00007fff8b7078bf in _pthread_start ()
#8  0x00007fff8b70ab75 in thread_start ()

Thread 2 (process 63219):
#0  0x00007fff8ad2daf2 in read ()
#1  0x00000000166e7ca2 in signal_dispatcher_thread_func (unused=0x0) at sys/unix/sys.c:2907
#2  0x00000000167652a7 in thr_wrapper (vtwd=0x7fff66179260) at pthread/ethread.c:106
#3  0x00007fff8b7078bf in _pthread_start ()
#4  0x00007fff8b70ab75 in thread_start ()

Thread 1 (process 63219):
#0  0x00007fff8ad2cdf2 in select$DARWIN_EXTSN ()
#1  0x00000000166e7f63 in erts_sys_main_thread () at sys/unix/sys.c:3036
#2  0x000000001659a727 in erl_start (argc=44, argv=0x7fff661796e8) at beam/erl_init.c:1439
#3  0x000000001657abe7 in main (argc=46, argv=0x7fff661796e8) at sys/unix/erl_main.c:29
(gdb) The program is running.  Quit anyway (and detach it)? (y or n) y

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.