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

GregTech 6 crashing on launch. #28

Closed
Crimento opened this issue Sep 8, 2022 · 19 comments
Closed

GregTech 6 crashing on launch. #28

Crimento opened this issue Sep 8, 2022 · 19 comments

Comments

@Crimento
Copy link

Crimento commented Sep 8, 2022

Vanilla 1.7.10 with Forge, FalsePatternLib, MixinBooterLegacy and ArchaicFix only.

Here is the log. Not sure on which side it should be fixed so I opened an issue in both repos
GregTech6/gregtech6#95

https://pastebin.com/PBjqWHQx

@makamys
Copy link
Collaborator

makamys commented Sep 8, 2022

I'm able to reproduce this. Adding Mixingasm fixes that error, but a different one comes up later instead:

/*     Injection validation failed: Redirector                                                                                                                      */
/*     fasterMatchCheck(Lnet/minecraft/item/crafting/IRecipe;Lnet/minecraft/inventory/InventoryCrafting;Lnet/minecraft/world/World;[Lnet/minecraft/item/ItemStack;) */
/*      in mixins.archaicfix.json:common.gt6.MixinCR expected 1 invocation(s) but 0 succeeded. Scanned 1 target(s). Using refmap mixins.archaicfix.refmap.json      */
/*     [INJECT Applicator Phase -> mixins.archaicfix.json:common.gt6.MixinCR -> Apply Injections ->  -> PostInject ->                                               */
/*     mixins.archaicfix.json:common.gt6.MixinCR->@Redirect::fasterMatchCheck(Lnet/minecraft/item/crafting/IRecipe;Lnet/minecraft/inventory/InventoryCrafting;Lnet/ */
/*     inecraft/world/World;[Lnet/minecraft/item/ItemStack;)Z]                                                    

I'm guessing something changed on GT6's side that makes the mixin no longer valid.

makamys added a commit that referenced this issue Sep 8, 2022
@makamys
Copy link
Collaborator

makamys commented Sep 8, 2022

Turns out our mixin was set up wrong. Now I can launch the game without a crash. Mixingasm is still needed though, to work around GT6's ASM transformer being unfriendly to Mixin.

You can try the new build here: https://nightly.link/embeddedt/ArchaicFix/suites/8188325357/artifacts/356244370

@quentin452
Copy link

i tried with gregtech 6 and still crash

@makamys
Copy link
Collaborator

makamys commented Sep 8, 2022

Can you post your fml-client-latest.log?

@quentin452
Copy link

ok i will later

@quentin452
Copy link

weird i don't have fml-client-latest.log when i crash

@quentin452
Copy link

crash report :
crash-2022-09-08_09.32.33-client.txt
crash with codechickencore?

@makamys
Copy link
Collaborator

makamys commented Sep 8, 2022

It looks like you're missing Mixingasm, try adding it.
For the record, the combo that worked for me was:

!mixinbooterlegacy-1.1.2.jar
archaicfix-mc1.7.10-0.3.0-14-g9907035.jar
falsepatternlib-mc1.7.10-0.10.10.jar
gregtech_1.7.10-6.15.03.jar
mixingasm-1.7.10-0.2.2.jar

No crash if I replace GregTech with gregtech_1.7.10-6.15.08-unofficial.jar either.

@quentin452
Copy link

Actually this crash can't be solved by you because the crash happens between forgemultipart and gregtech 6

@quentin452
Copy link

but the crash between gregtech 6 and archaicfix is fixed

@Crimento
Copy link
Author

Crimento commented Sep 8, 2022

You can try the new build here

Tried it with mixingasm and latest build and it works, thank you! Is there something that could be done on Greg's side?

@quentin452
Copy link

You can try the new build here

Tried it with mixingasm and latest build and it works, thank you! Is there something that could be done on Greg's side?

what are you talking about ? for the greg side?

@Crimento
Copy link
Author

Crimento commented Sep 8, 2022

The mod is still in active development, adding mixingasm looks more like a workaround than an actual fix. I mean is there something that could be done on the mod side to fix this as well?

@makamys
Copy link
Collaborator

makamys commented Sep 8, 2022

Is there something that could be done on Greg's side?

Well, the issue seems to happen because GT's transformer loads extra classes while it runs, and Mixin doesn't like that. The proper fix would be to avoid the class loading. I'm not sure if it would work here, but one trick to accomplish this is to use Class#getResource to get the raw class bytes and parse that, instead of asking the class loader to load the class.

The "lazy" fix would be to do what Mixingasm does and add GT6's transformer as an exception using MixinEnvironment.getCurrentEnvironment().addTransformerExclusion(). This has the downside that mixins won't be able to target the GT6-transformed versions of classes.

@makamys
Copy link
Collaborator

makamys commented Sep 8, 2022

Setting transformer:gregtech.asm.transformers.Minecraft_MinecraftServerIntegratedLaunchMainMenuPartialFix = false in GT6's asm.ini avoids the crash, confirming it's the only misbehaving transformer. This also acts as an alternative workaround (this one has the downside that you miss out on the bug fix the transformer is meant to provide).

@embeddedt
Copy link
Owner

Thanks for the fix @makamys.

Regarding that transformer being disabled, I'm pretty sure Greg mentioned that that bugfix doesn't work entirely reliably, and I have been trying to implement a better one on my side for quite some time, so I doubt it will affect much to keep it off.

@makamys
Copy link
Collaborator

makamys commented Sep 8, 2022

I have been trying to implement a better one on my side for quite some time

Are you talking about fixLoginRaceCondition?

@GregoriusT
Copy link

GregoriusT commented Sep 13, 2022

Not sure what yours does, but we (mostly OvermindDL1) did attempt to fix the whole thing, where you get kicked back to the main menu TWICE in a row sometimes, and only the third time you actually load a Singleplayer World, but at the cost of having a Minecraft "Server" instance running in the background forever that you need to Task Kill manually afterwards.

I am not sure how well my fix works, it probably only reduced the amount of times it happens, because I am still getting that Bug from time to time...

@embeddedt
Copy link
Owner

I'm closing this as I think the original issue is solved and I don't have time to investigate the race condition problem further at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants