[erlang-questions] Linking enif_* functions to an executable file

Sverker Eriksson <>
Mon Apr 28 14:51:32 CEST 2014


On 04/27/2014 06:00 AM, mayamatakeshi wrote:
> All, thanks for the suggestions.
> I tried valgrind and still could not make gdb to stop on the segfault.
> I believe this is an issue with old gdb as this is a machine running CentOS
> 3.9 (required by a proprietary library that will not work with most recent
> distros). I am trying to install a more recent version of gdb but they keep
> failing to build.
> Til I solve this, I will recourse to debug with printf.
> Regards,
> Takeshi.
>
>
I also recommend to use a debug emulator during NIF development.
A lot of runtime assertions for earlier error detection and no compiler 
optimizations for nicer core dumps.


cd $ERL_TOP/erts/emulator
make TYPE=debug smp plain

$ERL_TOP/bin/cerl -debug



/Sverker, Erlang/OTP




More information about the erlang-questions mailing list