lholden / job_scheduler

A simple cron-like job scheduling library for Rust.
Apache License 2.0
199 stars 34 forks source link

Date change can lead to high CPU usage, program crashes, and system instability. #12

Closed jordanmack closed 5 years ago

jordanmack commented 5 years ago

When the date is changed from the current date to a future date, bad things can happen. This is related to the potential reetrancy issue mentioned (#5 & #8). In my case, I was spawning a new thread on each call, which caused a fork bomb.

I discovered this when I paused a virtual machine for a few days. Unpausing would cause 100% CPU usage and the VM would become unstable. After narrowing down the issue I tried just changing the date to one in the future, and sure enough, the issue popped up again. This could also occur if the system sleeps for a period of time, then wakes up.