I was unable to create a test case, so I've linked some relevant code snippets of around where the segfault is happening and a log of the program execution with -jdump. I can also get a core dump if needed.
Is this a bug, or am I doing something wrong, and how do I fix it?
Thanks, Alex