#Everest Core Branch 4171 Crash on Startup
99 messages ยท Page 1 of 1 (latest)
hm, i thought this was a crash related to a different cause, but i just noticed something else
did it work on older versions of everest?
yes
4111 is the last one that works for me
this is especially annoying because everest is kinda forcing me into updating because mod compatibility or sumthing
@barren field
would this be related to hook ordering? any idea what this could be related to?
i was kinda just ignoring the updates because i knew they would crash but now i cant update my mods anymore
and i dont like that
last time i got told that some IL hook ordering is bugged and will be fixed soon
that's why i pinged popax, asking if hook ordering could be related or something
can you send your log.txt?
sure
actually, idk if this could be an IL hook thing, i'll look into the source
im just waiting for it to crash again it takes a bit
the crash seems to happen in frogeline project's froghelper
just out of curiosity, where do you see that?
is this a monomod crime
i downloaded frogeline project, extracted its helper dll and opened it in dnSpy
ahh
at MonoMod.RuntimeDetour.ILHook..ctor(MethodBase method, Manipulator manipulator, IDetourFactory factory, DetourConfig config, Boolean applyByDefault)
at Celeste.Mod.Helpers.LegacyMonoMod.LegacyILHook._Refresh()
at FrogHelper.Entities.FrogBerryShard.Load()
at FrogHelper.FrogHelperModule.Load()
the crash seems to indicate it's FrogHelper
here is the log
hmm i'm no expect but that orig_Update and orig_OnCollect hooks are looking mighty suspicious 
let me disable froghelper and see if it starts
probably will
37 other mods depend on this mod ๐ฌ
oh wait thats frosthelper
im dumb
i am guessing that froghelper is included in the frogeline project
it is
alright well thats not so bad
i wonder if this is a flaw with flp
not a fan of those orig_Update and orig_OnCollect hooks
Ok, what's going on?
i think this could be a case of flp2021 doing dodgy stuff? see here?
hey @idle sorrel could send the list of mods that you are using? if you are unsure you could disable all mods via Olympus and then send your blacklist.txt from your mod folder. I wana try to reproduce this locally
unless you already had some mods disabled in that case just send your current blacklist.txt 
thanks
At this point you're basically the debugging wizard 
I have no clue how you keep figuring these issues out, so I'm gonna let you work your magic here

Okay this is funny FrogHelper is having issues without any dependencies on core but on stable it works
maybe whatever that ILContext.Manipulator thing does is broken on core
Okay I pinpointed the issue
FrogBerryShard.collectHook = new ILHook((MethodBase) typeof (Celeste.Strawberry).GetMethod("orig_OnCollect"), new ILContext.Manipulator(FrogBerryShard.CollectRoutineModifier));
Idk what's from reading the patch it seems broken
no idea how it rans on non core
ILCursor ilCursor2 = new ILCursor(ctx);
ilCursor2.GotoNext((Instruction i) => i.MatchCallOrCallvirt(typeof(HashSet<Celeste.EntityID>), "Add"));
ILLabel AfterAdd = ilCursor2.DefineLabel();
ILLabel AfterDelegate = ilCursor2.DefineLabel();
ilCursor2.Emit(OpCodes.Ldarg_0);
ilCursor2.Emit(OpCodes.Isinst, typeof(FrogBerryShard));
ilCursor2.Emit(OpCodes.Brtrue, (object)AfterAdd);
ilCursor2.Index += 1; // skip over callvirt before pop
ilCursor2.Emit(OpCodes.Br, (object)AfterDelegate);
ilCursor2.MarkLabel(AfterAdd);
ilCursor2.Emit(OpCodes.Ldarg_0);
ilCursor2.EmitDelegate<Func<HashSet<Celeste.EntityID>, Celeste.EntityID, Celeste.Strawberry, bool>>(((set, id, berry) =>
{
if (set == berry.SceneAs<Celeste.Level>()?.Session.Strawberries)
return true; // <---- due to skipping callvirt pop will pop nothing return dummy value
set.Add(id);
return false; // <---- due to skipping callvirt pop will pop nothing return dummy value
}));
ilCursor2.MarkLabel(AfterDelegate);
// upcoming instruction is pop...
original IL
callvirt instance bool class [System.Core]System.Collections.Generic.HashSet`1<valuetype Celeste.EntityID>::Add(!0)
IL_00AF: pop
adding the lines with return true / false fixed it no core gona test on stable
ilCursor2.GotoNext((Instruction i) => i.MatchCallOrCallvirt(typeof(HashSet<Celeste.EntityID>), "Add")); cant find "Add" on stabe 
mb its just a bad de-compilation, @barren field do you still have accesses to the original source code of that mod?
okay this is super cursed it's either a bug in old c# runtimesthat let this issue (popping nothing?) pass as valid IL (nope) or my de-compiler is going nuts and I am debugging garbage rn
. I have new idea what's going on this patch shouldn't work
I think it's OSS
But yeah this makes sense
How did this ever work 
I assume the delegate used to return void?
Open Source Software
Also, I'm a bit confused rn
Was this the actual case?
not sure Ill need to look into EmitDelegate code
because I dont think you can dump IL patches from old monomod
No, like did it use to emit a delegate which returned nothing?
ah yes
That was the old delegate
ilCursor2.EmitDelegate<System.Action<HashSet<Celeste.EntityID>, Celeste.EntityID, Celeste.Strawberry>>((System.Action<HashSet<Celeste.EntityID>, Celeste.EntityID, Celeste.Strawberry>) ((set, id, berry) =>
{
if (set == berry.SceneAs<Celeste.Level>()?.Session.Strawberries)
return;
set.Add(id);
}));
Yeah that's plainly just wrong
I wouldn't bother debugging this further and just put it up to JIT jank
๐
Aight I opened a PR for FrogHelper this should be fixed soon
Anyone knows who is maintaining FrogHelper and could ping them to look at this PR 
it's on @nimble mango 's github so probably it?
thanks 
I think I have access? I wrote the code in question after all
However even then I couldn't push a new build to GB
that's a good start but we need someone with GB acsses
i mentioned it a while ago on the FLP server when i first tried core
making an FLP release is kind of intimidating though so i didn't probe much further
Guess we need to do more probing