#Death during custom transistion
127 messages · Page 1 of 1 (latest)
The image is immediately after the bug, no variants, and I couldn't do anything except move
The crash occurs after alt+f4'ing to exit the map
@dusky charm fuckfuckfuckfuckfuck
this is the same crash as #1252745586357047334 and #1252742233803985016
i have no clue how this would conflict
@gaunt flax hi so
we suspect this is related to the new extended variant
i have no clue how this would cause things to go wrong
fyi, before I alt-f4'd out of the game, the only thing I could do was walk, I couldn't even pause
oh I can't enter specific other maps like mauve and my own map either
can you downgrade extended variants one version
ok
do we know which method it crashes on?
it crashes in DashCoroutine
this is a certified monomod moment however
ughhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
i have no fucking clue why there would be a DynamicMethod there
very angry landeline
mm is such a mess
one second, i am going to curl up in a corner and fucking sob 
h o w
how does this happen
https://github.com/MonoMod/MonoMod/blob/reorganize/src/MonoMod.Utils/Cil/ILOpcodes.txt#L142
basically it's expecting that whenever the opcode is Call, the operand is a MethodReference, and therefore does a cast, or something
This is what code modders have to deal with in an emergency 
wait so is this a monomod bug
i will be so mad if thats the case
why even a dynamic method??? what did i do differently
do they mean a delegate???
i am so fucking confused
well, the crash is in the MatchCall extension method 
Note that gravity helper does not use reorg
I will test if the same thing will break the game again
i have an idea
it means there's a call <DynamicMethod> instead of call <MethodReference> here
it might be yeah
is this ref fucking everything up
i am so
give me one minute
i will test build this
you are very
ok dying during that transistion now just causes a crash, and doesn't permanently crash it
@gaunt flax can i delete the delegate declaration
yeah 👍
Gravity helper is just the scapegoat since it appears at the top of the stack trace 
well, Samah is getting the pings
^
i'm so sorry
so
moral of the story
if you wanted to be fancy and emit a delegate with a ref parameter
uh
don't!
Are we good now?
Okay, then we just have to wait while people who don’t have auto update enabled make more tickets
“Then” in this context meaning after you release a fix
how do i reproduce the crash
I withdrew the update so extended variants will cease to exist for 5 minutes, don't worry
i think the last version of ext variants was just manually pulled so fortunately it should only be the people who played during the hour or so it was up- yea
🐌
DashDir should be checked with > 0 or it won’t handle 360 dashing… right?
i dont have a controller or a way to test this
@vivid lynx can you try this build
make sure to not update mods else this will make the issue resurface
do I replace the current ext var with this?
yes
it's checking the sign of it so
Well, I can withhold the release until tomorrow, I'm going to bed as well ^^'
<insert mild panic>
do you want me to mimic the same crash of the transistion?
do whatever you did before to crash
do you also have auto updates turned on in game
idk, I'll check after doing the extended variants thing again
did it show the cog wheel in the top left when opening everest
for a small amount of time, yes
I know 
having gone through hundreds of #953393160464269402 questions it is in my habit to explain everything to people
it works
because if i don't then someone will be like "wdym" after 30 minutes and i have to waste more time explaining to them what to do
Am trying this now with my crash will update on whether it works
although the bug that started this is still very real (I am pressing pause repeatedly at the end)
I'll convert it
It worked! 
yea i think it's known that dying there can cause weird issues
it's extremely funny
@gaunt flax i think we got a fix
i'll make a pr
maddie480/ExtendedVariantMode#54 is ready for review
oh it makes a lot of sense actually
for the curious ones on why does this hell happen
tldr: the delegate was not static and byref params dont work well with instance delegates
in more detail, in EmitDelegate theres two major cases: static and not static
in the first case the method is emitted and thats properly matched from a MethodInfo to a MethodReference that cecil needs
in the latter case, non static delegates, we attempt to go through the fast delegate invokers, which basically facilitates calling non static methods because of the need to hold an instance.
that generates a dynamic method definition and the Instruction.Create wrappers from monomod contain an edge case for DynamicMethods where it wont try to import them (because theres nothing to import), thus causing it to hold a DynamicMethod in the operand of a call
then anything that assumes that call operands should always be MethodReferences (which is a correct assumtion btw) will blow up
the bigger issue now is why the heck does removing a ref make all of that not happen
found it!
turns out that obtaining the invoker in FastDelegateInvokers.GetDelegateInvoker will first try to use one of the pregenerated (via source gen) invokers, which are only available for up to 16 parameters that are not byref, thus when using ref that shortcut cannot be used and it falls back to a DynamicMethod because otherwise it would get one of those generated methods which are not DynamicMethods thus they will be properly imported
ngl this should probably be reported to monomod

