From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 25 19:27:55 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 80A7A16A4DE for ; Tue, 25 Jul 2006 19:27:55 +0000 (UTC) (envelope-from scheidell@secnap.net) Received: from mail.secnap.com (mail.secnap.com [204.89.241.129]) by mx1.FreeBSD.org (Postfix) with ESMTP id 32E2843D53 for ; Tue, 25 Jul 2006 19:27:55 +0000 (GMT) (envelope-from scheidell@secnap.net) Received: from [10.70.3.3] (unknown [10.70.3.3]) by mail.secnap.com (Postfix) with ESMTP id 49923164838; Tue, 25 Jul 2006 15:27:54 -0400 (EDT) Message-ID: <44C670BA.6060608@secnap.net> Date: Tue, 25 Jul 2006 15:27:54 -0400 From: Michael Scheidell Organization: SECNAP Network Security User-Agent: Thunderbird 1.5.0.4 (Macintosh/20060530) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <20060725.093429.-1648696470.imp@bsdimp.com> <44C63DD2.9080705@freebsd.org> <44C6509E.4090708@secnap.net> In-Reply-To: <44C6509E.4090708@secnap.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: FBSD 5.5 and software timers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jul 2006 19:27:55 -0000 Found it! library libc_r Given POC: int main( int argc, char **argv ) { char execs1[256] = "/bin/date +A%Y%m%d%H%M.%S"; char execs2[256] = "/bin/date +B%Y%m%d%H%M.%S"; int a; while ( 1) { system( execs1 ); usleep( 500*1000); system( execs2 ); } return 0; } /* main */ compile with: cc -g -c nanotest.c cc -g -o nanotest nanotest.o everything works as expected. time forward, back, doesn't matter (date prints out wallclock, nanosleep() sleeps 500*1000*1000us (.5 seconds) this breaks it: cc -g -c nanotest.c cc -g -o nanotest nanotest.o -lc_r setting clock back 'hangs' during usleep (500*1000) didn't hang on 5.4. I will be writing up a bug report shortly. -- Michael Scheidell, CTO SECNAP Network Security / www.secnap.com scheidell@secnap.net / 1+561-999-5000, x 1131