This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
pairo_'s profile picture

[1.6.4][SSP] Game Crash on Turtle startup / Ticking Tile Entity

Started by pairo_, 15 May 2014 - 05:39 PM
pairo_ #1
Posted 15 May 2014 - 07:39 PM
Hello People, thanks for this mod and making it even better!

Running CC1.63 and recommended 1.6.4 Forge.

My world seems unplayable now as when I load the world it instantly crashes.
I have had this problem before when I walked away from/towards my Nether base, seemingly far/near enough to load/unload the chunks my turtles are in. They are all running startup programs to slay Blazes, activate pistons and place minecarts on tracks. The client then crashed and one or two seconds after reloading the world the crash recurred, maybe 2 or 3 times. The short moment between the crashes allowed me to move a bit further and leave the critical area of loading/unloading the chunks.

Now I set up a treefarm with felling turtles that are monitoring the growth of trees and, when the tree has grown, cut them down. In the same manner as with the nether base, they are running startup programs to resume their work after loading/unloading. In this case I am crashing now immediately after loading the world (I don't get to see my world even for a fraction of a second, it immediately crashes).

I am not sure how to reproduce this bug (it's not just startup-ing any given program). While setting up my farm I several times reloaded my world and I didn't have such problems.

Crash:

—- Minecraft Crash Report —-
// I feel sad now :(/>

Time: 5/15/14 8:14 PM
Description: Ticking tile entity

java.lang.NullPointerException
at dan200.computercraft.shared.turtle.core.TurtleCompareCommand.execute(TurtleCompareCommand.java:102)
at dan200.computercraft.shared.turtle.core.TurtleBrain.updateCommands(TurtleBrain.java:776)
at dan200.computercraft.shared.turtle.core.TurtleBrain.update(TurtleBrain.java:92)
at dan200.computercraft.shared.turtle.blocks.TileTurtle.func_70316_g(TileTurtle.java:255)
at net.minecraft.world.World.func_72939_s(World.java:2209)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:550)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:668)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:587)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:129)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484)
at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:583)


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

– Head –
Stacktrace:
at dan200.computercraft.shared.turtle.core.TurtleCompareCommand.execute(TurtleCompareCommand.java:102)
at dan200.computercraft.shared.turtle.core.TurtleBrain.updateCommands(TurtleBrain.java:776)
at dan200.computercraft.shared.turtle.core.TurtleBrain.update(TurtleBrain.java:92)
at dan200.computercraft.shared.turtle.blocks.TileTurtle.func_70316_g(TileTurtle.java:255)

– Tile entity being ticked –
Details:
Name: turtleex // dan200.computercraft.shared.turtle.blocks.TileTurtleExpanded
Block type: ID #1228 (tile.ccturtle // dan200.computercraft.shared.turtle.blocks.BlockTurtle)
Block data value: 0 / 0x0 / 0b0000
Block location: World: (1159,63,-1262), Chunk: (at 7,3,2 in 72,-79; contains blocks 1152,0,-1264 to 1167,255,-1249), Region: (2,-3; contains chunks 64,-96 to 95,-65, blocks 1024,0,-1536 to 1535,255,-1025)
Actual block type: ID #1228 (tile.ccturtle // dan200.computercraft.shared.turtle.blocks.BlockTurtle)
Actual block data value: 0 / 0x0 / 0b0000
Stacktrace:
at net.minecraft.world.World.func_72939_s(World.java:2209)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:550)

– Affected level –
Details:
Level name: Pairons Mods
All players: 1 total; [EntityPlayerMP['pairo_'/167, l='Pairons Mods', x=1182.05, y=63.00, z=-1260.54]]
Chunk stats: ServerChunkCache: 1092 Drop: 0
Level seed: 5025712598147244127
Level generator: ID 00 - default, ver 1. Features enabled: true
Level generator options:
Level spawn location: World: (196,64,252), Chunk: (at 4,4,12 in 12,15; contains blocks 192,0,240 to 207,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Level time: 7868535 game time, 9353356 day time
Level dimension: 0
Level storage version: 0x04ABD - Anvil
Level weather: Rain time: 36714 (now: false), thunder time: 109719 (now: false)
Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false
Stacktrace:
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:668)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:587)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:129)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484)
at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:583)

– System Details –
Details:
Minecraft Version: 1.6.4
Operating System: Windows 8 (amd64) version 6.2
Java Version: 1.7.0_51, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 487459896 bytes (464 MB) / 1553989632 bytes (1482 MB) up to 7635730432 bytes (7282 MB)
JVM Flags: 2 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx8G
AABB Pool Size: 3661 (205016 bytes; 0 MB) allocated, 3513 (196728 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 2, tallocated: 64
FML: MCP v8.11 FML v6.4.49.965 Minecraft Forge 9.11.1.965 24 mods loaded, 24 mods active
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{6.4.49.965} [Forge Mod Loader] (minecraftforge-9.11.1.965.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{9.11.1.965} [Minecraft Forge] (minecraftforge-9.11.1.965.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
CodeChickenCore{0.9.0.9} [CodeChicken Core] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
NotEnoughItems{1.6.1.9} [Not Enough Items] (NotEnoughItems 1.6.1.9.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
BuildCraft|Core{4.2.2} [BuildCraft] (buildcraft-A-1.6.4-4.2.2.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
BuildCraft|Builders{4.2.2} [BC Builders] (buildcraft-A-1.6.4-4.2.2.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
BuildCraft|Energy{4.2.2} [BC Energy] (buildcraft-A-1.6.4-4.2.2.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
BuildCraft|Factory{4.2.2} [BC Factory] (buildcraft-A-1.6.4-4.2.2.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
BuildCraft|Transport{4.2.2} [BC Transport] (buildcraft-A-1.6.4-4.2.2.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
BuildCraft|Silicon{4.2.2} [BC Silicon] (buildcraft-A-1.6.4-4.2.2.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
ChickenChunks{1.3.3.4} [ChickenChunks] (ChickenChunks 1.3.3.4.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
CoFHCore{2.0.0.5} [CoFH Core] (CoFHCore-2.0.0.5.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
CoFHLoot{2.0.0.5} [CoFH Loot] (CoFHCore-2.0.0.5.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
CoFHMasquerade{2.0.0.5} [CoFH Masquerade] (CoFHCore-2.0.0.5.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
CoFHSocial{2.0.0.5} [CoFH Social] (CoFHCore-2.0.0.5.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
CoFHWorld{2.0.0.5} [CoFH World] (CoFHCore-2.0.0.5.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
ComputerCraft{1.63} [ComputerCraft] (ComputerCraft1.63.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
inventorytweaks{1.56} [Inventory Tweaks] (InventoryTweaks-MC1.6.2-1.56-b77.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
ForgeMultipart{1.0.0.219} [Forge Multipart] (ForgeMultipart-universal-1.6.4-1.0.0.219.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
ThermalExpansion{3.0.0.7} [Thermal Expansion] (ThermalExpansion-3.0.0.7.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
simplyjetpacks{0.1.4.1} [Simply Jetpacks] (SimplyJetpacks-0.1.4.1.jar.zip) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
McMultipart{1.0.0.219} [Minecraft Multipart Plugin] (ForgeMultipart-universal-1.6.4-1.0.0.219.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
ForgeMicroblock{1.0.0.219} [Forge Microblocks] (ForgeMultipart-universal-1.6.4-1.0.0.219.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Profiler Position: N/A (disabled)
Vec3 Pool Size: 1172 (65632 bytes; 0 MB) allocated, 1050 (58800 bytes; 0 MB) used
Player Count: 1 / 8; [EntityPlayerMP['pairo_'/167, l='Pairons Mods', x=1182.05, y=63.00, z=-1260.54]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'

My first post here, apologies if in the wrong place or similar mistakes.

Greetings,
pairo_
Lyqyd #2
Posted 15 May 2014 - 07:58 PM
Any chance you could temporarily disable one or more of the startup files to determine which turtle causes the crash? One of them is trying to do a turtle.compare() and that's where the crash is happening.
pairo_ #3
Posted 15 May 2014 - 08:29 PM
I can do that, but is it really going to help to know which one it is? I have 24 Turtles in that setup and they are all doing the same thing (at least they should). What exactly is it that you want to find out?
Lyqyd #4
Posted 15 May 2014 - 10:11 PM
I'm hoping to determine what the exact conditions of the comparison operation are; what exactly is the block the turtle is comparing and what is in the selected slot at the time. This will help establish simple and consistent reproduction instructions, which makes it much easier to fix the bug if it isn't immediately obvious from just looking at the source code.
pairo_ #5
Posted 15 May 2014 - 10:44 PM
Then shouldn't I rather give you the relevant part of my api and tell you the contents of the turtles inventories?
I am just the laziest fart you've ever met and don't want to see which of my 24 turtles causes the crash if they all do the same thing (they have identical folders, I copied them).

My "brainapi":

function lumberFarm()
rs.setOutput("bottom",true)
turtle.select(2)
if turtle.compare()==false then

turtle.select(1)
for i=1,7 do
turtle.dig()
turtle.digUp()
turtle.up()
end
repeat
turtle.down()
until turtle.detectDown()
rs.setOutput("bottom",true)
plantAndDrop()
end
while true do
detectTree()
cutDownTree()
plantAndDrop()
end
end

function plantAndDrop()
rs.setOutput("bottom",true)
turtle.select(2)
turtle.place()
turtle.select(1)
woodToDrop=turtle.getItemCount()-10
turtle.dropDown(woodToDrop)
end

function detectTree()
turtle.select(1)
if turtle.compare()==false then
for i=1,4 do
turtle.turnRight()
turtle.suck()
end
turtle.suckUp()
sleep(math.random(20,60))
detectTree()
end
end

function cutDownTree()
detectTree()
repeat
turtle.dig()
turtle.digUp()
turtle.up()
until turtle.detect()==false
repeat
turtle.down()
until turtle.detectDown()
rs.setOutput("bottom",true)
end

The startup:

os.loadAPI("brainapi")
brainapi.lumberFarm()

The first part in lumberFarm() which should be most relevant here is just making sure that quitting/loading the turtle doesn't mess with anything (like leaving half cut trees behind that prevents growing a new one).
To do that I turtle.compare() Birch Saplings, to either a Birch Sapling, Birch Wood, Air or Birch Leaves. Also very possible is that, since the farm is newly set up, the turtle ran out of the saplings.
In this case it would compare an empty slot (Air?) to either a Birch Sapling, Birch Wood, Air or Birch Leaves

As I get to the last part I realize that I shouln't be so lazy and just tell you which combination it is, so hold on, im going to try see which one it is and what its comparing. Still gonna post this already FYI, hold me back if you are quicker than me.

Okay, so turtle number #57 was the evil one it seems.
As I logged on after renaming #57s startup to startupx, it was "stuck", meaning just black screen on the turtle, not giving me the turtle OS or anything (had to terminate it first). Its inventory was empty and slot 1 was selected (strange, no? How is that possible with my API telling it before comparing anything to select slot 2?). So if it still made that comparison it should have compared an empty inventory slot to an air block…
Anything else I can do for you? Let me know…

Update:
Wanted to resume playing today and crashed again on logon… disabled more startups and #53 it was this time. It was showing CraftOS 1.6 without the need to terminate, had the empty slot 2 selected and must have compared it to air as well.
Edited on 16 May 2014 - 08:54 PM
ninnghazad #6
Posted 30 May 2014 - 01:14 PM
java.lang.NullPointerException
at dan200.computercraft.shared.turtle.core.TurtleCompareCommand.execute(TurtleCompareCommand.java:102)
at dan200.computercraft.shared.turtle.core.TurtleBrain.updateCommands(TurtleBrain.java:776)
at dan200.computercraft.shared.turtle.core.TurtleBrain.update(TurtleBrain.java:92)
at dan200.computercraft.shared.turtle.blocks.TileTurtle.func_70316_g(TileTurtle.java:255)
at net.minecraft.world.World.func_72939_s(World.java:2783)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:883)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:330)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:777)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:659)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)


– Tile entity being ticked –
Details:
Name: turtleadv // dan200.computercraft.shared.turtle.blocks.TileTurtleAdvanced
Block type: ID #1230 (tile.ccturtle // dan200.computercraft.shared.turtle.blocks.BlockTurtle)
Block data value: 0 / 0x0 / 0b0000
Block location: World: (590,67,-3864), Chunk: (at 14,4,8 in 36,-242; contains blocks 576,0,-3872 to 591,255,-3857), Region: (1,-8; contains chunks 32,-256 to 63,-225, blocks 512,0,-4096 to 1023,255,-3585)
Actual block type: ID #1230 (tile.ccturtle // dan200.computercraft.shared.turtle.blocks.BlockTurtle)
Actual block data value: 0 / 0x0 / 0b0000

Comparing not sure what (but something non-fancy, stone or cobble) in inventory to a placed fluiduct.
Disabling startup files and removing the fluiduct infront of the turtle "fixed" it.