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

Principia crash when decoupling with msg Check failed: 0 <= r (0 vs. -1) #2530

Closed
Haukifile opened this issue Apr 16, 2020 · 3 comments · Fixed by #2532
Closed

Principia crash when decoupling with msg Check failed: 0 <= r (0 vs. -1) #2530

Haukifile opened this issue Apr 16, 2020 · 3 comments · Fixed by #2532
Labels

Comments

@Haukifile
Copy link

Principia crashes when decoupling stages with the error msg
F0416 09:50:26.346088 16408 r3x3_matrix_body.hpp:165] Check failed: 0 <= r (0 vs. -1)

Can consistently reproduce at least with a specific craft & save seen in the following log & journal, crash happens when decoupling the procedural decoupler between probe and srb when in orbit.

Journal: https://drive.google.com/open?id=1fhb668grAGekEyhmW4-T2FnsGMoV53nf
INFO: https://drive.google.com/open?id=1fcwF47ejb8JsJX2wbC7j91g0xwwagIkw

@pleroy
Copy link
Member

pleroy commented Apr 16, 2020

The last journal entry before the crash is:

[principia.journal.serialization.PartSetApparentRigidMotion.extension] {
  in {
    plugin: 2899402431696
    part_id: 2350522348
    degrees_of_freedom {
      q {
        x: nan
        y: nan
        z: nan
      }
      p {
        x: nan
        y: nan
        z: nan
      }
    }
    main_body_degrees_of_freedom {
      q {
        x: -4533762.8987421319
        y: -3011401.27039351
        z: -3665279.0871975129
      }
      p {
        x: 6054.9357181604155
        y: 1130.1647371610547
        z: -9263.44110425117
      }
    }
    rotation {
      w: -0.67719215154647827
      x: -0.68071693181991577
      y: 0.12479065358638763
      z: -0.24992519617080688
    }
    angular_velocity {
      x: nan
      y: nan
      z: nan
    }
  }
}

The NaNs in the positions and angular velocity propagate to the angular momentum and the inertia tensor, and the pivoting fails.

I see KSP giving us NaNs in a number of calls to InsertOrKeepLoadedPart , PartApplyIntrinsicForce, and PartSetApparentRigidMotion for two vessels. I have evidence that we are not the source of these NaNs. In particular the values returned by PartGetActualDegreesOfFreedom are clean. I am going to assume that all these NaNs are because some parts are in the process of being destroyed.

@pleroy
Copy link
Member

pleroy commented Apr 16, 2020

@Haukifile: I have tried to fix this bug in #2532, but I cannot be sure because the fix is in the C# side of the code and the journal only replays the C++ side. I see that you have your own binary, so if you feel like rebuilding from master and letting me know what happens, that would be great.

@DRVeyl
Copy link

DRVeyl commented May 1, 2020

Likely related: KSP-RO/ProceduralParts@fe1cf8a

This would crash KSP in a stock environment. Generalized cause is any ModuleDecouple that has ejectionForce = NaN.

Sorry, something went wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants