-
Notifications
You must be signed in to change notification settings - Fork 211
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
High resources consumption(?) leading to computer malfunction #1333
Comments
There's not much that can be done about this that hasn't already been done. It was a design choice (and in part a limitation of how the Lua engine is implemented into the mod) to have all computers share the CPU one at a time (or more if the config allows it) with a maximum run of about 10 seconds each turn- if CC didn't have this limitation the bad code you described would have disrupted the tick rate of the entire MC server as more of the server's CPU gets used by bad CC computers. CC already provides tools to server admins to find bad computers such as the one you described, CC's diagnostics/moderating commands allow them to teleport to bad computers. I assume that most admins seeing the turtle contraption and the code would probably recognise the malicious intent and intervene appropriately. |
I do actually think there's more that can be done here. The computer is being force-killed, which suggests our normal measures for stopping the computer aren't kicking in. I did a small amount of profiling here, and we can see that most of the time is split between the call to As the Lua interpreter itself is rarely active (from what I can tell, the function argument to
Footnotes
|
As an aside, I wonder if we could optimise Edit: And done! Fun facts: some JS engines represent repeated strings with a separate object, a bit like we represent concatenation with ropes. I have suppressed the urge to do that. |
Minecraft Version
1.18.x
Version
1.101.2
Details
If you run the code on several computers (two are enough), then all other computers on the server will stop responding and executing commands.
Also, after a while, the computer running code will display the following message:
And will stop responding to the player's actions until it is broken and replaced.
The entire code:
Link to the logs:
https://gist.github.com/sashafiesta/828d207f2e3ddea874663e19c5065777
It can be abused. You can make a turtle that will constantly place and break a computer with a similar code in startup.
So, if the chunk is loaded, all computers on the server will become inoperable
The text was updated successfully, but these errors were encountered: