BlueMap

BlueMap

85.1k Downloads

Loading Portality assets causes java.lang.StackOverflowError

pfruh opened this issue · 4 comments

commented

BlueMap Version: 1.3.0-snap-forge-1.16.4
forge-1.16.4-35.1.29

I am using:

  • mods (on the rendered world)
  • resourcepacks (in bluemaps config/resourcepack folder)

Description:
The Server uses the All The Mods 6 Modpack v1.3.8 with the client mods loaded as BlueMap resourcepacks.

The mod portality-1.16.4-3.2.0 loaded as resourcepack breaks BlueMap on startup with the following error messages:

[16:10:36] [Thread-54/INFO] [BlueMap/]: Loading portality assets (25/199)...
[16:10:36] [Thread-54/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: java.lang.StackOverflowError
[16:10:36] [Thread-54/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:  at de.bluecolored.bluemap.core.resourcepack.BlockModelResource$Builder.getTexture(BlockModelResource.java:431)
[16:10:36] [Thread-54/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:  at de.bluecolored.bluemap.core.resourcepack.BlockModelResource$Builder.getTexture(BlockModelResource.java:431)
[16:10:36] [Thread-54/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:  at de.bluecolored.bluemap.core.resourcepack.BlockModelResource$Builder.getTexture(BlockModelResource.java:431)
[16:10:36] [Thread-54/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:  at de.bluecolored.bluemap.core.resourcepack.BlockModelResource$Builder.getTexture(BlockModelResource.java:431)
[16:10:36] [Thread-54/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:  at de.bluecolored.bluemap.core.resourcepack.BlockModelResource$Builder.getTexture(BlockModelResource.java:431)
[16:10:36] [Thread-54/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:  at de.bluecolored.bluemap.core.resourcepack.BlockModelResource$Builder.getTexture(BlockModelResource.java:431)

(repeats around 1000 times)
commented

This issue is caused by a malformatted texture-definition by the portality mod:

I checked the mod.jar, and i found this assets file: portality-1.16.4-3.2.0.jar\assets\portality\models\block\util_cube_glow_3_base.json with this content:

{
  "parent": "portality:block/util_cube_glow_3",
  "ambientocclusion": false,
  "textures": {
    "particle": "#all",
    "down": "#all",
    "up": "#all",
    "north": "#all",
    "east": "#all",
    "south": "#all",
    "west": "#all",
    "glow_down_below": "#glow_down_below",
    "glow_up_below": "#glow_up_below",
    "glow_north_below": "#glow_north_below",
    "glow_east_below": "#glow_east_below",
    "glow_south_below": "#glow_south_below",
    "glow_west_below": "#glow_west_below",
    "glow_down": "#glow_down",
    "glow_up": "#glow_up",
    "glow_north": "#glow_north",
    "glow_east": "#glow_east",
    "glow_south": "#glow_south",
    "glow_west": "#glow_west"
  }
}

With e.g. "glow_down": "#glow_down" there is a texture definition that loops back to itself, which causes bluemap to trying to resolve that texture endlessly.

The Bug by BlueMap is that BlueMap should detect such an endless loop and skip the file instead of crashing.

The method looping is here: https://github.com/BlueMap-Minecraft/BlueMap/blob/master/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resourcepack/BlockModelResource.java#L425-L444

commented

The best way to resolve this is probably:

  • Ignoring texture-definitions where key and value are the same (when populating the map)
  • Adding a recursive-count as a fail-save if the recursion is more complex (over multiple variables)
commented

This issue is caused by a malformatted texture-definition by the portality mod:

I checked the mod.jar, and i found this assets file: portality-1.16.4-3.2.0.jar\assets\portality\models\block\util_cube_glow_3_base.json with this content:

{
  "parent": "portality:block/util_cube_glow_3",
  "ambientocclusion": false,
  "textures": {
    "particle": "#all",
    "down": "#all",
    "up": "#all",
    "north": "#all",
    "east": "#all",
    "south": "#all",
    "west": "#all",
    "glow_down_below": "#glow_down_below",
    "glow_up_below": "#glow_up_below",
    "glow_north_below": "#glow_north_below",
    "glow_east_below": "#glow_east_below",
    "glow_south_below": "#glow_south_below",
    "glow_west_below": "#glow_west_below",
    "glow_down": "#glow_down",
    "glow_up": "#glow_up",
    "glow_north": "#glow_north",
    "glow_east": "#glow_east",
    "glow_south": "#glow_south",
    "glow_west": "#glow_west"
  }
}

With e.g. "glow_down": "#glow_down" there is a texture definition that loops back to itself, which causes bluemap to trying to resolve that texture endlessly.

The Bug by BlueMap is that BlueMap should detect such an endless loop and skip the file instead of crashing.

The method looping is here: https://github.com/BlueMap-Minecraft/BlueMap/blob/master/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resourcepack/BlockModelResource.java#L425-L444

I'm experincing the same issue, can you give me an indication how to fix the json file of portality directly ? So i can load assets before you release a patch :) thanks !

commented

@F0x06 you can try to open the jar with 7zip or similar, open the files in it, find all lines that have this pattern: "xxx": "#xxx" (e.g. "glow_down": "#glow_down") and simply remove them (while maining a vaild json format ofc)