pyrotech-1.12 icon indicating copy to clipboard operation
pyrotech-1.12 copied to clipboard

NPE on Crafting

Open kandivia opened this issue 6 years ago • 36 comments

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.

  • Minecraft: 1.12.2
  • Forge: 14.23.5.2838
  • CraftTweaker: N/A
  • Dropt: dropt-1.12.2-1.14.0
  • Pyrotech: pyrotech-1.0.1
  • Athenaeum: athenaeum-1.12.2-1.17.1

kandivia avatar Jun 13 '19 05:06 kandivia

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?

codetaylor avatar Jun 13 '19 05:06 codetaylor

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.

kandivia avatar Jun 13 '19 05:06 kandivia

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 ?

codetaylor avatar Jun 13 '19 06:06 codetaylor

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 avatar Jun 13 '19 06:06 kandivia

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 avatar Jun 13 '19 06:06 kandivia

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

kandivia avatar Jun 13 '19 06:06 kandivia

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.

codetaylor avatar Jun 13 '19 17:06 codetaylor

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

kandivia avatar Jun 13 '19 19:06 kandivia

Thank you for your help.

  • Can you reproduce the crash by crafting a vanilla item instead of the crude pickaxe?
  • If so, can you reproduce the crash after removing just the Pyrotech mod .jar?

codetaylor avatar Jun 13 '19 20:06 codetaylor

Also:

  • Have you made any alterations to the default config values?
  • If so, what did you change?

codetaylor avatar Jun 13 '19 21:06 codetaylor

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.

kandivia avatar Jun 13 '19 21:06 kandivia

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.

codetaylor avatar Jun 13 '19 21:06 codetaylor

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 avatar Jun 17 '19 16:06 Rimevel

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 avatar Jun 17 '19 16:06 Rimevel

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

  • Open the recipe book.
  • Click on the item that you want to craft.
  • Take it from the output slot.

Doing it any other way is almost a guaranteed crash.

Rimevel avatar Jun 17 '19 18:06 Rimevel

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

codetaylor avatar Jun 17 '19 20:06 codetaylor

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).

alyssa-fae-0 avatar Jun 19 '19 02:06 alyssa-fae-0

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...

Jack-Chronicle avatar Jun 20 '19 14:06 Jack-Chronicle

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.

Rimevel avatar Jun 21 '19 10:06 Rimevel

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.

ticviking avatar Jun 24 '19 16:06 ticviking

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

Rimevel avatar Jun 25 '19 21:06 Rimevel

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

  • Doesn't occur when Patchouli isn't installed
  • Not related to the installed Forge version (tested with 14.23.5.2768, and 14.23.5.2781)

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!

Murdermancer avatar Jul 14 '19 19:07 Murdermancer

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 avatar Aug 21 '19 16:08 ticviking

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

ticviking avatar Aug 21 '19 19:08 ticviking

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 avatar Aug 27 '19 17:08 AyanaAlemayehu

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.

AyanaAlemayehu avatar Aug 27 '19 17:08 AyanaAlemayehu

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 avatar Sep 22 '19 22:09 Vatruvius

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.

Vatruvius avatar Sep 23 '19 01:09 Vatruvius

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 [...]

codetaylor avatar Sep 23 '19 01:09 codetaylor

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 avatar Sep 23 '19 02:09 Vatruvius