I have recently moved from a Linux environment to Windows and my NIFs that call `enif_fprintf` are causing segfaults.
A simple call such as `enif_fprintf(stdout, “Hello, world!\n”);` will cause issue.
My build setup is:
* Windows 10
* MSYS2 + MinGW 64-bit + gcc
I have tried in both `erl` and `werl` to the same effect as well as `stdout` and `stderr`...
Does anyone have any insight into what might be the issue?
Interesting... so I put together a Windows native make file to use cl.exe (vs gcc) from within a Visual Studio developer prompt and in this scenario the segfaults are gone but I don’t get any output to the terminal at all.
I made sure to try in just erl.exe. I am using MSVC 2017 so that should be OK too... At this point I am just rolling with all the stdout/stderr fprintf’s commented out. On this note, does anyone have any good tip for debugging NIFs in general? It is not immediately clear to me how one would get a debugging session going with something like GDB while using Erlang/rebar3.