Closed GoogleCodeExporter closed 9 years ago
On further investigation, syscall_entrypoint.cc's special case for
gettimeofday() only applies to i386. It does not apply to x86-64, and I assume
that is done on the assumption that gettimeofday() is a vsyscall on x86-64
(implemented using RDTSC) and therefore is fast and does not need to be
optimised.
On two Ubuntu Hardy machines I have tested, x86-64 gettimeofday() is a
vsyscall. This means test_debugging passes, because gettimeofday() does not
lead to a recursive call to the syscall handler. When I run the following test
program under strace --
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>
int main() {
while (1) {
write(1, "x\n", 2);
struct timeval tv;
gettimeofday(&tv, NULL);
}
return 0;
}
I get only write() calls:
write(1, "x\n", 2x
) = 2
write(1, "x\n", 2x
) = 2
...
However, gettimeofday() is not always a vsyscall. On the Ubuntu Lucid VM where
test_debugging fails, this test program shows interleaved
write()/gettimeofday() syscalls.
Original comment by mseaborn@chromium.org
on 27 Sep 2010 at 10:14
Fixed in r136, r137.
Original comment by mseaborn@chromium.org
on 17 Oct 2010 at 6:28
Original issue reported on code.google.com by
mseaborn@chromium.org
on 26 Sep 2010 at 12:24