facebook / hermes

A JavaScript engine optimized for running React Native.
https://hermesengine.dev/
MIT License
9.91k stars 641 forks source link

Hermies causing background CPU watchdog terminations #660

Closed Gnative closed 2 months ago

Gnative commented 2 years ago

I have a curious issue where I run location services for tracking in my app. For the last year at various times the app is terminated in the background by the CPU watch dog for using to much cpu time I.E 9 seconds cpu time over 19 seconds (46% cpu average), exceeding limit of 15% cpu. This prevented me from pushing my app into production for a long time.

I found the attached crash logs, which shows some activity from Hermies thou I don't understand them.

I have since removed Hermies from my iOS builds and have not had one watchdog termination since, in the last month

These crashes occurred on my older iPhone 7 and I haven't seen these crashes in newer iPhones

Hermes version: 0.9.0 React Native version (if any): 0.64.4 iPhone: 7 OS version (if any): 15.2 Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64):

I'm not able to reproduce this issue consistency as I don't understand the root cause.

Contours 17.12.21, 12-58_sym.txt

Contours 17.12.21, 11-07_sym.txt

Gnative commented 2 years ago

Hi FB - wonder if there is to be any follow up on this issue ?

tmikov commented 2 years ago

Sorry, we simply don't have enough information to do anything constructive here. Since this is a React Native app, the JS engine is bound to be in the crash logs. Do you have any specific reason to believe that this is a bug in Hermes?

Gnative commented 2 years ago

Hi @tmikov thanks for the reply. The reasoning is that if I enable Hermes use I start having the watch dog terminations and when I disable Hermes I haven't seen a single one, now since 2 months.

My app is a GPS tracking app so it's pretty reliant on having this feature. I spent the last year optimising and debugging my app trying to resolve the terminations.

I've attached a couple of crash logs if they were of any use.

Maybe if you could point me to how to debug Hermes in a running app, I'll enable it again and gather more data.

Thanks again @tmikov