InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.68k stars 916 forks source link

Watch crashes when updating settings after filesystem read via BLE #1579

Open tom-programming opened 1 year ago

tom-programming commented 1 year ago

Verification

What happened?

Running ReadDir via BLE followed by any setting update causes a crash

What should happen instead?

It should save the settings and not crash

Reproduction steps

Simplest way is using itd.

  1. Connect to the Pinetime via itd and look at the filesystem via itgui
  2. Disconnect the Pinetime from Bluetooth
  3. Open Settings, change something and press the Pinetime button
  4. It will hang for a while and then crash

More details?

By closer inspection we found that the issue is unrelated to itd. It can be triggered by issuing an "ls" command directly using the Adafruit protocol (for example with a Python script), and that the crash occurs when there is an attempt to write to the filesystem.

We believe that some data structure of LittleFS becomes corrupted when FS operations are triggered via BLE.

Version

1.11.0

Companion app

No response