linuxgurugamer / KCT

Kerbal Construction Time - An addon for Kerbal Space Program
GNU General Public License v3.0
11 stars 15 forks source link

Crash when KCT is loaded and left running without time warp #43

Closed Ernesto-Alvarez closed 4 years ago

Ernesto-Alvarez commented 4 years ago

KSP 1.8.1 with latest stable KCT release crashes if left unattended and running at 1x time for long enough. Behaviour observed on earlier KCT version on KSP 1.7.2 as well.

To replicate, start a new game and leave it alone running at 1x time. Eventually it should suffer a crash and exit to the shell (the session whose logs are included here took 49 minutes clock time to crash). The only mods running were KCT and its dependencies.

The KSP log does not appear to reveal anything useful, but the console output shows the crash and memory maps. Curiously, several copies of the same resource appears to have been mapped to memory, and the crash may be happening because of resource exhaustion due to a memory leak, or mapping of the NULL page after the system refuses to load another copy.

The crash does not occur if the user warps to KCT events (e.g. warps to rocket building completion events). Other mods were checked to see whether they were causing the crash, but the issue was isolated to KCT and dependencies. MagiCore is the only dependency that is not used by other mods. ksp.console.txt KSP.log

linuxgurugamer commented 4 years ago

What scene did you leave it unattended in?

Ernesto-Alvarez commented 4 years ago

I left it open in the space center view.

linuxgurugamer commented 4 years ago

I've seen the issue, no idea what's going on. What I can say is that it seems to happen in most scenes if left unattended for a while, and that changing scenes releases the memory

Ernesto-Alvarez commented 4 years ago

Seems consistent with what I've seen. Maybe I should try running KSP with a memory ulimit in place, to see if I can get the bug to trigger sooner, and also see if I can trigger it without KCT. I'll let you know the results as soon as I complete the test.

linuxgurugamer commented 4 years ago

Ok, thanks. This is one of those edge cases which you almost never see, until it happens.

linuxgurugamer commented 4 years ago

Fixed in latest beta https://github.com/linuxgurugamer/KCT/releases/tag/1.4.7.10