Pebble Time disconnects on incoming notification (BufferOverflowException) #1323

Closed
by evll opened 3 years ago · 4 comments
evll commented 3 years ago (Migrated from github.com)
Owner

Your issue is:

After updating to 0.31.0 most of the time when a notification is incoming, my Pebble Time disconnects. In the log I can see this exception:

09:01:59.867 [main] ERROR n.f.g.LoggingExceptionHandler - Uncaught exception: Unable to start service nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService@6a6ede0 with Intent { act=nodomain.freeyourgadget.gadgetbridge.devices.action.notification cmp=nodomain.freeyourgadget.gadgetbridge/.service.DeviceCommunicationService (has extras) }: java.nio.BufferOverflowException
java.lang.RuntimeException: Unable to start service nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService@6a6ede0 with Intent { act=nodomain.freeyourgadget.gadgetbridge.devices.action.notification cmp=nodomain.freeyourgadget.gadgetbridge/.service.DeviceCommunicationService (has extras) }: java.nio.BufferOverflowException
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3821) ~[na:0.0]
	at android.app.ActivityThread.access$1800(ActivityThread.java:207) ~[na:0.0]
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1779) ~[na:0.0]
	at android.os.Handler.dispatchMessage(Handler.java:106) ~[na:0.0]
	at android.os.Looper.loop(Looper.java:193) ~[na:0.0]
	at android.app.ActivityThread.main(ActivityThread.java:6863) ~[na:0.0]
	at java.lang.reflect.Method.invoke(Native Method) ~[na:0.0]
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) ~[na:0.0]
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) ~[na:0.0]
Caused by: java.nio.BufferOverflowException: null
	at java.nio.Buffer.nextPutIndex(Buffer.java:536) ~[na:0.0]
	at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:144) ~[na:0.0]
	at nodomain.freeyourgadget.gadgetbridge.service.devices.pebble.PebbleProtocol.encodeNotification(PebbleProtocol.java:979) ~[na:0.0]
	at nodomain.freeyourgadget.gadgetbridge.service.devices.pebble.PebbleProtocol.encodeNotification(PebbleProtocol.java:509) ~[na:0.0]
	at nodomain.freeyourgadget.gadgetbridge.service.serial.AbstractSerialDeviceSupport.onNotification(AbstractSerialDeviceSupport.java:118) ~[na:0.0]
	at nodomain.freeyourgadget.gadgetbridge.service.devices.pebble.PebbleSupport.onNotification(PebbleSupport.java:187) ~[na:0.0]
	at nodomain.freeyourgadget.gadgetbridge.service.ServiceDeviceSupport.onNotification(ServiceDeviceSupport.java:152) ~[na:0.0]
	at nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService.handleAction(DeviceCommunicationService.java:394) ~[na:0.0]
	at nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService.onStartCommand(DeviceCommunicationService.java:347) ~[na:0.0]
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3802) ~[na:0.0]

gadgetbridge.log

Your wearable device is:

Pebble Time FW: v4.3 HW: snowy_dvt

Your android version is:

9 (OxygenOS 9.0.2 from OnePlus)

Your Gadgetbridge version is:

0.31.0

### Your issue is: After updating to 0.31.0 most of the time when a notification is incoming, my Pebble Time disconnects. In the log I can see this exception: ``` 09:01:59.867 [main] ERROR n.f.g.LoggingExceptionHandler - Uncaught exception: Unable to start service nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService@6a6ede0 with Intent { act=nodomain.freeyourgadget.gadgetbridge.devices.action.notification cmp=nodomain.freeyourgadget.gadgetbridge/.service.DeviceCommunicationService (has extras) }: java.nio.BufferOverflowException java.lang.RuntimeException: Unable to start service nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService@6a6ede0 with Intent { act=nodomain.freeyourgadget.gadgetbridge.devices.action.notification cmp=nodomain.freeyourgadget.gadgetbridge/.service.DeviceCommunicationService (has extras) }: java.nio.BufferOverflowException at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3821) ~[na:0.0] at android.app.ActivityThread.access$1800(ActivityThread.java:207) ~[na:0.0] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1779) ~[na:0.0] at android.os.Handler.dispatchMessage(Handler.java:106) ~[na:0.0] at android.os.Looper.loop(Looper.java:193) ~[na:0.0] at android.app.ActivityThread.main(ActivityThread.java:6863) ~[na:0.0] at java.lang.reflect.Method.invoke(Native Method) ~[na:0.0] at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) ~[na:0.0] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) ~[na:0.0] Caused by: java.nio.BufferOverflowException: null at java.nio.Buffer.nextPutIndex(Buffer.java:536) ~[na:0.0] at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:144) ~[na:0.0] at nodomain.freeyourgadget.gadgetbridge.service.devices.pebble.PebbleProtocol.encodeNotification(PebbleProtocol.java:979) ~[na:0.0] at nodomain.freeyourgadget.gadgetbridge.service.devices.pebble.PebbleProtocol.encodeNotification(PebbleProtocol.java:509) ~[na:0.0] at nodomain.freeyourgadget.gadgetbridge.service.serial.AbstractSerialDeviceSupport.onNotification(AbstractSerialDeviceSupport.java:118) ~[na:0.0] at nodomain.freeyourgadget.gadgetbridge.service.devices.pebble.PebbleSupport.onNotification(PebbleSupport.java:187) ~[na:0.0] at nodomain.freeyourgadget.gadgetbridge.service.ServiceDeviceSupport.onNotification(ServiceDeviceSupport.java:152) ~[na:0.0] at nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService.handleAction(DeviceCommunicationService.java:394) ~[na:0.0] at nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService.onStartCommand(DeviceCommunicationService.java:347) ~[na:0.0] at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3802) ~[na:0.0] ``` [gadgetbridge.log](https://github.com/Freeyourgadget/Gadgetbridge/files/2556331/gadgetbridge.log) #### Your wearable device is: Pebble Time FW: v4.3 HW: snowy_dvt #### Your android version is: 9 (OxygenOS 9.0.2 from OnePlus) #### Your Gadgetbridge version is: 0.31.0
evll commented 3 years ago (Migrated from github.com)
Poster
Owner

Reverting to 0.30.0 makes the error go away, so I am staying on the older version for now.

Reverting to 0.30.0 makes the error go away, so I am staying on the older version for now.
Owner

@evll thanks for reporting this issue, it is indeed a race condition.

If you add at least one canned reply (settings -> pebble -> replies) everything should work on 0.31

@evll thanks for reporting this issue, it is indeed a race condition. If you add at least one canned reply (settings -> pebble -> replies) everything should work on 0.31
Collaborator

Thanks for mentioning the work-around, @danielegobetti – that explains why I don't see the issue with my Pebble time (1 canned response configured, though mostly unused). So this is an indirect confirmation the work-around works around 😉

Thanks for mentioning the work-around, @danielegobetti – that explains why I don't see the issue with my Pebble time (1 canned response configured, though mostly unused). So this is an indirect confirmation the work-around works around :wink:
gappleto97 commented 3 years ago (Migrated from github.com)
Owner

Not sure how much it helps, but I have another logfile showing this issue

gadgetbridge.log

I am going to try the workaround now, and will let you know if it does not work.

Not sure how much it helps, but I have another logfile showing this issue [gadgetbridge.log](https://github.com/Freeyourgadget/Gadgetbridge/files/2559218/gadgetbridge.log) I am going to try the workaround now, and will let you know if it does not work.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.