-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update safe_sleep.sh for bug when scheduler is paused for more than 1 second #3157
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
Conversation
fixed a rare condition where the comparison may not be made within the second and then this will loop forever (or at least until a rollover of SECONDS) ;-)
I assume you mean "rare" as in, "not finished cooking" because it happens all the damn time |
|
Is looping infinitely really an effective sleep? |
|
Why are they not using the |
|
Why does a complete amateur work on code used by so many? Not that I use it, but this is just retarded. |
|
I would suggest to just use Or better, just drop a |
|
Came from "primeagen" content, holys**t it's real??? |
|
“A remarkable demonstration of how far one can stretch the boundaries of conventional engineering wisdom.” |
|
Ironically named "safe_sleep.sh" 😭 Technically, I guess it is safer to simply not run your code at all. |
|
Sadly, this is now vulnerable to code-injection (see SC issue), because
|
|
@Rudxain nice catch, I tested it on my end, and it actually allows for RCE But as far as I see, |
read -t $1No external program needed |
|
Doesn't this still take up an entire core of a CPU? Is this malicious code designed to waste as much processor compute time? Isn't this running this comparison billions of times a second? As other people pointed out in this thread, why not use sleep or other alternatives? |
Not billions - bash is not that fast, but probably millions.
This is a reasonable question. They previously had code that checked for programs like |
|
put me in the screenshot |
|
Under what circumstance is |

fixed a rare condition where the comparison may not be made within the second and then this will loop forever (or at least until a rollover of SECONDS) ;-)
sleep was replaced in #1707
But if safe_sleep.sh is running when a vm is suspended it will not do the comparison within the second and therefore loops forever when the vm is resumed.