I’m currently trying to find a memory leak in a NIF I have written in C.
I have found some resources as to how to run erlang NIFs with valgrind. I already compiled the Erlang VM and I can now run cerl with -valgrind and -gdb.
Are there any resources on Elixir specific NIF debugging that I’m missing? Is there a setup that has worked for you? Any guide, manual, book, video, etc. would be very helpful.
This topic is above my pay grade, but I just finished watching this talk and he mentions a library that might be useful to you.
I don’t know the name of the library though. Maybe it can help you.
I do have a debug emulator, and tested that valgrind and gdb are working. But I’m not sure how I can run something like iex -S mix with the debug emulator.
Is there a way I can run $ERL_TOP/bin/cerl -rvalgrind and load my mix project? Once I have the ebin folder with the BEAM files is it possible to do that?