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
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 09 02:00:08 UTC 2008
>Originator:     Vladimir Timfeev
>Release:        6.2
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
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?
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;
    return 0;


More information about the freebsd-bugs mailing list