I haven’t encountered a kernel dead issue in the terminal yet, so I’m unsure how to debug it.
You could most likely check the application with gdb via:
gdb --args python script.pt args
...
run
...
bt

and see, if you get a better error message.