Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Dec 2006 12:40:07 +1300
From:      Mark Kirkwood <markir@paradise.net.nz>
To:        Garrett Cooper <youshi10@u.washington.edu>
Cc:        freebsd-current@freebsd.org
Subject:   Re: settimeofday function taking 24 - 30 minutes to complete
Message-ID:  <45887857.903@paradise.net.nz>
In-Reply-To: <458843B8.1060704@u.washington.edu>
References:  <790a9fff0612190915va75678at895efa0bc93ac3a1@mail.gmail.com> <458843B8.1060704@u.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Cooper wrote:
> Scot Hetzel wrote:
>> While working on implementing the settimeofday function in the
>> linuxolator, I was using the LTP testcase settimeofday01 to test it.
>> Running this test caused the system to hang for 24-30 minutes.
>>
>> I then decided to rewrite the testcase so that it would run on
>> FreeBSD, and it also hung the system for 24-30 minutes.  What the
>> settimeofday01 test was doing is to set the time to a known value (100
>> sec, 100 usec) and then use gettimeofday to retrieve the current time.
>> It then compared the returned value to check if it was within +/- 500
>> msec.
>>
>> I have since reduced the testcode down to the following testcase that
>> is causing the hang.
>>
>> Any ideals as to what could be causing this hang?

Just tried out this on 6-STABLE (FreeBSD 6.2-PRERELEASE #7: Mon Nov 27 
19:32:33 NZDT 2006). I added

#include <stdio.h>
#include <stdlib.h>

to get rid of the obvious warnings (and called the beast settimetest.c). 
However I still get warnings you might want to look at:

# gcc -Wall -O2 -o settimetest settimetest.c
settimetest.c: In function `main':
settimetest.c:24: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
settimetest.c:37: warning: int format, long int arg (arg 2)
settimetest.c:46: warning: int format, long int arg (arg 3)
settimetest.c:46: warning: int format, suseconds_t arg (arg 4)
settimetest.c:14: warning: unused variable `delta'

I can't get the hang at all (with or without thee extra includes):

# time ./settimetest
INFO: Saved current time
INFO: settimeofday completed sucessfully
INFO: Reset time to original value
0.000u 0.002s 0:00.00 0.0%      0+0k 0+0io 0pf+0w

Cheers

Mark



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45887857.903>