[ARGUS] tv_nsec potentially invalid value

Carter Bullard carter at qosient.com
Mon Nov 25 22:26:33 EST 2024


Yes !!!  We fixed this in 5.0.2 which was released last week ... should be there ...
Carter


> On Nov 25, 2024, at 9:56 PM, Ming Fu via Argus-info <argus-info at lists.andrew.cmu.edu> wrote:
> 
> Hi,
> 
> I noticed a few argus 5.0.0 unexpected stops. Very hard to reproduce, but I think the problem is here:
> 
> https://github.com/openargus/argus/blob/main/argus/ArgusSource.c#L4856
> 
>         tts->tv_sec  = tvp->tv_sec + 0;
>         tts->tv_nsec = (tvp->tv_usec * 1000) + 250000000;
>         if (tts->tv_nsec > 1000000000) {
>            tts->tv_sec++;
>            tts->tv_nsec -= 1000000000;
>         }
>         if ((retn = pthread_cond_timedwait(&stask->cond, &stask->lock, tts))) {
>         ....
> 
> The error log is:
> argus-rt[2591]: ArgusSourceProcess: pthread_cond_timedwait() error EINVAL
> 
> The compare at line 4856 should be         
>         if (tts->tv_nsec >= 1000000000) {
> 
> 1000000000 is an invalid nsec number.
> 
> Regards,
> Ming


More information about the argus mailing list