Flic Home

    Community

    • Login
    • Search
    • Popular
    • Users
    1. Home
    2. peter.kueffner
    3. Posts
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 3
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by peter.kueffner

    • RE: Flic Hub firmware bug causes crash after sending 36 UDP packets.

      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?

      posted in Developers
      peter.kueffner
      peter.kueffner
    • RE: Flic Hub firmware bug causes crash after sending 36 UDP packets.

      Hi @Emil, is there any progress on the issue?

      posted in Developers
      peter.kueffner
      peter.kueffner
    • 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?

      posted in Developers
      peter.kueffner
      peter.kueffner