C/Fortran FFI memory error

If you have a debugger installed, try running a non-release version of your program under the debugger. The debugger should automatically pause when a segfault is triggered, which gives you a chance to print the backtrace and see how you got into that situation.

That's essentially what I did earlier this evening when troubleshooting a different segfault. From there I looked up the stack for code that belonged to the project and traced different arguments back though the program.