From owner-freebsd-current@FreeBSD.ORG Tue Dec 19 23:55:15 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4B0316A417 for ; Tue, 19 Dec 2006 23:55:15 +0000 (UTC) (envelope-from markir@paradise.net.nz) Received: from smtp5.clear.net.nz (smtp5.clear.net.nz [203.97.33.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 35CE243C9F for ; Tue, 19 Dec 2006 23:55:14 +0000 (GMT) (envelope-from markir@paradise.net.nz) Received: from [192.168.1.11] (121-72-71-65.dsl.telstraclear.net [121.72.71.65]) by smtp5.clear.net.nz (CLEAR Net Mail) with ESMTP id <0JAJ009VSOEY4720@smtp5.clear.net.nz> for freebsd-current@freebsd.org; Wed, 20 Dec 2006 12:40:11 +1300 (NZDT) Date: Wed, 20 Dec 2006 12:40:07 +1300 From: Mark Kirkwood In-reply-to: <458843B8.1060704@u.washington.edu> To: Garrett Cooper Message-id: <45887857.903@paradise.net.nz> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit References: <790a9fff0612190915va75678at895efa0bc93ac3a1@mail.gmail.com> <458843B8.1060704@u.washington.edu> User-Agent: Thunderbird 1.5.0.8 (X11/20061129) Cc: freebsd-current@freebsd.org Subject: Re: settimeofday function taking 24 - 30 minutes to complete X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2006 23:55:15 -0000 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 #include 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