Giter Site home page Giter Site logo

Comments (2)

tsawyer avatar tsawyer commented on September 16, 2024

Looks like the fix has been discovered for this. The sample code below shows a bug which is caused by an operator precedence error (the typedef to "int"). Apparently this code is all over app_rpt and affects all node types. This is not just a chan_voter issue. This will go a long ways towards fixing a major source of long-term instability in app_rpt.

`
#include <stdio.h>

void main()
{
int hours, minutes, seconds;
long long connecttime, connecttime2;
char conntime[64];
int i;

// ORIGINAL CODE:

   printf ("Original Code:\n");

   connecttime2 = 4294967296L / 2 - 5000L;

   for (i = 0; i < 10; i++) {

           connecttime = connecttime2;

           hours = (int) connecttime/3600000;
           connecttime %= 3600000;
           minutes = (int) connecttime/60000;
           connecttime %= 60000;
           seconds = (int)  connecttime/1000;
           connecttime %= 1000;
           snprintf(conntime, 32, "%02d:%02d:%02d.%d", hours, minutes, seconds, (int) connecttime);
           conntime[32] = 0;

           printf ("time = %s\n", conntime);
           connecttime2 += 1000;
   }

// FIXED CODE:

   printf ("\n\nNew Code:\n");

   connecttime2 = 4294967296L / 2 - 5000L;

   for (i = 0; i < 10; i++) {

           connecttime = connecttime2;

           hours =  connecttime/3600000L;
           connecttime %= 3600000L;
           minutes =  connecttime/60000L;
           connecttime %= 60000L;
           seconds =  connecttime/1000L;
           connecttime %= 1000L;
           snprintf(conntime, 32, "%02d:%02d:%02d.%d", hours, minutes, seconds, (int) connecttime);
           conntime[32] = 0;

           printf ("time = %s\n", conntime);
           connecttime2 += 1000L;
   }

}
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////

[root@alarmpi tmp]# ./a.out
Original Code:
time = 596:31:18.648
time = 596:31:19.648
time = 596:31:20.648
time = 596:31:21.648
time = 596:31:22.648
time = -596:31:23.648
time = -596:31:24.648
time = -596:31:25.648
time = -596:31:26.648
time = -596:31:27.648

New Code:
time = 596:31:18.648
time = 596:31:19.648
time = 596:31:20.648
time = 596:31:21.648
time = 596:31:22.648
time = 596:31:23.648
time = 596:31:24.648
time = 596:31:25.648
time = 596:31:26.648
time = 596:31:27.648
`

from asterisk.

tsawyer avatar tsawyer commented on September 16, 2024

Over time we've learned that this is issue impacts more than just RTCM the connect time display. Users with other hardware have reported crashes and disconnects occurring around the 600 hour mark. I've seen it with RTCM hardware because that's all I use. But I sense that any two nodes connected to each other on the same server will crash near the 600 hour mark.

from asterisk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.