Vanhal / ProgressiveAutomation

Progressive Automation
Other
49 stars 29 forks source link

Semi-rare crash on using PA Wrench #348

Closed Psycho-Ray closed 5 years ago

Psycho-Ray commented 7 years ago

`---- Minecraft Crash Report ----

WARNING: coremods are present: Inventory Tweaks Coremod (InventoryTweaks-1.62.jar) AppleCore (AppleCore-mc1.11.2-2.2.2.jar) IC2core (industrialcraft-2-2.7.85-ex111.jar) Contact their authors BEFORE contacting forge

// I just don't know what went wrong :(

Time: 9/18/17 1:50 PM Description: Unexpected error

java.util.ConcurrentModificationException at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:901) at java.util.ArrayList$Itr.next(ArrayList.java:851) at com.vanhal.progressiveautomation.events.EventRenderWorld.renderWorldLast(EventRenderWorld.java:119) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_176_EventRenderWorld_renderWorldLast_RenderWorldLastEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:185) at net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(ForgeHooksClient.java:166) at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at Reflector.callVoid(Reflector.java:547) at net.minecraft.client.renderer.EntityRenderer.func_175068_a(EntityRenderer.java:1912) at net.minecraft.client.renderer.EntityRenderer.func_78471_a(EntityRenderer.java:1590) at net.minecraft.client.renderer.EntityRenderer.func_181560_a(EntityRenderer.java:1361) at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1077) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:372) at net.minecraft.client.main.Main.main(SourceFile:124) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

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

-- Head -- Thread: Client thread Stacktrace: at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:901) at java.util.ArrayList$Itr.next(ArrayList.java:851) at com.vanhal.progressiveautomation.events.EventRenderWorld.renderWorldLast(EventRenderWorld.java:119) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_176_EventRenderWorld_renderWorldLast_RenderWorldLastEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:185) at net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(ForgeHooksClient.java:166) at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at Reflector.callVoid(Reflector.java:547) at net.minecraft.client.renderer.EntityRenderer.func_175068_a(EntityRenderer.java:1912) at net.minecraft.client.renderer.EntityRenderer.func_78471_a(EntityRenderer.java:1590)

-- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Psycho_Ray'/247, l='MpServer', x=-2.69, y=62.00, z=-16.49]] Chunk stats: MultiplayerChunkCache: 169, 169 Level seed: 0 Level generator: ID 04 - customized, ver 0. Features enabled: false Level generator options: Level spawn location: World: (140,64,216), Chunk: (at 12,4,8 in 8,13; contains blocks 128,0,208 to 143,255,223), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 903670 game time, 919816 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: 41 total; [EntityPig['Pig'/8192, l='MpServer', x=-28.28, y=71.00, z=30.49], EntitySheep['Sheep'/10497, l='MpServer', x=38.27, y=82.00, z=-83.50], EntityCow['Cow'/8705, l='MpServer', x=57.15, y=77.00, z=-7.69], EntitySheep['Sheep'/10498, l='MpServer', x=44.26, y=88.00, z=-86.54], EntitySheep['Sheep'/10499, l='MpServer', x=43.71, y=83.00, z=-82.49], EntityChicken['Chicken'/8709, l='MpServer', x=41.18, y=77.00, z=-45.45], EntityCow['Cow'/8710, l='MpServer', x=35.52, y=81.00, z=-39.18], EntityCow['Cow'/8715, l='MpServer', x=-40.24, y=64.00, z=54.35], EntityCow['Cow'/271, l='MpServer', x=53.82, y=72.00, z=9.52], EntityCow['Cow'/291, l='MpServer', x=-14.15, y=69.00, z=-16.56], EntityPig['Pig'/35, l='MpServer', x=13.31, y=77.00, z=38.45], EntityCow['Cow'/36, l='MpServer', x=1.55, y=79.00, z=45.45], EntityPig['Pig'/37, l='MpServer', x=10.54, y=80.00, z=39.73], EntityPig['Pig'/38, l='MpServer', x=0.45, y=79.00, z=45.58], EntityPig['Pig'/39, l='MpServer', x=13.71, y=74.00, z=46.36], EntityPig['Pig'/40, l='MpServer', x=21.41, y=72.00, z=46.75], EntityChicken['Chicken'/8749, l='MpServer', x=-45.40, y=65.00, z=-41.49], EntityPig['Pig'/47, l='MpServer', x=15.54, y=71.00, z=57.32], EntityCow['Cow'/58, l='MpServer', x=56.85, y=67.00, z=61.47], EntityCow['Cow'/315, l='MpServer', x=14.45, y=68.56, z=-11.53], EntityPlayerSP['Psycho_Ray'/247, l='MpServer', x=-2.69, y=62.00, z=-16.49], EntityCow['Cow'/64, l='MpServer', x=63.78, y=64.00, z=35.51], EntitySheep['Sheep'/8800, l='MpServer', x=72.50, y=85.00, z=-59.50], EntitySheep['Sheep'/8801, l='MpServer', x=64.50, y=81.00, z=-53.27], EntityCow['Cow'/8806, l='MpServer', x=-61.39, y=63.00, z=50.85], EntityCow['Cow'/8810, l='MpServer', x=-48.44, y=67.00, z=-38.16], EntityChicken['Chicken'/7530, l='MpServer', x=-1.50, y=69.00, z=9.50], EntityPig['Pig'/8313, l='MpServer', x=-29.21, y=72.00, z=33.49], EntityCow['Cow'/8314, l='MpServer', x=-24.85, y=86.00, z=44.53], EntityCow['Cow'/8848, l='MpServer', x=-44.23, y=71.00, z=-63.49], EntityChicken['Chicken'/8849, l='MpServer', x=-39.13, y=67.00, z=-58.52], EntityItem['item.item.egg'/28358, l='MpServer', x=-2.28, y=70.00, z=10.33], EntityCow['Cow'/10443, l='MpServer', x=-64.14, y=63.00, z=59.66], EntitySheep['Sheep'/10451, l='MpServer', x=19.27, y=82.00, z=-89.50], EntitySheep['Sheep'/10452, l='MpServer', x=31.19, y=80.00, z=-85.50], EntitySheep['Sheep'/10453, l='MpServer', x=26.13, y=80.00, z=-86.52], EntitySheep['Sheep'/10460, l='MpServer', x=57.55, y=82.00, z=-80.53], EntitySheep['Sheep'/10462, l='MpServer', x=53.49, y=81.00, z=-72.18], EntityItem['item.item.egg'/27870, l='MpServer', x=-45.48, y=65.00, z=-41.62], EntityCow['Cow'/10469, l='MpServer', x=-55.20, y=79.00, z=-68.50], EntityPlayerSP['Psycho_Ray'/247, l='MpServer', x=-4.53, y=69.00, z=-13.19]] 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:524) at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2655) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:401) at net.minecraft.client.main.Main.main(SourceFile:124) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details -- Details: Minecraft Version: 1.11.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_25, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 637959816 bytes (608 MB) / 2134114304 bytes (2035 MB) up to 2134114304 bytes (2035 MB) JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx2G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M IntCache: cache: 0, tcache: 2, allocated: 14, tallocated: 92 FML: MCP 9.38 Powered by Forge 13.20.1.2476 Optifine OptiFine_1.11.2_HD_U_C3 28 mods loaded, 28 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA minecraft{1.11.2} [Minecraft] (minecraft.jar) UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forge-1.11.2-13.20.1.2476.jar) UCHIJAAAA forge{13.20.1.2476} [Minecraft Forge] (forge-1.11.2-13.20.1.2476.jar) UCHIJAAAA applecore{2.2.2} [AppleCore] (AppleCore-mc1.11.2-2.2.2.jar) UCHIJAAAA jei{4.5.1.296} [Just Enough Items] (jei_1.11.2-4.5.1.296.jar) UCHIJAAAA appleskin{1.0.8} [AppleSkin] (AppleSkin-mc1.11-1.0.8.jar) UCHIJAAAA buildcraftlib{7.99.7} [BuildCraft Lib] (buildcraft-7.99.7-ALPHA.jar) UCHIJAAAA buildcraftcore{7.99.7} [BuildCraft] (buildcraft-7.99.7-ALPHA.jar) UCHIJAAAA buildcraftbuilders{7.99.7} [BC Builders] (buildcraft-7.99.7-ALPHA.jar) UCHIJAAAA buildcraftenergy{7.99.7} [BC Energy] (buildcraft-7.99.7-ALPHA.jar) UCHIJAAAA buildcraftfactory{7.99.7} [BC Factory] (buildcraft-7.99.7-ALPHA.jar) UCHIJAAAA buildcraftrobotics{7.99.7} [BC Robotics] (buildcraft-7.99.7-ALPHA.jar) UCHIJAAAA buildcraftsilicon{7.99.7} [BC Silicon] (buildcraft-7.99.7-ALPHA.jar) UCHIJAAAA buildcrafttransport{7.99.7} [BC Transport] (buildcraft-7.99.7-ALPHA.jar) UCHIJAAAA chameleon{1.11.2-3.1.0} [Chameleon] (Chameleon-1.11.2-3.1.0.jar) UCHIJAAAA chesttransporter{2.7.13} [Chest Transporter] (ChestTransporter-1.11.2-2.7.13.jar) UCHIJAAAA energyconverters{1.0.1.22} [Energy Converters] (energyconverters_1.11.2-1.0.1.22.jar) UCHIJAAAA mantle{1.11.2-1.2.0.26} [Mantle] (Mantle-1.11.2-1.2.0.26.jar) UCHIJAAAA tconstruct{1.11.2-2.7.1.34} [Tinkers' Construct] (TConstruct-1.11.2-2.7.1.34.jar) UCHIJAAAA immersiveengineering{0.11-63} [Immersive Engineering] (ImmersiveEngineering-0.11-63.jar) UCHIJAAAA ic2{2.7.85-ex111} [IndustrialCraft 2] (industrialcraft-2-2.7.85-ex111.jar) UCHIJAAAA inventorytweaks{1.62+release.90.40cf8fc} [Inventory Tweaks] (InventoryTweaks-1.62.jar) UCHIJAAAA journeymap{1.11.2-5.4.7} [JourneyMap] (journeymap-1.11.2-5.4.7.jar) UCHIJAAAA progressiveautomation{@VERSION@} [Progressive Automation] (ProgressiveAutomation-1.7.5-1.11.2-Custom-Beta-1.7.5.jar) UCHIJAAAA spiceoflife{1.3.9} [The Spice of Life] (SpiceOfLife-mc1.11.2-1.3.9.jar) UCHIJAAAA storagedrawers{1.11.2-4.2.10} [Storage Drawers] (StorageDrawers-1.11.2-4.2.10.jar) UCHIJAAAA waila{1.7.1} [waila] (Waila-1.7.1_1.11.2.jar) Loaded coremods (and transformers): Inventory Tweaks Coremod (InventoryTweaks-1.62.jar) invtweaks.forge.asm.ContainerTransformer AppleCore (AppleCore-mc1.11.2-2.2.2.jar) squeek.applecore.asm.TransformerModuleHandler IC2core (industrialcraft-2-2.7.85-ex111.jar)

GL info: ' Vendor: 'Intel' Version: '4.0.0 - Build 10.18.10.4358' Renderer: 'Intel(R) HD Graphics 4000'
Pulsar/tconstruct loaded Pulses: 
    - TinkerCommons (Enabled/Forced)
    - TinkerWorld (Enabled/Not Forced)
    - TinkerTools (Enabled/Not Forced)
    - TinkerHarvestTools (Enabled/Forced)
    - TinkerMeleeWeapons (Enabled/Forced)
    - TinkerRangedWeapons (Enabled/Forced)
    - TinkerModifiers (Enabled/Forced)
    - TinkerSmeltery (Enabled/Not Forced)
    - TinkerGadgets (Enabled/Not Forced)
    - TinkerOredict (Enabled/Forced)
    - TinkerIntegration (Enabled/Forced)
    - TinkerFluids (Enabled/Forced)
    - TinkerMaterials (Enabled/Forced)
    - TinkerModelRegister (Enabled/Forced)

Launched Version: 1.11.2-forge1.11.2-13.20.1.2476
LWJGL: 2.9.4
OpenGL: Intel(R) HD Graphics 4000 GL version 4.0.0 - Build 10.18.10.4358, Intel
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: JSTR_Modded_Universal - 1.9.3.zip (incompatible)
Current Language: English (US)
Profiler Position: N/A (disabled)
CPU: 4x Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
OptiFine Version: OptiFine_1.11.2_HD_U_C3
Render Distance Chunks: 6
Mipmaps: 4
Anisotropic Filtering: 1
Antialiasing: 0
Multitexture: false
Shaders: null
OpenGlVersion: 4.0.0 - Build 10.18.10.4358
OpenGlRenderer: Intel(R) HD Graphics 4000
OpenGlVendor: Intel
CpuCount: 4`

So, all those lines happened, but fear not. Apparently, there is a method of the class EventRenderWorld that will show the area of action of all machines when you're holding a wrench. This method iterates through a list, and said list may be modified by another method (of the same class, I think) when you dismantle a machine. If it happens during the list iteration (presumably because both are being processed in parallel, which would explain why it's kinda rare), the game crashes, because the iterator might have been changed.

This is what I think is happening, and I'll try to fix it later. I decided to write about it here... because I'm too lazy to fix right now. If any one has any idea of how to solve this kind of problem (thread safety, parallelism, or whatever it's called), please share your ideas. I have few experience in this area.

winsrp commented 6 years ago

well programming wise, you can do 2 things, first when iterating don't use the original list, just make a clone of the list first then loop, or not sure if java has this, you can synclock that portion of the code, at least that's how its is done in .net