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

Null-detail messages are not deobfuscated #41

Open
quat1024 opened this issue Apr 28, 2022 · 1 comment
Open

Null-detail messages are not deobfuscated #41

quat1024 opened this issue Apr 28, 2022 · 1 comment

Comments

@quat1024
Copy link

quat1024 commented Apr 28, 2022

Java calls them the "extended message", the JEP calls them "null-detail messages" - whatever they're called, those handy NullPointerException "Cannot invoke (something) because the return value of (cause) is null", "Cannot read field (something) because (cause) is null" messages were introduced in Java 14, and unfortunately if a Minecraft class or method appears in the null-detail message, it is not deobfuscated.

I don't know if this is possible to fix (NEC doesn't seem to touch the original Throwable's message, and Java doesn't provide any sort of API to introspect the message other than trying to parse the string), but it would be nice to have.

Here is an example crash from a user: VazkiiMods/Botania#4027

java.lang.NullPointerException: Cannot invoke "net.minecraft.class_1792.method_40131()" because the return value of "net.minecraft.class_1799.method_7909()" is null
    at Not Enough Crashes deobfuscated stack trace.(1.18.2+build.2) ~[?:?]
    at net.minecraft.item.ItemStack.isIn(ItemStack:230) ~[?:?]
    at vazkii.botania.common.item.equipment.bauble.ItemMonocle.lambda$hasMonocle$2(ItemMonocle.java:102) ~[Botania-1.18.2-431-FABRIC.jar:?]
...

Deobfuscated, this would read

Cannot invoke "net.minecraft.item.ItemStack.isIn()" because the return value of "net.minecraft.item.ItemStack.getItem()" is null
                                                                                 ^^^^^^^^^^^^^ this part ^^^^^^^^^^^^^^

The class/method that can't be invoked (isIn) can be read off the first line of the deobfuscated stacktrace, but the cause (getItem) does not appear anywhere in the deobfuscated stacktrace and has to be manually looked up.

Again, it's not the end of the world, it'd be a small convenience though. If the Throwable's message can't be changed, maybe it'd be nice to mention by the Not Enough Crashes deobfuscated stacktrace watermark, or something like that.

@natanfudge
Copy link
Owner

natanfudge commented May 9, 2022

Hey quat,
Thanks for the suggestion. In the future deobfuscation will solely be a part of Crashy, so I'm transferring this issue there.

@natanfudge natanfudge transferred this issue from natanfudge/Not-Enough-Crashes May 9, 2022
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

2 participants