Originally posted by **Cweveretts01** April 30, 2024
### Disclaimers
- [X] I have searched the issue tracker to check if the issue has already been reported.
- [ ] My issue happened while using mods.
### What happened?
I am a relatively new player and I have attempted to add labels to help myself to navigate a custom circuit box I have been wiring for a docking hatch assembly in submarine editor. Every time I go to edit one whether to confirm added text or to resize the label itself, after a span of a couple seconds, the game crashes, forcing me to start over. I've attempted to use the labels 3 times before I started purposely reproducing the issue. After playing with the labels by confirming added text and resizing the label, I was able to duplicate the issue 5 more times. I haven't tried to reproduce the problem in Singleplayer or Multiplayer nor have I tried using labels on any other component. I play on SteamDeck which uses SteamOS. Each crash report produced from this issue is near identical as the one submitted below. And the selected content packages mentioned in the report: "Orca+" and "Test," are projects I've been working on, I have no mods installed.
### Reproduction steps
1. Load Submarine Editor
2. Place and open a Circuit Box
3. Right click into the Circuit Box window and add label
4. Play around with editing the label and confirming added text as well as resizing the label
5. Game crashes within 60 seconds of playing with the label
### Bug prevalence
Happens every time I play
### Single player or multiplayer?
Other
### -
Submarine Editor
### Version
v1.4.5.0 (Blood in the Water Update, hotfix 1)
### -
_No response_
### Which operating system did you encounter this bug on?
Linux
### Relevant error messages and crash reports
```shell
Barotrauma Client crash report (generated on 04/29/2024 22:33:02)
Barotrauma seems to have crashed. Sorry for the inconvenience!
78FDF2FF99AC79BB567C8C6E603F3544
Game version 1.4.5.0 (ReleaseLinux, branch release/spring-update-hotfix, revision 5ad6212551)
Graphics mode: 1280x800 (BorderlessWindowed)
VSync ON
Language: English
Selected content packages: Vanilla (E218DD5), Orca+ (EA5CA58), Test (477556D)
Level seed: no level loaded
Loaded submarine: Test (4848C02A448DCD72EE0708C5D2FCE914)
Selected screen: Barotrauma.SubEditorScreen
SteamManager initialized
System info:
Operating system: Unix 6.1.52.16 64 bit
GPU name:
Display mode: {Width:1280 Height:800 Format:Color AspectRatio:1.6}
GPU status: Normal
Exception: Length cannot be less than zero. (Parameter 'length') (System.ArgumentOutOfRangeException)
Target site: System.String Substring(Int32, Int32)
Stack trace:
at System.String.Substring(Int32 startIndex, Int32 length)
at Barotrauma.ToolBox.LimitStringHeight(String str, ScalableFont font, Int32 maxHeight) in \Barotrauma\BarotraumaClient\ClientSource\Utils\ToolBox.cs:line 444
at Barotrauma.CircuitBoxLabelNode.UpdateTextSizes(RectangleF rect) in \Barotrauma\BarotraumaClient\ClientSource\CircuitBox\CircuitBoxLabelNode.cs:line 35
at Barotrauma.CircuitBoxLabelNode.EditText(NetLimitedString header, NetLimitedString body) in \Barotrauma\BarotraumaShared\SharedSource\CircuitBox\CircuitBoxLabelNode.cs:line 43
at Barotrauma.Items.Components.CircuitBox.RenameLabel(CircuitBoxLabelNode label, Color color, NetLimitedString header, NetLimitedString body) in \Barotrauma\BarotraumaClient\ClientSource\Items\Components\Signal\CircuitBox.cs:line 298
at Barotrauma.CircuitBoxLabelNode.<>c__DisplayClass7_0.b__4(GUIButton _, Object _) in \Barotrauma\BarotraumaClient\ClientSource\CircuitBox\CircuitBoxLabelNode.cs:line 112
at Barotrauma.GUIButton.Update(Single deltaTime) in \Barotrauma\BarotraumaClient\ClientSource\GUI\GUIButton.cs:line 263
at Barotrauma.GUI.Update(Single deltaTime) in \Barotrauma\BarotraumaClient\ClientSource\GUI\GUI.cs:line 1211
at Barotrauma.GameMain.Update(GameTime gameTime) in \Barotrauma\BarotraumaClient\ClientSource\GameMain.cs:line 967
at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime) in \Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 656
at Microsoft.Xna.Framework.Game.Tick() in \Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 500
at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop() in \Libraries\MonoGame.Framework\Src\MonoGame.Framework\SDL\SDLGamePlatform.cs:line 93
at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) in \Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 397
at Microsoft.Xna.Framework.Game.Run() in \Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 367
at Barotrauma.Program.Main(String[] args) in \Barotrauma\BarotraumaClient\ClientSource\Program.cs:line 61
Last debug messages:
[04/29/2024 22:29:04] Attempting to open ALC device "Filter Chain Sink"
[04/29/2024 22:29:02] Logged in as *****
```
Discussed in https://github.com/FakeFishGames/Barotrauma/discussions/13905