Hello folks,<div><br></div><div>I'm having difficulties locating the cause of a segfault I'm getting when running tests with a NIF implementation I have.</div><div><br></div><div>Anything that would shed light on what's wrong is appreciated.</div><div><br></div><div>The backtrace does not seem to have anything to do with my NIF. The NIF:ed function is called from a few different processes, and it forwards the call to a worker thread which sends a message back to the caller process.</div><div><br></div><div><div>> strings -a ../../otp/R16B/pre-5.10.1-mz-0.2/lib/erlang/erts-5.10.1/bin/beam.smp|fgrep GCC|sort -u</div><div>GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3</div></div><div><br></div><div>> USE_GDB=1 rebar eunit</div><div>[cut]</div><div><div>Program received signal SIGSEGV, Segmentation fault.<br></div><div>[Switching to Thread 0x2aaaef381700 (LWP 19162)]</div><div>unlink_free_block (allctr=0x85f240, block=0x0, flags=0) at beam/erl_goodfit_alloc.c:458</div><div>458<span class="Apple-tab-span" style="white-space:pre">   </span>    Uint sz = MBC_FBLK_SZ(&blk->block_head);</div><div>(gdb) backtrace</div><div>#0  unlink_free_block (allctr=0x85f240, block=0x0, flags=0) at beam/erl_goodfit_alloc.c:458</div><div>#1  0x0000000000444ee1 in get_free_block (allctr=0x85f240, size=<optimized out>, cand_blk=0x0, cand_size=0, flags=0) at beam/erl_goodfit_alloc.c:426</div><div>#2  0x000000000043b6da in mbc_alloc_block (alcu_flgsp=<synthetic pointer>, blk_szp=<synthetic pointer>, size=<optimized out>, allctr=0x85f240) at beam/erl_alloc_util.c:1309</div><div>#3  mbc_alloc (allctr=0x85f240, size=<optimized out>) at beam/erl_alloc_util.c:1451</div><div>#4  0x0000000000440d7b in do_erts_alcu_alloc (size=32, extra=0x85f240, type=148) at beam/erl_alloc_util.c:3530</div><div>#5  erts_alcu_alloc_thr_pref (type=148, extra=<optimized out>, size=<optimized out>) at beam/erl_alloc_util.c:3607</div><div>#6  0x0000000000490595 in erts_alloc (size=32, type=18967) at beam/erl_alloc.h:208</div><div>#7  new_message_buffer (size=0) at beam/erl_message.c:72</div><div>#8  erts_alloc_message_heap_state (statep=0x2aaaef380c4c, receiver_locks=0x2aaaef380cb0, receiver=0x2aaaac9ccac8, ohpp=<synthetic pointer>, bpp=<synthetic pointer>, size=0) at beam/global.h:1017</div><div>#9  erts_send_message (sender=0x2aaaac9cd118, receiver=0x2aaaac9ccac8, receiver_locks=0x2aaaef380cb0, message=513931, flags=<optimized out>) at beam/erl_message.c:1039</div><div>#10 0x0000000000476350 in do_send (p=0x2aaaac9cd118, to=550027, msg=513931, suspend=1, refp=<optimized out>) at beam/bif.c:2025</div><div>#11 0x0000000000476bf0 in erl_send (p=0x2aaaac9cd118, to=550027, msg=513931) at beam/bif.c:2138</div><div>#12 0x000000000052d1d8 in process_main () at beam/beam_emu.c:2558</div><div>#13 0x0000000000491463 in sched_thread_func (vesdp=0x2aaaac34de40) at beam/erl_process.c:5632</div><div>#14 0x0000000000590440 in thr_wrapper (vtwd=0x7fffffffd7e0) at pthread/ethread.c:106</div><div>#15 0x00002aaaab3ffe9a in start_thread (arg=0x2aaaef381700) at pthread_create.c:308</div><div>#16 0x00002aaaab911cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112</div><div>#17 0x0000000000000000 in ?? ()</div><div>(gdb) </div></div><div><br></div>