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

Crash on Awake with Logging and heavy file I/O on Unity 5 and 2017 #7

Open
Lisias opened this issue Oct 8, 2020 · 1 comment
Open
Assignees
Labels
bug Something isn't working not-my-fault I'm innocent on this! :)

Comments

@Lisias
Copy link
Collaborator

Lisias commented Oct 8, 2020

There's an nasty issue when running KSPe's logging on Unity 5 and Unity 2017 (2019 appears to be imunne to the problem).

Apparently, while handling OnAwake unity events, the Stack's deepness is terribly reduced - leading to a blunt crash on MacOS (Windows and Linux status is unknown at this point) on heavy weighted code on this handler.

Disk I/O may or may not be aggravating the problem - I never had faced this before since KSPe inception, but I never overloaded the OnAwake event with disk I/O neither. Take this information with a grain of salt.

This problem was detected while refactoring FMRS /L Unofficial, and the only known work around at this moment is just to avoid KSPe logging on the OnAwake events. Due the unusual complexity of FMRS, it was decided to just deactivate KSPe logging on the Release configuration (allowing it to be reactivated with conditional compiling for Unity 2019, where the problem doesn't happens - so I can further develop the thing on newer KSPs).

THIS IS NOT A BUG ON KSPe. It's a bug on Unity, but since I need to tackle down these things, I'm registering the problem on KSPe.

IMPORTANT

KSPe uses locks to prevent racing conditions while logging multithreaded code. The lock is not involved on the problem for sure, deactivating the lock on a test bed leaded to no improvement on the situation. At worst, the lock mechanism would delay the OnAwake a tiny little bit, and perhaps this could trigger some bug on Unity - and so, the real problem is not (lack of) Stack deepness, and I may had misdiagnosed the cause.

In a way or another, it's another Unity nasty issue to have to cope.

Evidences

No crash dumps on KSP >= 1.8 because the damned thing works there.

@Lisias Lisias self-assigned this Oct 8, 2020
@Lisias Lisias added bug Something isn't working not-my-fault I'm innocent on this! :) labels Oct 8, 2020
@Lisias
Copy link
Collaborator Author

Lisias commented Oct 8, 2020

This will remain open for some time, until I manage time to diagnose with 100% accuracy if Disk I/O is or it's not aggravates the problem.

Lisias referenced this issue Oct 8, 2020
…SPAPIExtensions/issues/7 for better registering (this will be cloned with the repo, the Issue will not).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working not-my-fault I'm innocent on this! :)
Projects
None yet
Development

No branches or pull requests

1 participant