とりあえず動的メモリ解析はかけてみるべき
valgrindはAndroidでも使えるし、Google公式のAddressSanitizerが何種類か使える
https://developer.android.com/ndk/guides/asan?hl=ja
https://developer.android.com/ndk/guides/hwasan?hl=ja
https://developer.android.com/ndk/guides/arm-mte?hl=ja
https://developer.android.com/ndk/guides/gwp-asan?hl=ja