Skip to content
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

[FATAL] Executing someone after forcing them to sleep results in the server being laid in eternal rest #509

Open
M3739 opened this issue Jan 25, 2025 · 1 comment
Labels
Priority: 3-Low Should be resolved at some point

Comments

@M3739
Copy link
Contributor

M3739 commented Jan 25, 2025

Title says all. Mostly. Bug found as of PR #501.

While I was attempting to debug for an unrelated issue, I was messing around as Manti on a map just seeing what it entails and such, and decided to push down a Urist McVulp, force them to sleep, then execute with the psionic knife. This proceeded to cause the client to "halt" rather than freeze, and the server to throw a fatal error. Oddly enough, with the server throwing such an error, the client did not disconnect.

I attempted this again, this time using the captain's sabre and the debug map. While the sabre worked as intended, the psionic knife threw the same fatal error. While I was recording this, thinking it might have been the system not knowing how to handle holy damage, I then discovered it wasn't the psionic knife, nor holy damage, but something else entirely. I do not know enough about the code to figure out exactly why this is happening, but I do know that it is a severe issue that needs correction as soon as possible to ensure nobody can just kill a server on a whim.

So far, after some further testing, I have discovered the following;

  • Bug does not occur when target is on a bed, or already damaged.
  • Sleeping in any other way, either through chems, or the target willfully sleeping, will not trigger the bug.
  • The target MUST be forced to sleep via the interact system, then executed.
  • This bug only occurs when executing another player.
  • This can be done with something as easy to get as a shiv.

Video is through this streamable link.

Fatal error in question;

[FATL] unhandled: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.Collections.Generic.Dictionary`2.Enumerator.MoveNext()
   at Robust.Shared.GameObjects.EntityQueryEnumerator`2.MoveNext(EntityUid& uid, TComp1& comp1, TComp2& comp2) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Shared\GameObjects\EntityManager.Components.cs:line 1801
   at Content.Shared.DoAfter.SharedDoAfterSystem.Update(Single frameTime) in C:\Users\M3739\Documents\GitHub\FS-Yesod\Content.Shared\DoAfter\SharedDoAfterSystem.Update.cs:line 23
   at Robust.Shared.GameObjects.EntitySystemManager.TickUpdate(Single frameTime, Boolean noPredictions) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Shared\GameObjects\EntitySystemManager.cs:line 306
   at Robust.Shared.GameObjects.EntityManager.TickUpdate(Single frameTime, Boolean noPredictions, Histogram histogram) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Shared\GameObjects\EntityManager.cs:line 256
   at Robust.Server.GameObjects.ServerEntityManager.TickUpdate(Single frameTime, Boolean noPredictions, Histogram histogram) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Server\GameObjects\ServerEntityManager.cs:line 195
   at Robust.Server.BaseServer.Update(FrameEventArgs frameEventArgs) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Server\BaseServer.cs:line 729
   at Robust.Server.BaseServer.<SetupMainLoop>b__66_1(Object sender, FrameEventArgs args) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Server\BaseServer.cs:line 542
   at Robust.Shared.Timing.GameLoop.Run() in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Shared\Timing\GameLoop.cs:line 235
   at Robust.Server.BaseServer.MainLoop() in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Server\BaseServer.cs:line 569
   at Robust.Server.Program.ParsedMain(CommandLineArgs args, Boolean contentStart, ServerOptions options) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Server\Program.cs:line 74
   at Robust.Server.Program.Start(String[] args, ServerOptions options, Boolean contentStart) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Server\Program.cs:line 42
   at Robust.Server.ContentStart.Start(String[] args) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Server\ContentStart.cs:line 10
   at Content.Server.Program.Main(String[] args) in C:\Users\M3739\Documents\GitHub\FS-Yesod\Content.Server\Program.cs:line 9
Unhandled exception. System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.Collections.Generic.Dictionary`2.Enumerator.MoveNext()
   at Robust.Shared.GameObjects.EntityQueryEnumerator`2.MoveNext(EntityUid& uid, TComp1& comp1, TComp2& comp2) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Shared\GameObjects\EntityManager.Components.cs:line 1801
   at Content.Shared.DoAfter.SharedDoAfterSystem.Update(Single frameTime) in C:\Users\M3739\Documents\GitHub\FS-Yesod\Content.Shared\DoAfter\SharedDoAfterSystem.Update.cs:line 23
   at Robust.Shared.GameObjects.EntitySystemManager.TickUpdate(Single frameTime, Boolean noPredictions) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Shared\GameObjects\EntitySystemManager.cs:line 306
   at Robust.Shared.GameObjects.EntityManager.TickUpdate(Single frameTime, Boolean noPredictions, Histogram histogram) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Shared\GameObjects\EntityManager.cs:line 256
   at Robust.Server.GameObjects.ServerEntityManager.TickUpdate(Single frameTime, Boolean noPredictions, Histogram histogram) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Server\GameObjects\ServerEntityManager.cs:line 195
   at Robust.Server.BaseServer.Update(FrameEventArgs frameEventArgs) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Server\BaseServer.cs:line 729
   at Robust.Server.BaseServer.<SetupMainLoop>b__66_1(Object sender, FrameEventArgs args) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Server\BaseServer.cs:line 542
   at Robust.Shared.Timing.GameLoop.Run() in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Shared\Timing\GameLoop.cs:line 235
   at Robust.Server.BaseServer.MainLoop() in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Server\BaseServer.cs:line 569
   at Robust.Server.Program.ParsedMain(CommandLineArgs args, Boolean contentStart, ServerOptions options) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Server\Program.cs:line 74
   at Robust.Server.Program.Start(String[] args, ServerOptions options, Boolean contentStart) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Server\Program.cs:line 42
   at Robust.Server.ContentStart.Start(String[] args) in C:\Users\M3739\Documents\GitHub\FS-Yesod\RobustToolbox\Robust.Server\ContentStart.cs:line 10
   at Content.Server.Program.Main(String[] args) in C:\Users\M3739\Documents\GitHub\FS-Yesod\Content.Server\Program.cs:line 9
@Mnemotechnician
Copy link
Collaborator

Mnemotechnician commented Jan 25, 2025

Not relevant to the weapons used or anything like that; this is just one of the many situations in which a system may remove/add a component from/to an entity while it or another system is iterating over an EntityQueryEnumerator of the same component type. This is a non-critical issue as in release builds the exception will be simply caught and logged.

@Mnemotechnician Mnemotechnician added the Priority: 3-Low Should be resolved at some point label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 3-Low Should be resolved at some point
Projects
None yet
Development

No branches or pull requests

2 participants