I wrote a fix, could you try downgrading to 2017.06, running the script, applying the patch to your 2017.07, making sure the Makefile itself gets regenerated via Configure.pl, and install, then see if the program still crashes?
https://github.com/rakudo/rakudo/commit/02667bd890 the commit message also explains what's going wrong here.