-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clock_settime/clock_settime_8-1: failed occasionally #926
Comments
Looking at the test code, there are several things that can cause the difference. First of all it completely ignores tv_nsec fields of the timespec structure, so if we are unlucky we may end up with tsT0 where tv_nsec is really close to 1 second and the same for tsend.tv_sec, the rounding errors may accumulate in a wrong way and cause the test failure. We do have a |
@metan-ucw see #927 And the output in VM is:
|
That looks suspicious, the difference is either almost exactly 5 or 3 seconds. That looks like somehow the realtime clock wasn't adjusted during the time the child slept in |
I used strace output in the host machine:
strace output in the VM:
|
I do not think that this is a significant, that probably just means that the order in which child/parent code is executed is different (the order of parent/child process execution is not guaranteed at all), but in the end they should synchronize just fine due to to the sleep calls, or at least it should be extremly unlikely that the order would end up being wrong. I do not think that there is anything wrong in the strace. However I got an idea what we can try, looking at the strace I did realize that the clock_gettime() calls are VDSO. I wonder if forcing it to be a syscall (with the syscall() libc wrapper) would fix the issue. |
I simply replace I doubt that
|
@metan-ucw I tried to add some modules which the host machine loaded into the VM. But still failed. Do you have any new idea? |
I build a new rootfs with the 20200515 tag. And the case pass in lava now. So I close this issue. |
I am running ltp-timer test in lava. I found that the clock_settime test case failed occasionally.
For example, this is a test log from kernelci.org: https://storage.kernelci.org/rt-stable/v5.15-rt/v5.15.25-rt33/arm/multi_v7_defconfig+preempt_rt/gcc-10/lab-collabora/ltp-timers-rk3288-veyron-jaq.txt
I run the test case in my qemu VM:
kernel version: 5.15
qemu version: QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.19)
rootfs: https://storage.kernelci.org/images/rootfs/debian/bullseye-ltp/20220311.1/amd64/rootfs.cpio.gz
ltp version: 20180515, f2ba2a1
I started the qemu VM as below:
I think I reproduce the same problem in #478
I have run
in the qemu VM. It passed sometimes. I added some
printf
in it.The text was updated successfully, but these errors were encountered: