I'd recommend building kodi, game.libretro and rcheevos with debug info and also enable the address sanitizer.
You can pass in the needed options as environment variables when building LE, but personally I prefer to create a .libreelec/options file with them. eg:
DEBUG="kodi game.libretro rcheevos"
DEBUG_SANITIZER_CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
Then do a full clean image and game.libretro addon build.
The undefined behavior sanitizer can also be helpful - see the gcc docs https://gcc.gnu.org/onlinedocs/gcc…on-Options.html
Another possibility is to run kodi with valgrind - it's a lot slower than the address sanitizer but may give additional info.
To include valgrind in the image you need to enable it:
and then manually start kodi with valgrind kodi --standalone -fs --audio-backend=alsa+pulseaudio
Depending on where exactly it's crashing you may need to enable debug info for additional packages.
so long,
Hias