settimeofday function taking 24 - 30 minutes to complete
Mark Kirkwood
markir at paradise.net.nz
Tue Dec 19 15:55:15 PST 2006
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
More information about the freebsd-current
mailing list