graphene icon indicating copy to clipboard operation
graphene copied to clipboard

[LibOS] setitimer() emulation is incorrect

Open dimakuv opened this issue 6 years ago • 1 comments

shim_do_setitimer() is incorrect: it only sets the timer for the first interval but never resets the timer to the specified interval. (The idea of this syscall is to set a periodic timer, which triggers SIGALRM/SIGVTALRM/SIGPROF after each time interval.)

Moreover, it registers an internal LibOS callback signal_itimer() which doesn't forward the signal to the app. In effect, this syscall is ignored by Graphene.

dimakuv avatar Jun 14 '19 01:06 dimakuv

This is still valid for the latest master: https://github.com/oscarlab/graphene/blob/af2f7809b36945382a535f95c2af7a2b32a2059a/LibOS/shim/src/sys/shim_alarm.c#L98

However, we haven't encountered any real-world applications that rely on this. So the priority is low.

dimakuv avatar Jul 14 '21 13:07 dimakuv