[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#594742: marked as done (linux-2.6: clock_gettime not monotonic)

Your message dated Wed, 01 Sep 2010 20:34:23 +0100
with message-id <1283369663.5323.276.camel@localhost>
and subject line Re: Bug#594742: Fixed!
has caused the Debian Bug report #594742,
regarding linux-2.6: clock_gettime not monotonic
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org

594742: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594742
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libc6
Version: 2.11.2-2
Severity: normal

This program:

#include <time.h>
#include <assert.h>
#include <stdio.h>
int main()
	struct timespec last_time, current_time;
	int r;
	clockid_t id;
	assert(clock_gettime(CLOCK_MONOTONIC, &last_time) == 0);
	r = clock_getcpuclockid(0, &id);
	printf("r: %d, id: %d\n", r, id);
	while (1) {
		assert(clock_gettime(CLOCK_MONOTONIC, &current_time) == 0);
		assert(current_time.tv_sec >= last_time.tv_sec);
		assert((current_time.tv_sec > last_time.tv_sec) ||
				(current_time.tv_nsec >= last_time.tv_nsec));
		last_time = current_time;

when run:

$ gcc -std=gnu99 -lrt monotonic2.c && ./a.out
r: 0, id: -6
a.out: monotonic2.c:16: main: Assertion `(current_time.tv_sec > last_time.tv_sec) || (current_time.tv_nsec >= last_time.tv_nsec)' failed.

Shouldn't trigger an assert... The function guarantees monotonic time
increments, but apparently that promise is broken here. I am running
this on an SMP system, but the output of clock_getcpuclockid(0) is not
ENOENT, so it should really be monotonic...

The CPU is an Intel Q9450.

Credits of test program: Wouter Vermaelen.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libc6 depends on:
ii  libc-bin                      2.11.2-2   Embedded GNU C Library: Binaries
ii  libgcc1                       1:4.4.4-8  GCC support library

libc6 recommends no packages.

Versions of packages libc6 suggests:
ii  debconf [debconf-2.0]         1.5.35     Debian configuration management sy
pn  glibc-doc                     <none>     (no description available)
ii  locales                       2.11.2-2   Embedded GNU C Library: National L

-- debconf information:
* glibc/upgrade: true
* glibc/restart-services: gdm openbsd-inetd exim4 cups cron atd

--- End Message ---
--- Begin Message ---
Version: 2.6.32-21

On Wed, 2010-09-01 at 20:25 +0200, Manuel Bilderbeek wrote:
> Hi,
> Thanks Ben, updating to that version of the kernel package in unstable 
> indeed fixes the problem! :)
> At least, I haven't been able to trigger it anymore, but I only tested 
> for a short time.
> If I see it happening again, I'll report back, of course.

OK, closing the bug.


Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.

Attachment: signature.asc
Description: This is a digitally signed message part

--- End Message ---

Reply to: