FancyMenu [Fabric] [MOVED TO NEW PROJECT]

FancyMenu [Fabric] [MOVED TO NEW PROJECT]

16M Downloads

Crash: Bad Access To Protected Data

FooterManDev opened this issue ยท 22 comments

commented

Describe the bug
Game crashes with many FM references in the crash report.

To Reproduce
Load the game.

Expected behavior
Load the game without issue.

Game Log
Crash
Latest

Screenshots

Basic Informations (please complete the following information):

  • OS: [W11]
  • FancyMenu Version [1.13.3]
  • Forge/Fabric Version [43.2.4]
  • Minecraft Version [1.19.2]
  • Active Mods [Drippy, plus 168 others]
  • Drippy Version [2.1.1]
commented

Your latest log is not the same as the crash log. The latest.log is about a missing mod dependency.
The full latest.log right after the FM crash happened would be very helpful, so if you still have it, please send it to me, thank you very much!

commented

I apologize, I forgot I had a different error for the 2nd part :|
Disabling Drippy originally fixed the issue, but I just re-enabled Drippy to get new logs for you, and it just decided to work... I'll close for now, and re-open if the issue comes back. I apologize for wasting your time... for now.

commented

It's not solved, so better not close it yet.

commented

Little update on this issue:

It looks like this crash is not caused by FancyMenu, but some other mods (core mods?) that were compiled using older Forge builds. FancyMenu just throws the error because it happens in parts of FancyMenu's code, at least that's my understanding of the situation right now.

It works perfecly fine with only FancyMenu installed.

Update 2:

Okay so after collecting more information about the issue, another possible cause for it could be some specific Forge build(s).
Users reported that updating Forge to the latest build fixes the issue.

How to FIX it:

Update your Forge to the latest build. If that doesn't help, try that:

The best "fix" for this is to update all mods (especially core mods) to their latest versions.
I also released updates targetting this issue on FM's side for MC 1.18 and 1.19, so updating FM could also help!

Some mods known to cause this when not using their latest versions are:

If you are using one of the mods mentioned above, please update them to their latest versions.
I will update the list if new mods are found.

commented

another crash log related to the issue: https://pastebin.com/kbh2k9mn

at de.keksuccino.fancymenu.menu.fancy.menuhandler.MenuHandlerBase.onInitPre(MenuHandlerBase.java:221) ~[fancymenu_forge_2.13.3-2_MC_1.19-1.19.2.jar%23929!/:1.0.0] {re:mixin,re:classloading}
	at net.minecraft.client.gui.screens.LoadingOverlay.md43b65f$lambda$initOverlay$8$0(LoadingOverlay.java:1809) ~[client-1.19.2-20220805.130853-srg.jar%231289!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:kubejs-common.mixins.json:LoadingOverlayMixin,pl:mixin:APP:fancymenu.general.mixin.json:MixinLoadingOverlay,pl:mixin:APP:drippyloadingscreen.mixin.json:client.MixinLoadingOverlay,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screens.LoadingOverlay.runMenuHandlerTask(LoadingOverlay.java:1824) ~[client-1.19.2-20220805.130853-srg.jar%231289!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:kubejs-common.mixins.json:LoadingOverlayMixin,pl:mixin:APP:fancymenu.general.mixin.json:MixinLoadingOverlay,pl:mixin:APP:drippyloadingscreen.mixin.json:client.MixinLoadingOverlay,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screens.LoadingOverlay.initOverlay(LoadingOverlay.java:1806) ~[client-1.19.2-20220805.130853-srg.jar%231289!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:kubejs-common.mixins.json:LoadingOverlayMixin,pl:mixin:APP:fancymenu.general.mixin.json:MixinLoadingOverlay,pl:mixin:APP:drippyloadingscreen.mixin.json:client.MixinLoadingOverlay,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screens.LoadingOverlay.handleInitOverlay(LoadingOverlay.java:1775) ~[client-1.19.2-20220805.130853-srg.jar%231289!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:kubejs-common.mixins.json:LoadingOverlayMixin,pl:mixin:APP:fancymenu.general.mixin.json:MixinLoadingOverlay,pl:mixin:APP:drippyloadingscreen.mixin.json:client.MixinLoadingOverlay,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screens.LoadingOverlay.handler$dol000$onConstruct(LoadingOverlay.java:1583) ~[client-1.19.2-20220805.130853-srg.jar%231289!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:kubejs-common.mixins.json:LoadingOverlayMixin,pl:mixin:APP:fancymenu.general.mixin.json:MixinLoadingOverlay,pl:mixin:APP:drippyloadingscreen.mixin.json:client.MixinLoadingOverlay,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screens.LoadingOverlay.<init>(LoadingOverlay.java:56) ~[client-1.19.2-20220805.130853-srg.jar%231289!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:kubejs-common.mixins.json:LoadingOverlayMixin,pl:mixin:APP:fancymenu.general.mixin.json:MixinLoadingOverlay,pl:mixin:APP:drippyloadingscreen.mixin.json:client.MixinLoadingOverlay,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.<init>(Minecraft.java:578) ~[client-1.19.2-20220805.130853-srg.jar%231289!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:kubejs-common.mixins.json:MinecraftMixin,pl:mixin:APP:mixins.hammerlib.json:client.MinecraftMixin,pl:mixin:APP:botania_xplat.mixins.json:client.MinecraftAccessor,pl:mixin:APP:mixins.oculus.json:MixinMinecraft_Keybinds,pl:mixin:APP:mixins.oculus.json:MixinMinecraft_PipelineManagement,pl:mixin:APP:the_bumblezone.mixins.json:client.MinecraftMixin,pl:mixin:APP:mining_helmet.mixins.json:MinecraftMixin,pl:mixin:APP:ae2.mixins.json:PickColorMixin,pl:mixin:APP:rubidium_extras.mixins.json:FrameCounter.FpsAccessorMixin,pl:mixin:APP:flywheel.mixins.json:PausedPartialTickAccessor,pl:mixin:APP:oauth.mixins.json:MinecraftMixin,pl:mixin:APP:globaldataandresourcepacks.mixins.json:ClientPackFinderMixin,pl:mixin:APP:bookshelf.common.mixins.json:client.AccessorMinecraft,pl:mixin:APP:konkrete.mixin.json:MixinMinecraft,pl:mixin:APP:travelerstitles.mixins.json:MinecraftClientTickMixin,pl:mixin:APP:fancymenu.general.mixin.json:MixinMinecraft,pl:mixin:APP:fancymenu.general.mixin.json:IMixinMinecraft,pl:mixin:APP:quartz.mixins.json:MinecraftShutdownMixin,pl:mixin:APP:rubidium.mixins.json:core.MixinMinecraftClient,pl:mixin:APP:balm.mixins.json:MinecraftMixin,pl:mixin:APP:chat_heads.mixins.json:MinecraftMixin,pl:mixin:APP:fastload.mixins.json:client.MinecraftClientMixin,pl:mixin:APP:ars_nouveau.mixins.json:light.ClientMixin,pl:mixin:APP:drippyloadingscreen.mixin.json:client.IMixinMinecraft,pl:mixin:APP:drippyloadingscreen.mixin.json:client.MixinMinecraft,pl:mixin:APP:immersiveengineering.mixins.json:accessors.client.MinecraftAccess,pl:mixin:APP:byg_forge.mixins.json:client.MixinMinecraft,pl:mixin:APP:dankstorage.mixins.json:MinecraftClientAccessor,pl:mixin:APP:dynmus-common.mixins.json:MinecraftClientMixin,pl:mixin:APP:betterthirdperson.mixins.json:MinecraftMixin,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:blueprint.mixins.json:client.MinecraftMixin,pl:mixin:APP:configuration.mixins.json:MinecraftMixin,pl:mixin:APP:iceberg.mixins.json:MinecraftMixin,pl:mixin:APP:quark.mixins.json:client.MinecraftMixin,pl:mixin:APP:create.mixins.json:WindowResizeMixin,pl:mixin:APP:ars_nouveau.mixins.json:camera.MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.m_239872_(Main.java:176) ~[client-1.19.2-20220805.130853-srg.jar%231289!/:?] {re:classloading,re:mixin,pl:runtimedistcleaner:A,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:51) ~[client-1.19.2-20220805.130853-srg.jar%231289!/:?] {re:classloading,re:mixin,pl:runtimedistcleaner:A,pl:mixin:A,pl:runtimedistcleaner:A}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
	at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:27) ~[fmlloader-1.19.2-43.2.4.jar%2395!/:?] {}
commented

Gets triggered when getting FM:LayoutEditorScreen#isActive by calling FM:MenuHandlerBase#onInitPre() via DRIPPY:MixinLoadingOverlay#initOverlay().

commented

Could be caused by trying to get Screen#title in early loading screen phase. This field is normally private final and access to it was widened via an access transformer.

The crash seems to happen when the LayoutEditorScreen class gets loaded due to getting the isActive field.

commented

Update:

I just released updates for Drippy Loading Screen and FancyMenu as an attempt to fix the "Bad Access To Protected Data" crash/bug. I'm not sure if it's fixed now, but I hope it is ๐Ÿ˜…

commented

The bytecode seems to be quite different actually ๐Ÿค”

commented

Some more days into the issue and now it seems like it is triggered by accessing fields with widened access in general. So every field that was originally private and is called early enough seems to trigger it (under the right circumstances).

This was first noticed after fixing the first issue (removing direct access to Screen#title, which was accessed in loading screen due to Drippy using FancyMenu's customization engine and initializing a dummy Screen instance for loading screen customizations). It now crashed at the next field with widened access, which was LoadingOverlay#BRAND_BACKGROUND.
This field's access was widened because of Drippy. The latest Drippy build fixes this.

It's worth noticing that the game seems to never crash when just started with FancyMenu and Drippy installed. It only happens with other mods installed, and one of them seems to be Oculus.

commented

I'm also using this as a little note block while trying to understand what's going on on a binary level.

commented
java.lang.VerifyError: Bad access to protected data in putfield
Exception Details:
  Location:
    de/keksuccino/fancymenu/menu/fancy/helper/layoutcreator/LayoutEditorScreen.<init>(Lnet/minecraft/client/gui/screens/Screen;)V @386: putfield
  Reason:
    Type 'net/minecraft/client/gui/screens/Screen' (current frame, stack[0]) is not assignable to 'de/keksuccino/fancymenu/menu/fancy/helper/layoutcreator/LayoutEditorScreen'
  Current Frame:
    bci: @386
    flags: { }
    locals: { 'de/keksuccino/fancymenu/menu/fancy/helper/layoutcreator/LayoutEditorScreen', 'net/minecraft/client/gui/screens/Screen', 'net/minecraft/network/chat/Component' }
    stack: { 'net/minecraft/client/gui/screens/Screen', 'net/minecraft/network/chat/Component' }
  Bytecode:
    0000000: 2a12 90b8 0096 b700 992a bb00 2459 2ab7
    0000010: 009c b500 9e2a bb00 a059 b700 a3b5 00a5
    0000020: 2abb 00a0 59b7 00a3 b500 a72a bb00 a059
    0000030: b700 a3b5 00a9 2abb 00a0 59b7 00a3 b500
    0000040: ab2a bb00 a059 b700 a3b5 00ad 2abb 00af
    0000050: 59b7 00b0 b500 b22a bb00 af59 b700 b0b5
    0000060: 00b4 2abb 00af 59b7 00b0 b500 b62a bb00
    0000070: af59 b700 b0b5 00b8 2abb 00af 59b7 00b0
    0000080: b500 ba2a bb00 a059 b700 a3b5 00bc 2abb
    0000090: 00a0 59b7 00a3 b500 be2a bb00 a059 b700
    00000a0: a3b5 00c0 2a03 b500 c22a 03b5 00c4 2a03
    00000b0: b500 c62a 0eb5 00c8 2a03 b500 ca2a 03b5
    00000c0: 00cc 2a03 b500 ce2a 03b5 00d0 2a12 d2b5
    00000d0: 00d4 2a03 b500 d62a 03b5 00d8 2a03 b500
    00000e0: da2a 03b5 00dc 2a03 b500 de2a 12e0 b500
    00000f0: e22a 03b5 00e4 2a03 b500 e62a 03b5 00e8
    0000100: 2a01 b500 ea2a 03b5 00ec 2a03 b500 ee2a
    0000110: 03b5 00f0 2abb 00a0 59b7 00a3 b500 f22a
    0000120: bb00 af59 b700 b0b5 00f4 2abb 00a0 59b7
    0000130: 00a3 b500 f62a bb00 a059 b700 a3b5 00f8
    0000140: 2abb 000e 592a bb00 fa59 1290 b700 fdb7
    0000150: 0100 b501 022a bb00 1259 2ab7 0103 b501
    0000160: 052a 2bb5 0107 b201 0a2a b401 07b6 0110
    0000170: b901 1402 00c0 0092 4d2c c600 0b2a b401
    0000180: 072c b501 18b2 011a 9a00 19ba 012d 0000
    0000190: b801 3357 ba01 3800 00b8 0133 5704 b301
    00001a0: 1a2a c101 3a9a 004e 2ab4 0107 b601 10b6
    00001b0: 0140 b801 464e 2dc6 003c 2db6 014c b901
    00001c0: 5201 003a 0419 04b9 0158 0100 9900 2719
    00001d0: 04b9 015c 0100 c001 5e3a 052a b400 a719
    00001e0: 0519 05b6 0162 2ab6 0166 b901 6a02 0057
    00001f0: a7ff d5b1                              
  Stackmap Table:
    full_frame(@389,{Object[#2],Object[#5],Object[#146]},{})
    same_frame(@417)
    append_frame(@453,Object[#328],Object[#340])
    chop_frame(@499,2)
commented
java.lang.VerifyError: Bad access to protected data in getfield
Exception Details:
  Location:
    de/keksuccino/fancymenu/menu/fancy/helper/layoutcreator/LayoutEditorScreen.<init>(Lnet/minecraft/client/gui/screens/Screen;)V @390: putfield
  Reason:
    Type 'net/minecraft/client/gui/screens/Screen' (current frame, stack[0]) is not assignable to 'de/keksuccino/fancymenu/menu/fancy/helper/layoutcreator/LayoutEditorScreen'
  Current Frame:
    bci: @390
    flags: { }
    locals: { 'de/keksuccino/fancymenu/menu/fancy/helper/layoutcreator/LayoutEditorScreen', 'net/minecraft/client/gui/screens/Screen', 'net/minecraft/network/chat/Component' }
    stack: { 'net/minecraft/client/gui/screens/Screen', 'net/minecraft/network/chat/Component' }
  Bytecode:
    0000000: 2abb 0090 5912 92b7 0095 b700 982a bb00
    0000010: 2459 2ab7 009b b500 9d2a bb00 9f59 b700
    0000020: a2b5 00a4 2abb 009f 59b7 00a2 b500 a62a
    0000030: bb00 9f59 b700 a2b5 00a8 2abb 009f 59b7
    0000040: 00a2 b500 aa2a bb00 9f59 b700 a2b5 00ac
    0000050: 2abb 00ae 59b7 00af b500 b12a bb00 ae59
    0000060: b700 afb5 00b3 2abb 00ae 59b7 00af b500
    0000070: b52a bb00 ae59 b700 afb5 00b7 2abb 00ae
    0000080: 59b7 00af b500 b92a bb00 9f59 b700 a2b5
    0000090: 00bb 2abb 009f 59b7 00a2 b500 bd2a bb00
    00000a0: 9f59 b700 a2b5 00bf 2a03 b500 c12a 03b5
    00000b0: 00c3 2a03 b500 c52a 0eb5 00c7 2a03 b500
    00000c0: c92a 03b5 00cb 2a03 b500 cd2a 03b5 00cf
    00000d0: 2a12 d1b5 00d3 2a03 b500 d52a 03b5 00d7
    00000e0: 2a03 b500 d92a 03b5 00db 2a03 b500 dd2a
    00000f0: 12df b500 e12a 03b5 00e3 2a03 b500 e52a
    0000100: 03b5 00e7 2a01 b500 e92a 03b5 00eb 2a03
    0000110: b500 ed2a 03b5 00ef 2abb 009f 59b7 00a2
    0000120: b500 f12a bb00 ae59 b700 afb5 00f3 2abb
    0000130: 009f 59b7 00a2 b500 f52a bb00 9f59 b700
    0000140: a2b5 00f7 2abb 000e 592a bb00 f959 1292
    0000150: b700 fab7 00fd b500 ff2a bb00 1259 2ab7
    0000160: 0100 b501 022a 2bb5 0104 b201 072a b401
    0000170: 04b6 010d b901 1102 00c0 0113 4d2c c600
    0000180: 0b2a b401 042c b501 17b2 0119 9a00 19ba
    0000190: 012c 0000 b801 3257 ba01 3700 00b8 0132
    00001a0: 5704 b301 192a c101 399a 004e 2ab4 0104
    00001b0: b601 0db6 013f b801 454e 2dc6 003c 2db6
    00001c0: 014b b901 5101 003a 0419 04b9 0157 0100
    00001d0: 9900 2719 04b9 015b 0100 c001 5d3a 052a
    00001e0: b400 a619 0519 05b6 0161 2ab6 0165 b901
    00001f0: 6902 0057 a7ff d5b1                    
  Stackmap Table:
    full_frame(@393,{Object[#2],Object[#5],Object[#275]},{})
    same_frame(@421)
    append_frame(@457,Object[#327],Object[#339])
    chop_frame(@503,2)
commented

Modlist for the first one (pastbin):

kubejs
fancymenu
drippyloadingscreen
hammerlib
botania_xplat
oculus
the_bumblezone
mining_helmet
ae2
rubidium_extras
flywheel
oauth
globaldataandresourcepacks
bookshelf
konkrete
travelerstitles
quartz
rubidium
balm
chat_heads
fastload
ars_nouveau
immersiveengineering
byg_forge
dankstorage
dynmus-common
betterthirdperson
architectury
blueprint
configuration
iceberg
quark
create

commented

Screen <init>:

// access flags 0x4
  protected <init>(Lnet/minecraft/network/chat/Component;)V
   L0
    LINENUMBER 93 L0
    ALOAD 0
    INVOKESPECIAL net/minecraft/client/gui/components/events/AbstractContainerEventHandler.<init> ()V
   L1
    LINENUMBER 68 L1
    ALOAD 0
    INVOKESTATIC com/google/common/collect/Lists.newArrayList ()Ljava/util/ArrayList;
    PUTFIELD net/minecraft/client/gui/screens/Screen.children : Ljava/util/List;
   L2
    LINENUMBER 69 L2
    ALOAD 0
    INVOKESTATIC com/google/common/collect/Lists.newArrayList ()Ljava/util/ArrayList;
    PUTFIELD net/minecraft/client/gui/screens/Screen.narratables : Ljava/util/List;
   L3
    LINENUMBER 75 L3
    ALOAD 0
    INVOKESTATIC com/google/common/collect/Lists.newArrayList ()Ljava/util/ArrayList;
    PUTFIELD net/minecraft/client/gui/screens/Screen.renderables : Ljava/util/List;
   L4
    LINENUMBER 87 L4
    ALOAD 0
    NEW net/minecraft/client/gui/narration/ScreenNarrationCollector
    DUP
    INVOKESPECIAL net/minecraft/client/gui/narration/ScreenNarrationCollector.<init> ()V
    PUTFIELD net/minecraft/client/gui/screens/Screen.narrationState : Lnet/minecraft/client/gui/narration/ScreenNarrationCollector;
   L5
    LINENUMBER 88 L5
    ALOAD 0
    LDC -9223372036854775808
    PUTFIELD net/minecraft/client/gui/screens/Screen.narrationSuppressTime : J
   L6
    LINENUMBER 89 L6
    ALOAD 0
    LDC 9223372036854775807
    PUTFIELD net/minecraft/client/gui/screens/Screen.nextNarrationTime : J
   L7
    LINENUMBER 94 L7
    ALOAD 0
    ALOAD 1
    PUTFIELD net/minecraft/client/gui/screens/Screen.title : Lnet/minecraft/network/chat/Component;
   L8
    LINENUMBER 95 L8
    RETURN
   L9
    LOCALVARIABLE this Lnet/minecraft/client/gui/screens/Screen; L0 L9 0
    LOCALVARIABLE $$0 Lnet/minecraft/network/chat/Component; L0 L9 1
    MAXSTACK = 3
    MAXLOCALS = 2
commented

Modlist for the second one (gist):

drippyloadingscreen
fancymenu
apoli
rubidium
balm
braincell
oculus
the_bumblezone
dungeons_libraries
fallingleaves
ars_nouveau
flywheel
bookshelf
konkrete
betterthirdperson
architectury
simplerpc
blueprint
travelerstitles
iceberg
create

commented

In both:

drippyloadingscreen
fancymenu
rubidium
balm
oculus
the_bumblezone
ars_nouveau
flywheel
bookshelf
konkrete
betterthirdperson
architectury
blueprint
travelerstitles
iceberg
create

However it is very strange, as this happens in two different minecraft versions, with very different forge implementations ๐Ÿค”

commented

Here are two sets of transformed classes (none of them is having the issue anymore ๐Ÿ˜ž However, they seem to differ, now it's just the question to what extend and if it's normal.

mixin.out.zip

mixin.out(1).zip

Created on Fun in the Sky v0.0.3

commented

Bytecode LayoutEditorScreen class FancyMenu Forge 1.19.2: https://gist.github.com/Keksuccino/7f35761a6cda5e14a9c1d1143fcad3a0

commented

Seems like this is fixed now!

If somebody still experiences this crash using latest builds of FancyMenu and Drippy, please open a new issue!
Thank you very much!