CubicChunks

CubicChunks

840k Downloads

OpenCubicChunks 1.12.2 Server ConcurrentModificationException

ColaIan opened this issue ยท 17 comments

commented

Version Information

Minecraft version: 1.12.2
CubicChunks version: CubicChunks-1.12.2-0.0.1055.0-SNAPSHOT-all
Forge version: forge-1.12.2-14.23.5.2854
Other mods (if applicable): worldedit-forge-mc1.12.2-6.1.10-dist

Steps to reproduce:

  1. Create a Forge server with CubikChunks
  2. The error comes up randomly
  3. Server crashes

Expected Behavior: Server runs smoothly

Actual Behavior: Server Crash

Link to crash log (if applicable - use a site such as hastebin:
https://hastebin.com/hatukiciyo.pl

commented

Same here. Don't use hastebin.

commented

Same here. Don't use hastebin.

Oh sorry for the inconvenience, let me reupload it

commented

All 3 of your issues are most likely caused by some other mod. The only suspect I have is osmhelper doing some multi threading. Can you upload debug.log file for all 3 crashes?

commented

Please don't open more issues for random crashes with the same mod setup until this is closed as it's all most likely the same issue causing different random concurrency related crashes. I need the complete debug.log, ideally from multiple crashing game runs as not all of them may contain useful information.

commented

Please don't open more issues for random crashes with the same mod setup until this is close d As it's all most likely the same issue causing different random concurrency related crashes. I need the complete debug.log, ideally from multiple crashing game runs as not all of them may contain useful information.

Alright no worries, I would just upload the log files here instead of using another platform since these files are too large and I couldn't upload to pastebin. Also, I could send you the source code of my mod in private if you found that it's a problem with the mod and is kind enough to provide the help :D

debug-2.log :1277
debug-5.log :5101

commented

Please report it to the authors of osmmchelper. The mod doesn't seem to be open source so I can't inspect it to see what it's doing but I suspect it's doing multi threading and breaking everything in the process.

Edit :oh it's your mod. Then don't do multi threaded world access. Just don't.

commented

Please report it to the authors of osmmchelper. The mod doesn't seem to be open source so I can't inspect it to see what it's doing but I suspect it's doing multi threading and breaking everything in the process.

Edit :oh it's your mod. Then don't do multi threaded world access. Just don't.

Alright thanks, please don't close the issue yet, I'll remove the multithreaded worldedit actions in a few minutes and will tell you how it goes in case there is any problem, thanks!

commented

Hello, I've tried removing the multithreaded actions, the errors from this mod was gone, but since the task takes too long to complete, the server crashed itself for being timed out (1 tick took over 60 seconds) if I don't use threading, do you have any advice on what I should do without keep increasing the max allowed seconds for one tick? Thanks!
The "server actively crashes itself" error (the crash report is probably unnecessary): https://pastebin.com/raw/apciqEuX

commented

you clearly didn't remove the multithreaded actions, because you're still getting the same CME and that only happens if the HashMap is modified during iteration.

note that it might also happen if you modify the map on the same thread inside of an iterator.

commented

You should probably gather all the data on the actual block operations you want to do in a separate thread first into your own data structure (without touching World), and then apply all the block changes on the server thread. If it's so big that even just setting the blocks takes a long time, split that action into multiple ticks. It's not necessarily going to be easy but there really is no other way.

If you really know what you are doing it would be possible to do the vast majority of the work off the main thread, including putting the blocks into chunks, but given you ran into those issues, it's almost certainly not for you yet.

And yes, that crash above is either indicating you didn't remove all threading, or you just uploaded the wrong one.

commented

Hello chill, it was just the incorrect log file, my clipboard was somehow not working but here's the actual crash report https://pastebin.com/raw/zYHxfuSc

commented

you (or rather, your mod) worldedit-ed a really big area and it took more than 60s. the only issue here is that your computer is too slow :P

commented

image
Well we rented a windows vps just for investigating how to turn OSM data into a Minecraft world

commented

you (or rather, your mod) worldedit-ed a really big area and it took more than 60s. the only issue here is that your computer is too slow :P

Any suggestions or a forum post that would be helpful to my situation with such large size and number of edits?

commented

minecraft needs single-threaded performance, having lots of cores adds no benefit... also this is really off-topic, the issue clearly has nothing to do with cubic chunks whatsoever. if you want to continue this discussion maybe you could take it to #dev-any in the cubic chunks discord.

Any suggestions or a forum post that would be helpful to my situation with such large size and number of edits?

do exactly what barteks said: split them up across multiple ticks. or even better, do them one chunk at a time during chunk generation.

commented

I would suggest you don't even use WorldEdit for this as doing that is probably going to be very limiting. I don't know how big of an area that you are doing is, so here are a few possible scenarios:

  • Small-ish area - no more than about 100x100x100 blocks - you should be able to create essentially an in-memory schematic off the main thread (which could be basically just an IBlockState[]) and apply it as a worldedit command.
  • Reasonable - no more than about 500x100x500 - you can still fit the IBlockState[] array into memory and make it off thread, but you will have to split the operation into multiple ticks. At that point you may want to do away with using WorldEdit commands and just use WorldEdit for selecting the area
  • Huge - things like 1000x100x1000 - at that point you will have to store the blocks to change on disk, and apply it chunk by chunk across many ticks.

I would be able to help more on CC discord, in #dev-any channel, this is not the best place to discuss this.