Crash in socket.go attempting to update BLEFS #11

Closed
opened 2022-03-06 01:31:17 +00:00 by brennana · 2 comments

Sometimes, when attempting reconnection, itd crashes during the BLEFS update phase of handleConnection. In my particular case, it seems to be because the watch lost connection again before the FS update attempt (apparently not far away enough to induce the pair-code issue, however).

In any case, if the dev.FS() operation fails, there is a chance that a segfault will arise:

Mar 05 17:38:33 pinephonepro itd[47055]: 5:38PM WRN Error updating BLE filesystem error="not connected"
Mar 05 17:38:33 pinephonepro itd[47055]: panic: runtime error: invalid memory address or nil pointer dereference
Mar 05 17:38:33 pinephonepro itd[47055]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x3705ac]
Mar 05 17:38:33 pinephonepro itd[47055]: goroutine 57 [running]:
Mar 05 17:38:33 pinephonepro itd[47055]: main.handleConnection({0x4d75d8, 0x400010c018}, 0x400018cb00, 0x400015c408)
Mar 05 17:38:33 pinephonepro itd[47055]:         /home/andy/.cache/yay/itd-git/src/itd/socket.go:119 +0x10c
Mar 05 17:38:33 pinephonepro itd[47055]: created by main.startSocket.func1
Mar 05 17:38:33 pinephonepro itd[47055]:         /home/andy/.cache/yay/itd-git/src/itd/socket.go:97 +0x50
Sometimes, when attempting reconnection, itd crashes during the BLEFS update phase of `handleConnection`. In my particular case, it seems to be because the watch lost connection again before the FS update attempt (apparently not far away enough to induce the pair-code issue, however). In any case, if the `dev.FS()` operation fails, there is a chance that a segfault will arise: ``` Mar 05 17:38:33 pinephonepro itd[47055]: 5:38PM WRN Error updating BLE filesystem error="not connected" Mar 05 17:38:33 pinephonepro itd[47055]: panic: runtime error: invalid memory address or nil pointer dereference Mar 05 17:38:33 pinephonepro itd[47055]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x3705ac] Mar 05 17:38:33 pinephonepro itd[47055]: goroutine 57 [running]: Mar 05 17:38:33 pinephonepro itd[47055]: main.handleConnection({0x4d75d8, 0x400010c018}, 0x400018cb00, 0x400015c408) Mar 05 17:38:33 pinephonepro itd[47055]: /home/andy/.cache/yay/itd-git/src/itd/socket.go:119 +0x10c Mar 05 17:38:33 pinephonepro itd[47055]: created by main.startSocket.func1 Mar 05 17:38:33 pinephonepro itd[47055]: /home/andy/.cache/yay/itd-git/src/itd/socket.go:97 +0x50 ```
Owner

It should be fixed now. Please test and confirm. Thank you for finding these bugs.

It should be fixed now. Please test and confirm. Thank you for finding these bugs.
Elara6331 added the
Bug
Waiting For Info
labels 2022-03-08 16:33:30 +00:00
Author

Rebuilt and tested with the latest commit, and upon receiving the warning from BLEFS update, the daemon now continues gracefully instead of segfaulting.

Thanks for building such a robust Pinetime daemon (and fixing these issues so quickly)! :D

Rebuilt and tested with the latest commit, and upon receiving the warning from BLEFS update, the daemon now continues gracefully instead of segfaulting. Thanks for building such a robust Pinetime daemon (and fixing these issues so quickly)! :D
Elara6331 removed the
Waiting For Info
label 2022-03-09 04:02:01 +00:00
Sign in to join this conversation.
No description provided.