Project

General

Profile

Bug #19361

Calling CommNet.CommNetVessel.InPlasma causes a StackOverflow

Added by PiezPiedPy over 6 years ago. Updated over 3 years ago.

Status:
Ready to Test
Severity:
Low
Assignee:
-
Category:
Plugins/Add-Ons
Target version:
Start date:
07/05/2018
% Done:

80%

Version:
Platform:
Windows
Expansion:
Core Game, Making History
Language:
English (US)
Mod Related:
No
Votes:
Arrow u r green
Arrow d r red

Description

While I was updating the Kerbalism mod to detect signal loss when in a plasma blackout I came across this bug.
I was calling CommNet.CommNetVessel.InPlasma in C# with just a simple if statement and it caused a StackOverflowException

else if (v.connection.InPlasma) // calling InPlasma causes a StackOverflow :(

v is a reference to a Vessel Class and all access to v.connection works as expected.

C# code snippet below from Kerbalism/src/Comms/ConnectionInfo.cs Note. using reflection to access the private field inPlasma returns the correct value.
https://github.com/steamp0rt/Kerbalism/blob/78db5a5b7dfbec752e7a316843e9974e39e76e42/src/Comms/ConnectionInfo.cs#L155-L162

Log output is:
[EXC 12:26:21.322] StackOverflowException: The requested operation caused a stack overflow. CommNet.CommNetVessel.get_InPlasma ()

with none of the usual debug info like the filename and line number etc you usually get with exceptions.
I suspect this is an error in KSP's code.

History

#2 Updated by diomedea over 6 years ago

  • Status changed from New to Being Worked On
  • % Done changed from 0 to 30

#3 Updated by victorr over 3 years ago

  • Status changed from Being Worked On to Ready to Test
  • Target version set to 1.12.0
  • % Done changed from 30 to 80

We have made some changes in this last 1.12.0 release and would like some feedback on this issue. Thanks.

Also available in: Atom PDF