Hi folks,
I have my own program in Rust that takes a JSON, does some calculations and then returns another JSON. I can build the program using Nix without a problem. The problem is then to run the program, since recently I started getting a Segmentation fault error when the program runs inside mkDerivation.
The solution was to Box a few things inside the program (to move some data structures from Stack to Heap), but I’m worried that this will be an ongoing issue, and I’ll have to make changes only to make it runnable in derivation.
If I simply run the program with the same data and the same arguments as the derivation, it works just fine. I also tried to run ulimit -s 8192 in Bash and then run the program, and that also works. Which makes me question how it is possible to fail inside the derivation? By boxing, I tested that decreasing Stack usage helps, but I don’t understand why it’s needed.
Thank you.