Giter Club home page Giter Club logo

Comments (8)

Lisias avatar Lisias commented on June 7, 2024

Quoting myself from Forum, just in case:

Well… That was a weird one, and one that got me worried for a couple days (and, so, I screwed up the scheduling).

Right now, A+ needs Firespitter on some of the parts. Yes, I know that there're replacements, but I would need to ask the user to install more than one add'ons to do the FS job - and yet, it will not be good enough (I know what I'm talking, replacing Firespitter on KAX wans't satisfactory). But most people forget to install dependencies anyway, and so I shove on every add'on of mine a WatchDog that barks on you everytime you fire up KSP missing dependencies my add'ons need, and while coding it into A+ I got this weird message on my KSP.log:

[ERR 12:27:47.935] Exception handling event onGameSceneSwitchRequested in class Startup:System.NullReferenceException: Object reference not set to an instance of an object
  at AirplanePlus.MonkeyPatching.Execute () [0x00000] in <filename unknown>:0
  at AirplanePlus.Startup.OnGameSceneSwitchRequested (FromToAction`2 data) [0x00000] in <filename unknown>:0
  at EventData`1[GameEvents+FromToAction`2[GameScenes,GameScenes]].Fire (FromToAction`2 data) [0x00000] in <filename unknown>:0

[EXC 12:27:47.941] NullReferenceException: Object reference not set to an instance of an object
        AirplanePlus.MonkeyPatching.Execute ()
        AirplanePlus.Startup.OnGameSceneSwitchRequested (FromToAction`2 data)
        EventData`1[GameEvents+FromToAction`2[GameScenes,GameScenes]].Fire (FromToAction`2 data)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        KSPe.Util.Log.UnityLogDecorator:UnityEngine.ILogHandler.LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        UnityEngine.Debug:LogException(Exception)
        EventData`1:Fire(FromToAction`2)
        HighLogic:SetLoadSceneEventsAndFlags(GameScenes, Boolean)
        HighLogic:LoadScene(GameScenes)
        <SetupSystem>c__Iterator0:MoveNext()
        UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
[LOG 12:27:47.942] [HighLogic]: =========================== Scene Change : From LOADING to MAINMENU =====================

The Exception was not raised from my code, and the testbed I was using was a pretty clean one, nothing but my supporting add'ons (KSPe, my fork of MM, and some utils). And I know all that code I forked or created, I inspected them (or wrote them from scratch), and there's no MonkeyPatching class/method/string anywhere on my repositories.

So this stunt appears to be coming from KSP itself. I reproduced it down to KSP 1.3.1, by the way. Yep, this is lingering with us for a very long time.

So I had something injecting code into AirplanePlus' WatchDog and causing it to bork. How I would release it this way? So I spent the weekend trying to locate it, understanding it and then trying a workaround for it (without breaking some Forum rules about modding, what's a bit of a challenge). And then the damned thing vanished!

A bit after 31th Oct 00:00 AM (don't remember if 00:40 or 1:40 or something like that), the problem ceased to happen out of the blue. Right now I'm guessing (and guessing wildly) that this may be related to some Easter Egg code that was never finished and was forgotten on the codebase. But, again, this is a wild guess because I don't really have the slightest clue about why in the Name of the Krakens this krap fell on me on the last weekend.

from ksp-recall.

Lisias avatar Lisias commented on June 7, 2024

AHA!!!! I finally have positive and undeniable evidence that KSP is being Monkey Patched by our backs!! *

I'm not mad about the "feature" implemented, it appears to be good - but, hell, we need to be warned about the changes, damnit!!!. Silently patching things is what malware does, by God's sake!!

https://www.reddit.com/r/KerbalAcademy/comments/16wwkxm/ksp1_saves_are_incompatible_after_reinstalling/

* EDIT: can't affirm that, unfortunately. After thinking on the problem, I concluded I may be biased due that traumatic event that initiated this Report. I can't prove that this is not a feature that I never stomped over yet by pure luck.

from ksp-recall.

Lisias avatar Lisias commented on June 7, 2024

I used KDIFF3 on the affected KSP (1.4.3, by the way - they are Monkey Patching everything) with an old backup to see if the patching is being persisted on disk.

Apparently, they are not - the thing apparently is being downloaded and applied on every KSP boot.

This suggests we can block it using firewalls.

from ksp-recall.

Lisias avatar Lisias commented on June 7, 2024

I transferred this to KSP-Recall, as now I have undeniable evidence this is something related to KSP itself. This doesn't means I will tackle this down on KSP-Recall (or that I ever will try), but KSP-Recall is the place where I'm consolidating KSP (mis)behaviours for future reference.

from ksp-recall.

Lisias avatar Lisias commented on June 7, 2024

NOTE

After thinking about, I concluded that no, this is not a hard evidence of Monkey Patching after all. It may be something on KSP that I never had seen before: Absence of evidence is not evidence of absence, in order to make such bold affirmation I would had to had screwed up an savegame in the exact way I did to check this user's report before, but I don't recall doing it before and, so, I don't have how to know if this is something that was always there or not.

To be more specific, I'm talking about this message:

Screen Shot 2023-10-01 at 19 04 18

Screen Shot 2023-10-01 at 19 04 28

It's happening while trying to open a savegame that by some reason throws up an Exception while being inspected - apparently, it's just it, KSP tries to open the data file, gets an Exception (any one, by any reason) and stupidly concludes "it's not compatible" and shows the message.

The user that reported the problem coming back today telling that his problem just vanished without they knowing how is still an evidence that suggests Monkey Patching, but it's not a positive and undeniable evidence about the message being something new, or even something else being patched on their rig (besides the suggestion being strong enough, see the next paragraph):

On the other hand, this TweakScale issue is:

And now I have evidences that Module Manager (Forum) is not yelling anymore when a Reflection Exception is detected on loading, allowing users to load KSP when TweakScale was prevented from being loaded due the bug on the KSP's Assembly Loader/Resolver that happens when something else borks on loading a dependency.

Hell. This is the KSP.log of a test session made on KSP 1.8.1 with (Forum) Module Manager 4.1.2 on the same circumstances. This was the very first Module Manager to yell (besides diagnosing it incorrectly) about it. KSP.log

There's something smelling here, but there's nothing I can do about it. Past Evidences. Mirror Page 1, Page 2.

TweakScale/TweakScale#312

— — EDIT — —

The TweakScale#312 was finally diagnosed, and it's completely unrelated to this one.

from ksp-recall.

Lisias avatar Lisias commented on June 7, 2024

Note to future readers: on Oct 1, I mentioned:

After thinking about, I concluded that no, this is not a hard evidence of Monkey Patching after all.

This DOES NOT RULES OUT Monkey Patching (look on the damned log, damnit - the words MonkeyPatching is explicitly mentioned on the stack dump!).

This only means that I can't use this evidence as a HARD EVIDENCE (i.e., undeniable evidence or proof) of Monkey Patching because correlation is not causality:

  • I can't affirm from where came the code that was monkey patched
  • I can't affirm if the code is really a Monkey Patch just because it was called this way

So, this is not a proof - but it's still an evidence that should be used together other evidences that, so, may be used to conclude if we have or not Monkey Patching being downloaded from Kraken knows where by our backs.

See TweakScale/TweakScale#312, in special, TweakScale/TweakScale#312 (comment) , for the reasons this theory is now slightly stronger than before.

from ksp-recall.

Lisias avatar Lisias commented on June 7, 2024

Monkey Patching was completely ruled out on TweakScale/TweakScale#312 .

See TweakScale/TweakScale#312 (comment) for details.

from ksp-recall.

Lisias avatar Lisias commented on June 7, 2024

On the other hand, this post on Forum may still be explained by Monkey Patching.

from ksp-recall.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.