KieronQuinn / TapTap

Port of the double tap on back of device feature from Android 12 to any Android 7.0+ device
GNU General Public License v3.0
3.45k stars 200 forks source link

Crashed randomly overnight. [crash report attached] #581

Closed e-t-l closed 1 year ago

e-t-l commented 1 year ago

Pixel 7 running GrapheneOS 13 unrooted. Shizuku v13.3 is running. Phone was charging overnight, crash report seen in morning. Crash does not occur consistently. tap_tap_crash_report_2023-06-21T09_02_29.376.txt

KieronQuinn commented 1 year ago

482

e-t-l commented 1 year ago

482

@KieronQuinn Thanks for the quick feedback! So, what does "maximum number of sensor listeners" mean? In my case, this happened overnight while the phone was not in use and no processes should have been starting (besides whatever routine background stuff happens 24/7).

Is there any possibility that Tap Tap has a "listener leak" (like memory leak) where it registers new sensor listeners over time without properly destroying previous ones?

Some reasons to think this might be the case:

  1. I do get this Tap Tap crash every so often, and while I don't regularly reboot my phone, I do just restart Tap Tap, and I don't immediately get the crash again. In fact, I don't get a crash again for days or weeks, even if I haven't rebooted my phone in that period. That suggests that Tap Tap is the source of the majority of the sensor listeners.
  2. While I do have some other apps that utilize sensor listeners, I have never gotten a crash like this for one of them.
  3. This crash happened in the middle of the night. Tap Tap had been started many hours, maybe even days, previous. Why is Tap Tap trying to register a new sensor listener in the middle of the night, while nothing is happening on the phone? Again, it suggests that for some reason, Tap Tap is registering more listeners than expected.

Thoughts?

KieronQuinn commented 1 year ago

The limit is local, per app, so other apps not getting it is irrelevant.

I know it happens sometimes, but it's very much edge case - there's only been a handful of cases in the thousands of users, so it's very rare. Tracking it down would be nigh on impossible without physical device access as I've never had it happen on my test stack.

e-t-l commented 1 year ago

Oh ok, interesting. I suppose it's more complicated than, wherever in the code is the "register listener" command, to put a "delete listeners" right before it?

e-t-l commented 1 year ago

Just want to mention that this is still happening every week or so. The most recent time it was while sitting in my home, locked, charging, not being interacted with in any way.

I understand this apparently doesn't happen to many other users, but if you can help me do a little investigating into how tap tap operates, at least:

Why is Tap Tap trying to register a new sensor listener in the middle of the night, while nothing is happening on the phone?

Is registering new listeners a schedule-based event or a trigger-based one?

Is there some way Tap Tap could clear the cache, so to speak, of listeners so that it doesn't run the risk of hitting the maximum?