Terasology / MetalRenegades

A harsh western world with a robotic twist.
6 stars 16 forks source link

Rail placement seems able to break a chunk generator thread #125

Open Cervator opened 3 years ago

Cervator commented 3 years ago

At least that's my interpretation of the log + game conditions where I've been able to both find single broken chunks and completely stalled chunk generation. Not entirely sure what the symptom would be here as I accidentally closed the game before inspecting the area. Log only seems to indicate a single chunk generation thread dying though, to an index out of bounds exception:

...
21:04:37.197 [main] WARN  o.t.l.nameTags.PlayerNameTagSystem - Can't create player based name tag for character as owner has no client component
21:04:39.530 [main] ERROR o.t.e.e.internal.PojoEntityManager - Adding a component (class org.terasology.network.NetworkComponent) over an existing component for entity 2539
21:04:39.644 [main] ERROR o.t.e.event.internal.EventSystemImpl - Failed to invoke event
java.lang.ArrayIndexOutOfBoundsException: -3839
        at gnu.trove.map.hash.TLongObjectHashMap.rehash(TLongObjectHashMap.java:165)
        at gnu.trove.impl.hash.THash.postInsertHook(THash.java:388)
        at gnu.trove.map.hash.TLongObjectHashMap.doPut(TLongObjectHashMap.java:248)
        at gnu.trove.map.hash.TLongObjectHashMap.put(TLongObjectHashMap.java:222)
        at org.terasology.entitySystem.entity.internal.ComponentTable.put(ComponentTable.java:52)
        at org.terasology.entitySystem.entity.EntityBuilder.lambda$build$0(EntityBuilder.java:111)
        at java.util.HashMap$Values.forEach(HashMap.java:980)
        at org.terasology.entitySystem.entity.EntityBuilder.build(EntityBuilder.java:111)
        at org.terasology.entitySystem.entity.EntityBuilder.buildWithoutLifecycleEvents(EntityBuilder.java:135)
        at org.terasology.world.internal.EntityAwareWorldProvider.createBlockEntity(EntityAwareWorldProvider.java:394)
        at org.terasology.world.internal.EntityAwareWorldProvider.getBlockEntityAt(EntityAwareWorldProvider.java:273)
        at org.terasology.minecarts.blocks.RailsBlockFamilyUpdateSystem.processUpdateForBlockLocation(RailsBlockFamilyUpdateSystem.java:150)
        at org.terasology.minecarts.blocks.RailsBlockFamilyUpdateSystem.blockUpdate(RailsBlockFamilyUpdateSystem.java:139)
        at org.terasology.minecarts.blocks.RailsBlockFamilyUpdateSystemMethodAccess.invoke(Unknown Source)
        at org.terasology.entitySystem.event.internal.EventSystemImpl$ByteCodeEventHandlerInfo.invoke(EventSystemImpl.java:531)
        at org.terasology.entitySystem.event.internal.EventSystemImpl.sendStandardEvent(EventSystemImpl.java:292)
        at org.terasology.entitySystem.event.internal.EventSystemImpl.send(EventSystemImpl.java:283)
        at org.terasology.entitySystem.entity.internal.BaseEntityRef.send(BaseEntityRef.java:205)
        at org.terasology.world.internal.EntityAwareWorldProvider.updateBlockEntity(EntityAwareWorldProvider.java:202)
        at org.terasology.world.internal.EntityAwareWorldProvider.setBlock(EntityAwareWorldProvider.java:133)
        at org.terasology.world.internal.EntityAwareWorldProvider.setBlock(EntityAwareWorldProvider.java:120)
        at org.terasology.world.internal.WorldProviderWrapper.setBlock(WorldProviderWrapper.java:67)
        at org.terasology.dynamicCities.construction.Construction.onSetBlockEvent(Construction.java:679)
        at org.terasology.dynamicCities.construction.ConstructionMethodAccess.invoke(Unknown Source)
        at org.terasology.entitySystem.event.internal.EventSystemImpl$ByteCodeEventHandlerInfo.invoke(EventSystemImpl.java:531)
        at org.terasology.entitySystem.event.internal.EventSystemImpl.sendConsumableEvent(EventSystemImpl.java:302)
        at org.terasology.entitySystem.event.internal.EventSystemImpl.send(EventSystemImpl.java:281)
        at org.terasology.entitySystem.entity.internal.BaseEntityRef.send(BaseEntityRef.java:205)
        at org.terasology.dynamicCities.construction.Construction.flatten(Construction.java:302)
        at org.terasology.dynamicCities.construction.Construction.flatten(Construction.java:318)
        at org.terasology.dynamicCities.construction.Construction.buildParcel(Construction.java:385)
        at org.terasology.dynamicCities.settlements.SettlementEntityManager.build(SettlementEntityManager.java:419)
        at org.terasology.dynamicCities.settlements.SettlementEntityManager.onWorldTimeEvent(SettlementEntityManager.java:172)
        at org.terasology.dynamicCities.settlements.SettlementEntityManagerMethodAccess.invoke(Unknown Source)
        at org.terasology.entitySystem.event.internal.EventSystemImpl$ByteCodeEventHandlerInfo.invoke(EventSystemImpl.java:531)
        at org.terasology.entitySystem.event.internal.EventSystemImpl.sendStandardEvent(EventSystemImpl.java:292)
        at org.terasology.entitySystem.event.internal.EventSystemImpl.send(EventSystemImpl.java:283)
        at org.terasology.entitySystem.entity.internal.BaseEntityRef.send(BaseEntityRef.java:205)
        at org.terasology.world.time.WorldTimeImpl.update(WorldTimeImpl.java:86)
        at org.terasology.engine.modes.StateIngame.update(StateIngame.java:171)
        at org.terasology.engine.TerasologyEngine.tick(TerasologyEngine.java:470)
        at org.terasology.engine.TerasologyEngine.mainLoop(TerasologyEngine.java:433)
        at org.terasology.engine.TerasologyEngine.run(TerasologyEngine.java:409)
        at org.terasology.engine.Terasology.main(Terasology.java:174)
21:04:39.646 [Chunk-Processing-Reactor] ERROR o.t.w.c.p.ChunkProcessingPipeline - ChunkTask at position (-1.600E+1  0.000E+0  1.500E+1) and stage [Chunk ready] catch error:
java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: -1
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)
        at org.terasology.world.chunks.pipeline.PositionFuture.get(PositionFuture.java:49)
        at org.terasology.world.chunks.pipeline.ChunkProcessingPipeline.onStageDone(ChunkProcessingPipeline.java:121)
        at org.terasology.world.chunks.pipeline.ChunkProcessingPipeline.chunkTaskHandler(ChunkProcessingPipeline.java:108)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
        at gnu.trove.map.hash.TLongObjectHashMap.rehash(TLongObjectHashMap.java:165)
        at gnu.trove.impl.hash.THash.postInsertHook(THash.java:388)
        at gnu.trove.map.hash.TLongObjectHashMap.doPut(TLongObjectHashMap.java:248)
        at gnu.trove.map.hash.TLongObjectHashMap.put(TLongObjectHashMap.java:222)
        at org.terasology.entitySystem.entity.internal.ComponentTable.put(ComponentTable.java:52)
        at org.terasology.entitySystem.entity.internal.PojoEntityManager.lambda$addComponent$8(PojoEntityManager.java:553)
        at java.util.Optional.map(Optional.java:215)
        at org.terasology.entitySystem.entity.internal.PojoEntityManager.addComponent(PojoEntityManager.java:553)
        at org.terasology.entitySystem.entity.internal.BaseEntityRef.addComponent(BaseEntityRef.java:168)
        at org.terasology.entitySystem.entity.internal.BaseEntityRef.getEntityInfo(BaseEntityRef.java:261)
        at org.terasology.entitySystem.entity.internal.BaseEntityRef.isPersistent(BaseEntityRef.java:52)
        at org.terasology.persistence.internal.EntitySetDeltaRecorder.onEntityComponentAdded(EntitySetDeltaRecorder.java:60)
        at org.terasology.persistence.internal.ReadWriteStorageManager.onEntityComponentAdded(ReadWriteStorageManager.java:514)
        at org.terasology.entitySystem.entity.internal.PojoEntityManager.notifyComponentAdded(PojoEntityManager.java:726)
        at org.terasology.entitySystem.entity.internal.PojoEntityManager.addComponent(PojoEntityManager.java:557)
        at org.terasology.entitySystem.entity.internal.BaseEntityRef.addComponent(BaseEntityRef.java:168)
        at org.terasology.world.chunks.localChunkProvider.LocalChunkProvider.generateQueuedEntities(LocalChunkProvider.java:260)
        at java.util.ArrayList.forEach(ArrayList.java:1249)
        at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080)
        at org.terasology.world.chunks.localChunkProvider.LocalChunkProvider.processReadyChunk(LocalChunkProvider.java:231)
        at org.terasology.world.chunks.pipeline.stages.ChunkTaskProvider.lambda$null$1(ChunkTaskProvider.java:41)
        at org.terasology.world.chunks.pipeline.stages.SingleChunkTask.apply(SingleChunkTask.java:44)
        at org.terasology.world.chunks.pipeline.stages.SingleChunkTask.apply(SingleChunkTask.java:17)
        at org.terasology.world.chunks.pipeline.ChunkProcessingPipeline.lambda$runTask$4(ChunkProcessingPipeline.java:180)
        at org.terasology.world.chunks.pipeline.ChunkProcessingPipeline$PositionalCallable.call(ChunkProcessingPipeline.java:320)
        at org.terasology.world.chunks.pipeline.ChunkProcessingPipeline$PositionalCallable.call(ChunkProcessingPipeline.java:305)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.terasology.world.chunks.pipeline.PositionFuture.run(PositionFuture.java:29)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        ... 1 common frames omitted
21:04:42.421 [main] WARN  o.t.l.nameTags.PlayerNameTagSystem - Can't create player based name tag for character as owner has no client component
...
Cervator commented 3 years ago

The exception here is the exact same as two crashes I hit, but not the stacktrace, and this didn't crash ... but linking to https://github.com/MovingBlocks/Terasology/issues/4362 anyway just in case. Probably related to flying around with hspeed on, although I haven't hit another bit of rail generation yet (and saw one work a little while before)