codetaylor / pyrotech-1.12

An early game mod with new primitive devices, combustion machines, smelting mechanics, storage options, tools, torches, advancements, and absolutely zero GUIs -- with exception to the substantially complete, mostly illustrated, and charred guidebook.
https://pyrotech.readthedocs.io/en/latest/
Other
52 stars 20 forks source link

NPE on Crafting #12

Open kandivia opened 5 years ago

kandivia commented 5 years ago

Intro

Please follow the template when submitting an issue.

Text placed within [replace] tags may be omitted and replaced with your text.

Issue Description

Sometimes while crafting, the game crashes due to a Null Pointer Exception: Rendering Screen.

What Happens

Craft an item from this mod. There's a chance that the game crashes.

What You Expect to Happen

Not to crash.

Script

No scripts

Crash Log

https://pastebin.com/QuBi283r

Affected Versions

Do not use latest; please supply accurate version numbers.

codetaylor commented 5 years ago

Thanks for the report!

Were you crafting something in the vanilla crafting table? Or was it the Pyrotech worktable? Do you remember what you were crafting when it crashed?

kandivia commented 5 years ago

Was the 2x2 crafting table in the player inventory. Had it crash on making a Crude Pickaxe, Crude Axe, Crude Drying Rack. It's either only on the first time you craft an item or just random it seems.

codetaylor commented 5 years ago

The stacktrace indicates it's crashing due to a NPE while rendering an open recipe book.

I'm having difficulty reproducing this. I've crafted each item you listed for the first time with the recipe book open and closed, then multiple subsequent crafts, again with the recipe book open and closed and haven't had a crash.

| State  | ID        | Version       | Source                        | Signature                                |
|:------ |:--------- |:------------- |:----------------------------- |:---------------------------------------- |
| LCHIJA | minecraft | 1.12.2        | minecraft.jar                 | None                                     |
| LCHIJA | mcp       | 9.42          | minecraft.jar                 | None                                     |
| LCHIJA | FML       | 8.0.99.99     | forge-1.12.2-14.23.5.2838.jar | e3c3d50c7c986df74c645c0ac54639741c90a557 |
| LCHIJA | forge     | 14.23.5.2838  | forge-1.12.2-14.23.5.2838.jar | e3c3d50c7c986df74c645c0ac54639741c90a557 |
| LCHIJA | jei       | 4.15.0.280    | jei_1.12.2-4.15.0.280.jar     | None                                     |
| LCHIJA | athenaeum | 1.12.2-1.17.1 | athenaeum-1.12.2-1.17.1.jar   | None                                     |
| LCHIJA | dropt     | 1.12.2-1.14.0 | dropt-1.12.2-1.14.0.jar       | None                                     |
| LCHIJA | patchouli | 1.0-19        | Patchouli-1.0-19.jar          | None                                     |
| LCHIJA | pyrotech  | 1.0.2         | pyrotech-1.0.2.jar            | None                                     |

I was testing with Pyrotech 1.0.2 though.

Does the problem persist if you update to Pyrotech 1.0.2 ?

kandivia commented 5 years ago

I'll test right now, but I haven't had a crash since those first occurrences. I'll create a new instance and try again with 1.0.2

kandivia commented 5 years ago

https://pastebin.com/gQYCmVrE yup, took a while but after a few crafts and then opening the recipe book and then trying a few more, got the crash

kandivia commented 5 years ago

Got another one even faster.

  1. Create fresh mc install
  2. Install forge and mods
  3. Create new survival world
  4. Quickly gather enough materials
  5. Craft crude pickaxe(used shift click not sure if matters)
  6. Crash ensues. Messing around with opening/closing the recipe book didn't matter
codetaylor commented 5 years ago

Hmm.

I tried again, using the same mods, forge version, etc. This time I also tried using MultiMC - I noticed that's what you were using - and I still can't reproduce it.

Are you willing to share more of your log file? Maybe there's something there that will provide a clue.

kandivia commented 5 years ago

After many more attempts, I seem to have figured out the setup to reproduce the crash. When crafting an item, spam click(again i used shift left-click here) and if quick enough it'll trigger the crash. Also the crash report and log for the last one: https://pastebin.com/jSzT1xVz https://pastebin.com/CXMM8ELT

codetaylor commented 5 years ago

Thank you for your help.

codetaylor commented 5 years ago

Also:

kandivia commented 5 years ago

Haven't actually been able to still reproduce the crash actually, spam clicking was a false hope it seems. No changes were made to the config files. I'll update if I can reproduce this more.

codetaylor commented 5 years ago

Yeah, I'm at a loss here.

I have done many hours of play-testing and have never seen this error and I've tried many times to reproduce the problem to no avail.

A review of the logs and stacktraces doesn't point to any of Pyrotech's code. My best guess at this point, from the two distinct stacktraces provided, is that the client is crashing because the field this.searchBar in the class GuiRecipeBook is null for some reason.

I'm not convinced that the code for Pyrotech, Dropt, or Athenaeum is causing this.

I'll go ahead and leave this open for now.

Rimevel commented 5 years ago

Just got the same crash when crafting a crude hammer. Got the exact same error as Kandivia. EDIT: Keeps crashing after just a few crafts. Very consistent.

Rimevel commented 5 years ago

Just as an experiment, I installed the mod "No recipe book" to see if it gave some other result. Crashed on my first craft but got a slightly different error this time: https://pastebin.com/9p8AZbAS. Gonna try a different forge version next. EDIT: Switching to the older, recommended forge version did not change anything. Still crashing randomly when crafting.

Rimevel commented 5 years ago

Seems like the crash can be prevented by doing the following:

Doing it any other way is almost a guaranteed crash.

codetaylor commented 5 years ago

I have no idea what is causing this and I am unable to reproduce it.

alyssa-fae-0 commented 5 years ago

I had this same issue yesterday. What fixed it for me was downgrading from forge-14.23.5.2838 (latest) to forge-14.23.5.2768 (recommended). I think it may be a bug in forge itself, but I didn't look to verify (no development environment set up).

Jack-Chronicle commented 5 years ago

was happening to me anytime I first crafted an item in the 2x2 grid, didn't matter if I had the recipe book open or closed, or shift clicked or not. Would crash the game, and when I loaded the world back up, the item would be gone with the ingredients, but i'd be able to safely craft it afterwards...

Rimevel commented 5 years ago

Yea it seems like the crash is happening whenever any item from the mod is crafted for the first time and being put into the recipe book.

ticviking commented 5 years ago

So I did some experimenting and it is happening at a rate of 2/5 times I craft a new item.

I haven't hooked up a debugger or profiler to my minecraft instance yet, but the irregular rate and null pointer suggestion leads me to suspect that we are looking at a race condition resulting in some part of the tasks managing the recipe book.

Reverting to forge-14.23.5.2768 seems to work.

Probably ought to report this to them if we can ID where in their code this is.

Rimevel commented 5 years ago

Can report that reverting to forge-14.23.5.2768 does not do the trick for me. Still the same error and crash,

Murdermancer commented 5 years ago

Hey, some additional insight from my testing, having run into this same issue:

Given that, I downgraded from Patchouli 1.0-20 to 1.0-19, which seems to have resolved the issue for me. Hopefully that helps!

ticviking commented 5 years ago

Nothing really new but I made some time to poke around with this again. Did some testing and looking for common factors.

I'm only seeing it when both JEI and Patchouli are installed.

ticviking commented 5 years ago

Seems to also occur with HWYLA + Patchouli. Even when I downgrade patchouli 1.0-19.

AyanaAlemayehu commented 5 years ago

same problem. Crashes with both latest and recommended forge, patchouli 1.0-20 & 1.0-19, shift clicking or not. Only after crafting the item once does it not crash afterwards.

However when crafting the drying rack I got a "ticking screen" error. I had downgraded patchouli to 1.0-18.

AyanaAlemayehu commented 5 years ago

Also doesnt crash on other new worlds after the first time, meaning that I dont have the problem anymore after the crashes on my first world.

Vatruvius commented 5 years ago

I am encountering this same exact issue. The point at which the game crashes is inconsistent or if there is a pattern I have not found it yet. So far I have not been able to get far enough into the game to use anything except the 2x2 crafting grid in the inventory. The item that eventually results in the crash is random. I have had it crash on yellow dye, crude axe, crude pickaxe, chopping block, and sticks from a sapling. Each and every single crash is from creating a new instance of Minecraft 1.12.2 with Forge 1.12.2-14.23.5.2768. Weather I have used the recipe book or not seems to have no effect. I can say I have consistently used shift+lmb to grab the crafted item as I tend to craft fast.

Here is a link to my latest crash report: https://www.dropbox.com/s/51jmq6e0k4d9k0t/crash-2019-09-22_15.21.47-client.txt?dl=0

I do not have the old crash reports but will keep all of them from now on.

Vatruvius commented 5 years ago

I figured out what is consistent between crashes.

Any time you craft an item and it is your first time crafting that item in the current save the game updates either the recipe book or the recipe book and the esoterica depending on the item. In either case, this updating of the recipe book with the notification in the top right is consistent between every crash I have experienced. That is why new saves/worlds or fresh builds have the same crashes.

I am pretty sure it has to do the with the recipe book as that is the only consistent factor between crafting vanilla and pyrotech items as the esoterica only updates with pyrotech items.

codetaylor commented 5 years ago

Yes, it does have to do with the recipe book.

From above:

My best guess at this point, from the two distinct stacktraces provided, is that the client is crashing because the field this.searchBar in the class GuiRecipeBook is null [...]

[...] the irregular rate and null pointer suggestion leads me to suspect that we are looking at a race condition resulting in some part of the tasks managing the recipe book [...]

Vatruvius commented 5 years ago

I did some more testing with selectively turning on and off mods pertaining to Pyrotech. I never crash until I add Patchouli. Something that Patchouli does causes the recipe book to cause a crash. However, I have been trying to get my game to crash and now it won't. I am not sure if it is because this is not a new instance of the game so somewhere files are retained voiding crashing on items I have already crashed on but even on new stuff I cannot seem to crash now. Will attempt a new instance.

Vatruvius commented 5 years ago

Yup, after creating a new instance and thoroughly testing the game eventually adding Pyrotech then Patchouli the game crashed once the esoterica became part of the game. Functionally using the book is great and I do not crash. It is just when making items for whatever reason with Patchouli active. Even then the crashes are not consistent with what item other than it being a new item. Sometimes it crashes on the new recipe/book log and sometimes it doesn't but that is what I have isolated the problem down to.

Here is a link to the most recent crash log: https://www.dropbox.com/s/9i7u4cr0yuf8tp8/crash-2019-09-22_19.37.47-client.txt?dl=0

ticviking commented 5 years ago

Spent the morning poking at this bug. It's getting really frustrating as I've got my mod pack almost ready to work except this bug.

Maybe this info will help the rest of us looking for this.

  1. Some digging in things that use the recent de-obfuscation info drip suggests that (GuiRecipeBook.java:251) has to do with handling stack giving items to the player after crafting.
  2. I continue to strongly suspect we're looking at some kind of race condition as I cannot reliably cause the bug to occur.

It's definitely caused by an interaction with patchouli. The modpack I've been working on has had 0 problems even loaded down with extra mods as long as patchouli is not installed.

I am trying a few experiments and would like if anyone else working on this would try them as well and upload the game log from their attempts. (@codetaylor given you haven't been able to reproduce this I'm especially interested in your logs to see what's different in our runs)

Basically load in, make a world, and restart the instance to populate the oredict stuff, then play around for 10-20 min until you see a crash or time is up.

Modpacks for these states are here

Vatruvius commented 5 years ago

I will gladly start testing when I get the time, probably this weekend. Looking forward to pushing through this bug.

ticviking commented 5 years ago

I still haven't tried with the module off, and won't have free time to devote to doing so for a few days.

ticviking commented 5 years ago

Had a quick idea, and tested it with the cheats. I need to do a few more runs, but it looks like I can play as long as I like so long as I do not open the esoterica.

ticviking commented 5 years ago

A morning testing later and I'm 100% sure the bug is in patchouli and not pyrotech.

I'll report it there. Thanks for your patience