Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recieving many notifications in a short time span causes the watch to get soft bricked #1888

Closed
1 task done
ThePinkUnicorn6 opened this issue Oct 11, 2023 · 6 comments · Fixed by #1911
Closed
1 task done
Labels
bug Something isn't working

Comments

@ThePinkUnicorn6
Copy link

Verification

  • I searched for similar bug reports (including closed issues) and found none was relevant.

What happened?

When the watch recieves a lot of notifications within a second, the watch reboots into the recovery mode and will not boot up to the watchface again.

What should happen instead?

The notifications should be displayed and then it should go back to the watch face.

Reproduction steps

In the Gadgetbridge app on android, go to the debug menu that is in the side bar. Then press the "Send" button as fast as you can for a few seconds. The watch will display the first few notifications but then reboot into the recovery mode. Restarting the watch by holding down the button for a few seconds will reboot it back into recovery mode. By reconecting the watch to gadget bridge and re-uploading the firmare the device was able to boot to the watchface again.

More details?

The bug could be triggered by a badly written app that sends a lot of notifications (eg. some music apps).

Version

v1.13.0

Companion app

Gadgetbridge 0.76.1

@ThePinkUnicorn6 ThePinkUnicorn6 added the bug Something isn't working label Oct 11, 2023
@ThePinkUnicorn6
Copy link
Author

I just tried to trigger the bug again but interestingly it did not cause it to boot into the recovery mode when it restarted.

@ThePinkUnicorn6 ThePinkUnicorn6 changed the title Recieving many notifications in a short timespan causes the watch to get soft bricked Recieving many notifications in a short time span causes the watch to get soft bricked Oct 12, 2023
@minacode
Copy link
Contributor

minacode commented Oct 14, 2023

This is my guess what happened:

  1. nimble tries to allocate more memory than it has available
  2. it crashes
  3. you didn't verify your firmware before
  4. the watch boots into recovery

Edit: if this theory is true, I don't know what we can do. Probably not much.

@ThePinkUnicorn6
Copy link
Author

ThePinkUnicorn6 commented Oct 14, 2023

The firmware was validated before doing this and I had restarted the watch multiple times before this happened. I cannot get the watch to get stuck in recovery again though so it must require specific timing, or the watch to be using over a certain amount of memory, or something like that.

@minacode
Copy link
Contributor

Is it possible to overwrite or corrupt the current firmware with a buffer overflow? I don't know where the firmware is stored.

@erobertsme
Copy link

Similar to this my Pinetime will reboot with rapid notifications.

My phone sometimes displays notifications from my work email on Google Workspace all at once which causes the Pinetime to get spammed with notifications and it reboots.

Oddly, it got hit with a ton of notifications today from this but only showed a few and did not reboot.

@JF002
Copy link
Collaborator

JF002 commented Nov 12, 2023

I can reproduce the crash with the debug screen in Gadgetbridge.

The issue is caused by SystemTask and DisplayApp sending each other messages (via their respective message queues) faster than they can process them. At some points, the messages queues are full and both tasks are in a deadlock situation.

I submitted a fix in #1911.

Regarding the soft-brick part of this post, it was probably caused by the firmware that was not properly validated (in the settings menu) when the crash occurred. While maybe not impossible, there's very few chances the firmware could corrupt itself and force a reboot in recovery mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants