misc/128714: gmtime infinty loop

Vladimir Timfeev vovkasm at gmail.com
Sat Nov 8 18:00:09 PST 2008


>Number:         128714
>Category:       misc
>Synopsis:       gmtime infinty loop
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 09 02:00:08 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Vladimir Timfeev
>Release:        6.2
>Organization:
>Environment:
FreeBSD zoo.rambler.ru 6.2-RELEASE-p1 FreeBSD 6.2-RELEASE-p1 #1: Thu Feb 15 17:00:27 MSK 2007     root at zoo.rambler.ru:/usr/obj/usr/src/sys/ZOO  amd64
>Description:
On amd64 platforms (tested with 6.2 and 7.0).
gmtime from libc doesn't returns to program if called with arg < -33884019326476800
May be we should return NULL?
>How-To-Repeat:
Simple program to test... first call return, second - loop forever...

#include <time.h>
#include <stdio.h>

void test(time_t t) {
    struct tm *date;
    printf("try %ld\n",t);
    date = gmtime(&t);
    printf(" ok\n");
}

int main(void) {
    time_t time_ok = -33884019326476800LL;
    time_t time_err = -33884019326476801LL;
    test(time_ok);
    test(time_err);
    return 0;
}
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list