Skip to content

--exclude-monotonic broken with clock_nanosleep() and TIMER_ABSTIME #426

Closed
@vcunat

Description

Simple test case:

$ echo -e "import time\ntime.sleep(1)" | faketime --exclude-monotonic -f +1h python3.11
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
OSError: [Errno 22] Invalid argument

What happens is that python calls

clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &timeout_abs, NULL);

and with this setting faketime fumbles, passes a negative time to the kernel syscall, which is how EINVAL happens.

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions