Running a script on crash/termination

I haven’t been able to get Unreal to send a crash report via the built-in crash reporter on my Linux servers and I can’t upload the core dump with the log files option because they’re too large.

Is there a way I can run a script right after the session terminates? I’d like to use GDB to grab some info from the core dump and then send it to our crash report service manually.

Did you figure something out?

As you own the server, you should be able to trigger whatever code is required ie:

  • When a process starts it could look for any existing crash dumps from crashed processes
    • GameLift will keep restarting crashed processes on your instance while its still in your fleet
    • You could use your instance role to then upload to a known S3 bucket and then have a lambda etc pass them onto your crash reporting system etc (or via some service endpoint).
  • Or via code after you have called TerminateGameSession or ProcessEnding (but then you’re unlikely to have a crash dump if your process is acting normally)
  • You could install a crash dump watcher process that you can trigger when your game server starts up etc.
  • You could abuse the game session logs but as you noted theres a hard cap on size (200mb) which prevents most crash dumps making it out of the system.

In most cases you’ll need to have some form of lock etc such that only one of your servers (if running multiple instances) handles any existing crash dumps.

Not sure what others have done here. You may also want to try the Unreal Forums to see how folks there are trying it.