BlueMap-Minecraft / BlueMap

A Minecraft mapping tool that creates 3D models of your Minecraft worlds and displays them in a web viewer.
https://bluecolo.red/bluemap
MIT License
1.92k stars 131 forks source link

Rendering stuck with error: "RenderManager(0): WorkerThread(0): Exception while doing some work!" "IllegalArgumentException: newLimit < 0: (-163840 < 0)" #560

Closed marcbal closed 5 months ago

marcbal commented 5 months ago

What i did / Steps to reproduce

Rendering the map

Expected result

Map rendered succesfully with no error

Actual result

The rendering is stuck and is constantly throwing an error in the console and in the debug log file:

[BlueMap] RenderManager(0): WorkerThread(0): Exception while doing some work!
java.lang.IllegalArgumentException: newLimit < 0: (-163840 < 0)
    at java.nio.Buffer.createLimitException(Buffer.java:406)~
    at java.nio.Buffer.limit(Buffer.java:380)~
    at java.nio.ByteBuffer.limit(ByteBuffer.java:1565)~
    at de.bluecolored.bluemap.core.world.mca.region.MCARegion.readFully(MCARegion.java:190)~
    at de.bluecolored.bluemap.core.world.mca.region.MCARegion.readFully(MCARegion.java:183)~
    at de.bluecolored.bluemap.core.world.mca.region.MCARegion.iterateAllChunks(MCARegion.java:158)~
    at de.bluecolored.bluemap.core.world.mca.MCAWorld.preloadRegionChunks(MCAWorld.java:194)~
    at de.bluecolored.bluemap.core.world.World.preloadRegionChunks(World.java:92)~
    at de.bluecolored.bluemap.common.rendermanager.WorldRegionRenderTask.init(WorldRegionRenderTask.java:142)~
    at de.bluecolored.bluemap.common.rendermanager.WorldRegionRenderTask.doWork(WorldRegionRenderTask.java:162)~
    at de.bluecolored.bluemap.common.rendermanager.CombinedRenderTask.doWork(CombinedRenderTask.java:56)~
    at de.bluecolored.bluemap.common.rendermanager.RenderManager.doWork(RenderManager.java:318)~
    at de.bluecolored.bluemap.common.rendermanager.RenderManager$WorkerThread.run(RenderManager.java:343)~

The error is always the same, only the worker thread id is changing. I understand that the issue is from a particular chunk or region file, but the error message doesn’t tell which region has the issue. Here is the result of the /bluemap command:

BlueMap - Status:
Render-Threads are running!
Queued Tasks (2627):
  [1c72] Update map 'archi'
   Detail: Update region (-16, 2) for map 'archi'
   Progress: 47.08%
   ETA: 0:00:03
  [77ad] Update region (1, 4) for map 'archi_survie_game'
  ...

The progress % is always the same since days.

Context

BlueMap version:

Version: 5.2
Commit: 21738feb69f904df5f5cf61c907c7eda67911e0c
Implementation: paper
Minecraft: 1.20.4
Render-threads: 2
Available processors: 16
Available memory: 10240 MiB

Paper version: This server is running Paper version git-Paper-497 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: d8d54d9 on ver/1.20.4) Java version:

openjdk version "21.0.3" 2024-04-16 LTS
OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode, sharing)

OS: Linux 6.2.16-19-pve #1 SMP PREEMPT_DYNAMIC PMX 6.2.16-19 (2023-10-24T12:07Z) x86_64 x86_64 x86_64 GNU/Linux

TBlueF commented 5 months ago

Would you be able to send me this file from your world that the map archi is rendering: region/r.-16.2.mca? Then I might be able to reproduce the error on my end :)

marcbal commented 5 months ago

Here is a copy of the file (its too big for Github): https://www.pandacube.fr/assets/files/r.-16.2.mca It looks like this is the biggest region file of the world. I have visited it (after making the copy of the file) and it looks like it contains a big TNT ball (the big size is probably a huge amount of TNT entities).

TBlueF commented 5 months ago

Thank you! With that file, I was able to reproduce your issue, and it seems like that 6032043126feb882a518c673346aa3251d137e7e fixes the issue! :)

Once GitHub finished building it you can download the build with the fix from here: https://github.com/BlueMap-Minecraft/BlueMap/actions/runs/9625945660 (Artifacts button), or wait for the next release where this bug-fix will be included!