Flic Hub firmware bug causes crash after sending 36 UDP packets.
-
I was developing a module on the Flic Hub using the Flic Hub SDK. The module sends out all button presses as UDP messages.
While working on the module, I noticed a strange bug, which I assume is a firmware issue - when sending the 36th UDP message, the module crashes with a
FATAL ERROR: uncaught: 'cannot push beyond allocated stack'
I made a minimal module that will reproduce the bug consistently:
var dgram = require("dgram"); function SendJSON(data) { try { udp = dgram.createSocket("udp4"); udp.send(data, 32768, "127.0.0.1", function(err) { console.log("UDP sent. Return: " + err); udp.close(); }); } catch(e) { console.log("Error sending button state!"); } }; var i = 0; var myInt = setInterval(function() { i ++; console.log("Sending packet " + i); SendJSON("" + i + " "); }, 100);
Flic Hub SDK Console output:
Sending packet 1 UDP sent. Return: null Sending packet 2 UDP sent. Return: null Sending packet 3 UDP sent. Return: null [...] Sending packet 34 UDP sent. Return: null Sending packet 35 UDP sent. Return: null Sending packet 36 FATAL ERROR: uncaught: 'cannot push beyond allocated stack'
I consider this a firmware bug because of the following reasons:
- the "fatal error" is not catched by the try-catch block
- the module is still considered "running" even after the crash (the SDK's "play" button stays in "can be stopped" state)
Is there any solution to this?
-
@Emil I'm having the same problem, with the original Hub on version 3.0.12. How do I get the fix? Workaround at the moment is to make the module crash every 10 seconds and enable restart on crash. If I would get over the limit before crashing myself, the bug is triggered and it will fail without restarting.
-
Thanks a lot! I will make sure to try the fix when the firmware update comes out.
Are there any plans to when this will happen?
And is there any way to get a notification for new firmware updates? -
@peter-kueffner The issue has been fixed and the fix will be included in the next firmware update.
-
Hi @Emil, is there any progress on the issue?
-
Thanks for the report. We will take a look. It seems like a bug in the hub sdk.