How to find out the code (C++) make the game crash with signal 9(Killed)?

233 views
Skip to first unread message

seal2002

unread,
Feb 17, 2024, 10:15:25 PMFeb 17
to android-ndk
Hello,

Preface: I'm working on a game project on the mobile platform - both on iOS/Android.
Our game is an HD+ game, which is written in C/C++ & Java.
The main code in C++ is around 90%, C from third-party libraries (curl, OpenSSL, zlib,...) less than 5%, and Java code is used for communication with the Android API.

Recently, with many changes from the team, the game randomly crashed on Android without any stack trace or bug report. Only one line:
 Zygote  : Process 21540 exited due to signal 9 (Killed).
It happens on many firmware from 9 to 13, from Samsung to Huawei(Honor), and Xiaomi...

We are trying to debug from our end (programmers) but have no luck - because it is random or did we make the debug build? However, our QA meets it in around 5% of test sessions.

I checked the following documents

Do you have any suggestions for this situation? May I miss something on the documents above?

Thanks in advance,

Hai

yu...@unity3d.com

unread,
Feb 19, 2024, 2:16:22 AMFeb 19
to android-ndk
Hey,
Check out if this is an LMK because of OOM. You'll see the low-memory-killer entries in the log some time before your app is killed.
To make the LMK kill the foreground process (I assume it just runs and suddenly dies?), you must be VERY aggressive on allocations. Or, search for a leak. Or, both. :) 

Yury

enh

unread,
Feb 20, 2024, 11:06:27 AMFeb 20
to andro...@googlegroups.com
yeah, even if it isn't an out-of-memory kill -- and, to be clear, i
agree with Yury that it almost certain _is_ -- we've annotated all (?)
places in the system that kill a process so that they log who's doing
the kill and why, specifically because it's so hard to debug otherwise
(because you can't catch SIGKILL, so you have no chance for a crash
dump).
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/81e8d5a6-4f2e-4e10-bc7c-a0b3e1dc8037n%40googlegroups.com.

JB Data31

unread,
Feb 20, 2024, 8:34:52 PMFeb 20
to andro...@googlegroups.com
Hi,

To investigate and resolve this kind of problem, I used bugreport (/system/bin/bugreport on my android).

@JBΔ



--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.

enh

unread,
Feb 20, 2024, 8:44:39 PMFeb 20
to andro...@googlegroups.com
(note that the original question was specifically about signal 9, aka
SIGKILL --- a signal you can't catch, so there won't be any tombstone.
like Yury said, you'll need to look in the log to see if whoever
killed you said why they killed you. but, like Yury also said, it's
because you used too much memory :-) )
> To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CA%2BPN%3DMxZPj_4i24L6MK4hj057k-Q7ib7t1Fvx9hXxYKgyVPjeA%40mail.gmail.com.

seal2002

unread,
Feb 21, 2024, 9:19:13 PMFeb 21
to android-ndk
Thank you, Yury and Enh
I will follow your instructions. Looks like we don't have any other choice XD.
Reply all
Reply to author
Forward
0 new messages