ServerMod / MultiAdmin

SCP: Secret Labratory Server modification to support different configs per instance plus a whole lot of other features

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WritePart also seems to require an exception like #138

PatPeter opened this issue · comments

I received this error and it caused all of my servers to crash... again. It seems that there's a missing exception handler in the WritePart method. I need to go to sleep so I'll look into this tomorrow.

Unhandled Exception:
System.ArgumentOutOfRangeException: Value must be positive and below the buffer height.
Parameter name: top
  at System.TermInfoDriver.SetCursorPosition (Int32 left, Int32 top) <0x7f2385673be0 + 0x00274> in <filename unknown>:0
  at System.TermInfoDriver.set_CursorTop (Int32 value) <0x7f23856722f0 + 0x0003b> in <filename unknown>:0
  at System.ConsoleDriver.set_CursorTop (Int32 value) <0x7f238565d030 + 0x0003b> in <filename unknown>:0
  at System.Console.set_CursorTop (Int32 value) <0x7f238565c250 + 0x0000c> in <filename unknown>:0
  at MultiAdmin.MultiAdmin.Server.WritePart (System.String part, ConsoleColor color, Int32 height, Boolean date, Boolean lineEnd) <0x40e9b210 + 0x0029b> in <filename unknown>:0
  at MultiAdmin.OutputThread.Read (MultiAdmin.MultiAdmin.Server server) <0x40e95bb0 + 0x00d7f> in <filename unknown>:0
  at MultiAdmin.MultiAdmin.Server.<.ctor>b__55_1 () <0x40e93cb0 + 0x0000f> in <filename unknown>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) <0x7f23854ac010 + 0x00099> in <filename unknown>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x7f23854aa850 + 0x0016e> in <filename unknown>:0
cutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x7f23854aa820 + 0x00020> in <filename unknown>:0

This appears to be fixed?

I think the cause for this bug is different than #138, and I still get it occasionally but it doesn't crash the server. Let me look into it this weekend.

It's baaaaaaack.

Unhandled Exception:
System.ArgumentOutOfRangeException: Value must be positive and below the buffer height.
Parameter name: top
  at System.TermInfoDriver.SetCursorPosition (System.Int32 left, System.Int32 top) [0x0004d] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.TermInfoDriver.set_CursorTop (System.Int32 value) [0x00018] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.ConsoleDriver.set_CursorTop (System.Int32 value) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Console.set_CursorTop (System.Int32 value) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at MultiAdmin.MultiAdmin.Server.WritePart (System.String part, System.ConsoleColor backgroundColor, System.ConsoleColor textColor, System.Int32 height, System.Boolean date, System.Boolean lineEnd) [0x00086] in <906130ae85cf476d81a8b19d405b5d63>:0
  at MultiAdmin.OutputThread.Read (MultiAdmin.MultiAdmin.Server server) [0x0041e] in <906130ae85cf476d81a8b19d405b5d63>:0
  at MultiAdmin.MultiAdmin.Server.<.ctor>b__59_1 () [0x00000] in <906130ae85cf476d81a8b19d405b5d63>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentOutOfRangeException: Value must be positive and below the buffer height.
Parameter name: top
  at System.TermInfoDriver.SetCursorPosition (System.Int32 left, System.Int32 top) [0x0004d] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.TermInfoDriver.set_CursorTop (System.Int32 value) [0x00018] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.ConsoleDriver.set_CursorTop (System.Int32 value) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Console.set_CursorTop (System.Int32 value) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at MultiAdmin.MultiAdmin.Server.WritePart (System.String part, System.ConsoleColor backgroundColor, System.ConsoleColor textColor, System.Int32 height, System.Boolean date, System.Boolean lineEnd) [0x00086] in <906130ae85cf476d81a8b19d405b5d63>:0
  at MultiAdmin.OutputThread.Read (MultiAdmin.MultiAdmin.Server server) [0x0041e] in <906130ae85cf476d81a8b19d405b5d63>:0
  at MultiAdmin.MultiAdmin.Server.<.ctor>b__59_1 () [0x00000] in <906130ae85cf476d81a8b19d405b5d63>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
Press Enter to stop the server...
[libsteam] SCP has run 2 time(s).

UPDATE: I think I found out what causes this!!! It seems to be if the server output is being views in PuTTY or another terminal, the terminal is resized, then next output will cause the server to crash.

Still occurs when text is typed into the console occasionally:

System.ArgumentOutOfRangeException: Value must be positive and below the buffer height.
Parameter name: top
  at System.TermInfoDriver.SetCursorPosition (System.Int32 left, System.Int32 top) [0x0004d] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.ConsoleDriver.SetCursorPosition (System.Int32 left, System.Int32 top) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Console.SetCursorPosition (System.Int32 left, System.Int32 top) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at MultiAdmin.MultiAdmin.InputThread.Write (MultiAdmin.MultiAdmin.Server server) [0x00040] in <bbb11ca17cb9463383a3c777d3dd6ef4>:0
  at MultiAdmin.MultiAdmin.Server.<.ctor>b__60_0 () [0x00000] in <bbb11ca17cb9463383a3c777d3dd6ef4>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentOutOfRangeException: Value must be positive and below the buffer height.
Parameter name: top
  at System.TermInfoDriver.SetCursorPosition (System.Int32 left, System.Int32 top) [0x0004d] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.ConsoleDriver.SetCursorPosition (System.Int32 left, System.Int32 top) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Console.SetCursorPosition (System.Int32 left, System.Int32 top) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at MultiAdmin.MultiAdmin.InputThread.Write (MultiAdmin.MultiAdmin.Server server) [0x00040] in <bbb11ca17cb9463383a3c777d3dd6ef4>:0
  at MultiAdmin.MultiAdmin.Server.<.ctor>b__60_0 () [0x00000] in <bbb11ca17cb9463383a3c777d3dd6ef4>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
Press Enter to stop the server...```

Old issue, I haven't been able to reproduce this, please re-open if it is still an issue