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

[1.10.2] java.lang.NullPointerException: Tessellating CCL block in world #940

Closed
MauveCloud opened this issue Mar 7, 2017 · 5 comments
Closed

Comments

@MauveCloud
Copy link
Collaborator

MauveCloud commented Mar 7, 2017

After building a steam turbine and a wiremill, while preparing to craft a polarizer, I started getting crashes like this every 5-10 minutes:

---- Minecraft Crash Report ----

WARNING: coremods are present:
  IC2core (industrialcraft-2-2.6.170-ex110.jar)
  CCLCorePlugin (CodeChickenLib-1.10.2-2.5.6.233-universal.jar)
  FMLPlugin (InventoryTweaks-1.61-58.jar)
  TransformerLoader (OpenComputers-MC1.10.2-1.6.2.7.jar)
Contact their authors BEFORE contacting forge

// Ouch. That hurt :(

Time: 3/6/17 5:35 PM
Description: Tessellating CCL block in world

java.lang.NullPointerException: Tessellating CCL block in world
	at codechicken.lib.render.BlockRenderer$BlockFace.loadCuboidFace(BlockRenderer.java:53)
	at gregtech.common.render.RenderBlocks.renderFace(RenderBlocks.java:105)
	at gregtech.api.objects.GT_RenderedTexture.renderXNeg(GT_RenderedTexture.java:93)
	at gregtech.common.render.GT_Renderer_Block.renderNegativeXFacing(GT_Renderer_Block.java:466)
	at gregtech.common.render.GT_Renderer_Block.renderPipeBlock(GT_Renderer_Block.java:211)
	at gregtech.common.render.GT_Renderer_Block.renderWorldBlock(GT_Renderer_Block.java:515)
	at gregtech.common.render.GT_Renderer_Block.renderBlock(GT_Renderer_Block.java:542)
	at codechicken.lib.render.block.BlockRenderingRegistry.renderBlock(BlockRenderingRegistry.java:93)
	at codechicken.lib.render.block.CCBlockRendererDispatcher.func_175018_a(CCBlockRendererDispatcher.java:53)
	at net.minecraft.client.renderer.chunk.RenderChunk.func_178581_b(RenderChunk.java:199)
	at net.minecraft.client.renderer.chunk.ChunkRenderWorker.func_178474_a(SourceFile:100)
	at net.minecraft.client.renderer.chunk.ChunkRenderWorker.run(SourceFile:43)
	at java.lang.Thread.run(Thread.java:745)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
	at codechicken.lib.render.BlockRenderer$BlockFace.loadCuboidFace(BlockRenderer.java:53)
	at gregtech.common.render.RenderBlocks.renderFace(RenderBlocks.java:105)
	at gregtech.api.objects.GT_RenderedTexture.renderXNeg(GT_RenderedTexture.java:93)
	at gregtech.common.render.GT_Renderer_Block.renderNegativeXFacing(GT_Renderer_Block.java:466)
	at gregtech.common.render.GT_Renderer_Block.renderPipeBlock(GT_Renderer_Block.java:211)
	at gregtech.common.render.GT_Renderer_Block.renderWorldBlock(GT_Renderer_Block.java:515)
	at gregtech.common.render.GT_Renderer_Block.renderBlock(GT_Renderer_Block.java:542)
	at codechicken.lib.render.block.BlockRenderingRegistry.renderBlock(BlockRenderingRegistry.java:93)

-- Block being tessellated --
Details:
	Block type: ID #248 (gt.blockmachines // gregtech.common.blocks.GT_Block_Machines)
	Block data value: 9 / 0x9 / 0b1001
	Block location: World: (70,64,163), Chunk: (at 6,4,3 in 4,10; contains blocks 64,0,160 to 79,255,175), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Stacktrace:
	at codechicken.lib.render.block.CCBlockRendererDispatcher.func_175018_a(CCBlockRendererDispatcher.java:53)

-- Affected level --
Details:
	Level name: MpServer
	All players: 1 total; [EntityPlayerSP['MauveCloud'/224, l='MpServer', x=59.10, y=63.00, z=117.07]]
	Chunk stats: MultiplayerChunkCache: 1089, 1089
	Level seed: 0
	Level generator: ID 00 - default, ver 1. Features enabled: false
	Level generator options: 
	Level spawn location: World: (56,64,256), Chunk: (at 8,4,0 in 3,16; contains blocks 48,0,256 to 63,255,271), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
	Level time: 13632622 game time, 13820090 day time
	Level dimension: 0
	Level storage version: 0x00000 - Unknown?
	Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
	Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false
	Forced entities: 48 total; [EntitySheep['Sheep'/128, l='MpServer', x=108.15, y=63.00, z=116.16], EntitySheep['Sheep'/129, l='MpServer', x=102.14, y=63.00, z=116.86], EntitySheep['Sheep'/130, l='MpServer', x=97.56, y=63.00, z=114.18], EntitySheep['Sheep'/131, l='MpServer', x=96.55, y=63.00, z=112.93], EntitySheep['Sheep'/132, l='MpServer', x=108.20, y=63.00, z=112.56], EntitySheep['Sheep'/133, l='MpServer', x=116.21, y=63.00, z=111.70], EntitySheep['Sheep'/154, l='MpServer', x=117.50, y=63.00, z=96.72], EntitySheep['Sheep'/155, l='MpServer', x=117.86, y=63.00, z=106.92], EntitySheep['Sheep'/156, l='MpServer', x=116.36, y=63.00, z=108.20], EntitySheep['Sheep'/157, l='MpServer', x=113.08, y=63.00, z=106.38], EntitySheep['Sheep'/158, l='MpServer', x=113.04, y=63.00, z=116.24], EntitySheep['Sheep'/159, l='MpServer', x=116.50, y=63.00, z=113.61], EntitySheep['Sheep'/160, l='MpServer', x=117.35, y=63.00, z=107.89], EntityBat['Bat'/30628, l='MpServer', x=87.14, y=17.79, z=142.61], EntityPlayerSP['MauveCloud'/224, l='MpServer', x=59.10, y=63.00, z=117.07], EntityBat['Bat'/14260, l='MpServer', x=57.31, y=19.42, z=158.82], EntitySheep['Sheep'/316, l='MpServer', x=84.81, y=69.00, z=45.79], EntitySheep['Sheep'/317, l='MpServer', x=94.71, y=70.00, z=43.45], EntityBat['Bat'/32446, l='MpServer', x=68.49, y=14.86, z=147.80], EntityPig['Pig'/319, l='MpServer', x=94.45, y=69.53, z=57.47], EntityBat['Bat'/30790, l='MpServer', x=76.72, y=23.97, z=60.86], EntitySheep['Sheep'/331, l='MpServer', x=74.78, y=71.00, z=46.51], EntityBat['Bat'/76, l='MpServer', x=58.75, y=42.10, z=124.75], EntitySheep['Sheep'/333, l='MpServer', x=49.20, y=67.00, z=63.55], EntityBat['Bat'/88, l='MpServer', x=68.03, y=59.10, z=106.99], EntityBat['Bat'/89, l='MpServer', x=72.17, y=55.10, z=109.61], EntityBat['Bat'/90, l='MpServer', x=71.75, y=56.10, z=108.25], EntityBat['Bat'/91, l='MpServer', x=68.91, y=56.10, z=112.15], EntityPig['Pig'/351, l='MpServer', x=122.28, y=69.00, z=55.51], EntityPig['Pig'/352, l='MpServer', x=126.67, y=71.50, z=60.50], EntitySheep['Sheep'/105, l='MpServer', x=95.23, y=63.00, z=107.30], EntitySheep['Sheep'/106, l='MpServer', x=85.46, y=63.00, z=96.81], EntitySheep['Sheep'/107, l='MpServer', x=104.26, y=63.00, z=109.42], EntityBat['Bat'/26603, l='MpServer', x=-15.54, y=52.28, z=184.88], EntitySheep['Sheep'/108, l='MpServer', x=93.45, y=63.00, z=98.65], EntityBat['Bat'/109, l='MpServer', x=86.94, y=50.10, z=112.83], EntitySheep['Sheep'/110, l='MpServer', x=91.71, y=63.00, z=116.50], EntitySheep['Sheep'/117, l='MpServer', x=108.40, y=63.00, z=97.77], EntitySheep['Sheep'/118, l='MpServer', x=103.24, y=63.00, z=97.91], EntitySheep['Sheep'/119, l='MpServer', x=108.21, y=63.00, z=106.38], EntitySheep['Sheep'/120, l='MpServer', x=100.06, y=63.00, z=96.23], EntitySheep['Sheep'/121, l='MpServer', x=104.78, y=63.00, z=98.89], EntitySheep['Sheep'/122, l='MpServer', x=103.80, y=63.00, z=96.48], EntitySheep['Sheep'/123, l='MpServer', x=106.02, y=63.00, z=99.62], EntitySheep['Sheep'/124, l='MpServer', x=104.22, y=63.00, z=107.01], EntitySheep['Sheep'/125, l='MpServer', x=102.55, y=63.00, z=104.80], EntitySheep['Sheep'/126, l='MpServer', x=101.23, y=63.00, z=106.79], EntitySheep['Sheep'/127, l='MpServer', x=101.10, y=63.00, z=97.13]]
	Retry entities: 0 total; []
	Server brand: fml,forge
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.client.multiplayer.WorldClient.func_72914_a(WorldClient.java:415)
	at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2660)
	at net.minecraft.client.renderer.chunk.ChunkRenderWorker.run(SourceFile:49)
	at java.lang.Thread.run(Thread.java:745)

-- System Details --
Details:
	Minecraft Version: 1.10.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_101, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 4048651680 bytes (3861 MB) / 7520387072 bytes (7172 MB) up to 11453595648 bytes (10923 MB)
	JVM Flags: 3 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xms512m -Xmx12288m
	IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
	FML: MCP 9.32 Powered by Forge 12.18.3.2254 21 mods loaded, 21 mods active
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
	UCHIJAAAA	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
	UCHIJAAAA	FML{8.0.99.99} [Forge Mod Loader] (forge-1.10.2-12.18.3.2254-universal.jar) 
	UCHIJAAAA	Forge{12.18.3.2254} [Minecraft Forge] (forge-1.10.2-12.18.3.2254-universal.jar) 
	UCHIJAAAA	OpenComputers|Core{1.6.2.7} [OpenComputers (Core)] (minecraft.jar) 
	UCHIJAAAA	ccl-entityhook{1.0} [ccl-entityhook] (CodeChickenLib-1.10.2-2.5.6.233-universal.jar) 
	UCHIJAAAA	Batty's Coordinates PLUS{1.10.0_001} [Batty's Coordinates PLUS Mod for Forge] (Batty's Coordinates PLUS Mod for Forge-1.10.0_001.jar) 
	UCHIJAAAA	bdlib{1.12.3.22} [BD Lib] (bdlib-1.12.3.22-mc1.10.2.jar) 
	UCHIJAAAA	CodeChickenLib{2.5.6.233} [CodeChicken Lib] (CodeChickenLib-1.10.2-2.5.6.233-universal.jar) 
	UCHIJAAAA	crafttweakerjei{1.0.1} [CraftTweaker JEI Support] (CraftTweaker-1.10.2-3.0.22.jar) 
	UCHIJAAAA	JEI{3.14.7.413} [Just Enough Items] (jei_1.10.2-3.14.7.413.jar) 
	UCHIJAAAA	MineTweaker3{3.0.22} [MineTweaker 3] (CraftTweaker-1.10.2-3.0.22.jar) 
	UCHIJAAAA	ctgui{1.0.0} [CT-GUI] (CraftTweaker-1.10.2-3.0.22.jar) 
	UCHIJAAAA	fastleafdecay{v11} [Fast Leaf Decay] (FastLeafDecay-v11.jar) 
	UCHIJAAAA	IC2{2.6.170-ex110} [IndustrialCraft 2] (industrialcraft-2-2.6.170-ex110.jar) 
	UCHIJAAAA	gregtech{MC1.10.2} [GregTech] (gregtech-5.10.40custom.jar) 
	UCHIJAAAA	inventorytweaks{1.61-58-a1fd884} [Inventory Tweaks] (InventoryTweaks-1.61-58.jar) 
	UCHIJAAAA	ironchest{1.10.2-7.0.11.797} [Iron Chest] (ironchest-1.10.2-7.0.11.797.jar) 
	UCHIJAAAA	mousetweaks{2.8} [Mouse Tweaks] (MouseTweaks-2.8-mc1.10.2.jar) 
	UCHIJAAAA	OpenComputers{1.6.2.7} [OpenComputers] (OpenComputers-MC1.10.2-1.6.2.7.jar) 
	UCHIJAAAA	pressure{1.3.1.24} [Pressure Pipes] (pressure-1.3.1.24-mc1.10.2.jar) 
	UCHIJAAAA	Waila{1.7.0} [Waila] (Waila-1.7.0-B3_1.9.4.jar) 
	Loaded coremods (and transformers): 
IC2core (industrialcraft-2-2.6.170-ex110.jar)
  
CCLCorePlugin (CodeChickenLib-1.10.2-2.5.6.233-universal.jar)
  codechicken.lib.asm.ClassHeirachyManager
  codechicken.lib.asm.CCL_ASMTransformer
FMLPlugin (InventoryTweaks-1.61-58.jar)
  invtweaks.forge.asm.ContainerTransformer
TransformerLoader (OpenComputers-MC1.10.2-1.6.2.7.jar)
  li.cil.oc.common.asm.ClassTransformer
	GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
	List of loaded APIs: 
		* JustEnoughItemsAPI (4.10.1) from jei_1.10.2-3.14.7.413.jar
		* MouseTweaks|API (1.0) from MouseTweaks-2.8-mc1.10.2.jar
		* OpenComputersAPI|Component (6.0.0-alpha) from OpenComputers-MC1.10.2-1.6.2.7.jar
		* OpenComputersAPI|Core (6.0.0-alpha) from OpenComputers-MC1.10.2-1.6.2.7.jar
		* OpenComputersAPI|Driver (6.0.0-alpha) from OpenComputers-MC1.10.2-1.6.2.7.jar
		* OpenComputersAPI|Driver|Item (6.0.0-alpha) from OpenComputers-MC1.10.2-1.6.2.7.jar
		* OpenComputersAPI|Event (6.0.0-alpha) from OpenComputers-MC1.10.2-1.6.2.7.jar
		* OpenComputersAPI|FileSystem (6.0.0-alpha) from OpenComputers-MC1.10.2-1.6.2.7.jar
		* OpenComputersAPI|Internal (6.0.0-alpha) from OpenComputers-MC1.10.2-1.6.2.7.jar
		* OpenComputersAPI|Machine (6.0.0-alpha) from OpenComputers-MC1.10.2-1.6.2.7.jar
		* OpenComputersAPI|Manual (6.0.0-alpha) from OpenComputers-MC1.10.2-1.6.2.7.jar
		* OpenComputersAPI|Network (6.0.0-alpha) from OpenComputers-MC1.10.2-1.6.2.7.jar
		* OpenComputersAPI|Prefab (6.0.0-alpha) from OpenComputers-MC1.10.2-1.6.2.7.jar
		* pressureAPI (1.3.1.24) from pressure-1.3.1.24-mc1.10.2.jar
		* WailaAPI (1.3) from Waila-1.7.0-B3_1.9.4.jar
	CodeChickenLib Invalid Fingerprint Reports: 
	Launched Version: MultiMC5
	LWJGL: 2.9.1
	OpenGL: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
	GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

	Using VBOs: Yes
	Is Modded: Definitely; Client brand changed to 'fml,forge'
	Type: Client (map_client.txt)
	Resource Packs: PureBDcraft 128x MC110.zip, PureBDcraft Customisation MC110.zip, Sphax128x_IC2_Ver2.6.108.zip, Sphax128x_Pressure_Pipes_Ver1.3.1.16.zip, [1.10.2] [128x] Sphax Patch - OpenComputers.zip, [1.10.2] [128x] Sphax Patch - GregTech.zip, Sphax_IronChests_1.10_128x.zip
	Current Language: English (US)
	Profiler Position: N/A (disabled)
	CPU: 8x Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz

Initially I thought it might be related to updating Forge, but rolling back to Forge build 2079 (as listed in GT 5.10's build.properties) didn't help.

Edit: also tried rolling back CodeChickenLib to build 178 (the closest build after 162 that build.properties lists that I could find on CurseForge), and it still crashed.

@MauveCloud
Copy link
Collaborator Author

I took a stab at debugging this - codechicken.lib.render.BlockRenderer$BlockFace.loadCuboidFace looks like this:

        public BlockFace loadCuboidFace(Cuboid6 c, int side) {
            double x1 = c.min.x;
            double x2 = c.max.x;
            double y1 = c.min.y;
            double y2 = c.max.y;
            double z1 = c.min.z;
            double z2 = c.max.z;
       /* ... */
       }

line 53 is the assignment to x2, indicating that the Cuboid6 exists, but c.max is null (while c.min is non-null). I could only think of two ways that could happen:

  1. RenderBlocks.setBounds was called with an incomplete Cuboid6.
  2. The Cuboid6 passed to RenderBlocks.setBounds becomes incomplete sometime between that call and the call to RenderBlocks.renderFace (since it was stored as a reference, instead of copied as a new Cuboid6).

Thus, I tried changing RenderBlocks.setBounds to copy the values from the passed Cuboid6 into local variables, then creating a new Cuboid6 with them to set the static "bounds" variable with. If way 1 was correct, the game would now crash in setBounds instead of in renderFace, and I'd be able to track down why only the max vector was null); if way 2 was correct, the game would no longer crash this way at all. Instead, it crashed in the same place as before, leaving me very confused.

Adding a try-catch to squelch the NPE for the first line of RenderBlocks.renderFace (which isn't good practice, I know) seems to at least prevent this crash and make the mod technically playable for now.

@Dragon2488
Copy link
Collaborator

Stop doing "i fixed it locally but i won't pull request".

@MauveCloud
Copy link
Collaborator Author

MauveCloud commented Mar 10, 2017

Stop doing "i fixed it locally but i won't pull request".

Sorry, but

  1. Most of my local fixes so far are so small they're simple to explain without a pull request.
  2. I don't know GitHub well enough to import the new branches into my existing fork - if you can find me a good explanation for how to do that, I'd be happy to set up a pull request with some of the fixes I came up with.
  3. This particular local change is a hacky temporary workaround, rather than a fix, so it wouldn't belong in a pull request.

Edit: I thought of a slightly less-hacky way to deal with this bug (still not a true fix IMO), and I've deleted my repo and re-forked (which picked up the extra branches). I'll set up the pull request soon with at least my other fixes. If my new idea works, I'll include it as well.

@MauveCloud
Copy link
Collaborator Author

MauveCloud commented Mar 12, 2017

😞
My new workaround wasn't as effective as I thought. I tested for a little over 20 minutes before setting up the pull request, but at around 50 minutes it crashed.

@draknyte1
Copy link
Collaborator

Try/Catch Throwable on everything.
Problem solved.

@Exidex Exidex added the fixed label Aug 11, 2017
@Exidex Exidex closed this as completed Aug 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants