mojira.dev
MC-236740

Server-side lag spike sometimes occurs when attempting to locate a buried treasure or opening/breaking a chest containing a map

The bug

A large server-side lag spike sometimes occurs when opening/breaking a chest containing a map or executing /locate buried_treasure. This affects both shipwrecks and underwater ruins. In some cases, the lag spike can be so severe that it can last upwards of 30 seconds, and some users have reported crashes.

If the server fails to locate a nearby buried treasure, it generates an empty map instead of a buried treasure map (MC-238484).

To reproduce

This occurs for a noticeable portion of shipwrecks/underwater ruins, but the seed and coordinates below are particularly good examples.

  1. Create a world with one of the following seed and coordinates:

    Seed: 5120366084678867272
    Coordinates: /execute in minecraft:overworld run tp @s 1303.51 49.00 4016.70 178.65 27.45
    Seed: -1899573754757393022
    Coordinates (shipwreck): /execute in minecraft:overworld run tp @s 2843.30 60.63 -977.73 255.15 36.00
    Coordinates (underwater ruins): /execute in minecraft:overworld run tp @s 2263.13 41.86 -1161.19 264.75 52.80
  2. Wait for the teleportation lag to finish.

  3. Open the chest.
    ❌ A massive server-side lag spike occurs.

Linked issues

Attachments

Comments

ampolive

Clones MC-190896.

migrated

I've seen this also, with a reduced amount of treasure maps and increased amount of empty maps contained in the chests

anthony cicinelli

I am unable to reproduce in 21w38a

ampolive

I can still reproduce in 21w38a.

anthony cicinelli

We do not have enough information to find the cause of this issue.

While the lag occurs, please run /debug start, wait a while and then run /debug stop in order to create a debug profile. Afterwards, run /debug report.

If you do not have the permission to run these commands, open your world to LAN and enable cheats. If you're on a server, make sure that you're a server operator in order to execute these commands.

Then, please attach the profile results found in [minecraft/debug/profile-results-<DATE>.txt|https://minecrafthopper.net/help/finding-minecraft-data-folder/], as well as the debug report found in [minecraft/debug/debug-report-<DATE>.zip|https://minecrafthopper.net/help/finding-minecraft-data-folder/] here.

This issue is being temporarily closed as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

ampolive

Interestingly. It does not seem to be consistent. In the 6 times that I tested, it only happened 3 times.

ampolive

I will use F3 + L tick profiling as I am unable to get /debug report to work.

ampolive

I think this might only happen when you're in a different chunk than the chest, but I'm not too sure.

ampolive

Note that in the second screenshot the size of the lag spike is exaggerated because it was just finished profiling and saving the results, so that was a big part of the lag spike.

wobst.michael

What's the seed of the world from

[media]

?

ampolive

@unknown The seed is 5120366084678867272.

pine1needle

I spent some time in both 1.17.1 and 21w38a testing this. I repeatedly teleported far away, used /locate to find a shipwreck, and then opened the shipwreck's map chest. In 1.17.1, the chest always opens instantly. In 21w38a, sometimes the chest opens instantly and sometimes there is a noticeable delay between right-clicking on the chest and the chest opening. When I use the provided seed and coordinates from this report, I am able to consistently see a delay between right-clicking the chest and the chest opening. I am going to update the description with the seed and coordinates because they provide a more consistent way to reproduce this.

migrated

I experienced the same in 21w39a (in fact it's quite worsening compared to 21w38a, where there was just a lag), with chests in shipwrecks and underwater ruins. I can't even tell if it depends on the presence of a buried treasure map, because the whole game freezes and then crashes while trying to open the chest. Memory usage goes from ca. 60% to 100% when trying to open the chest. Music is no affected.

In 21w38a there was just a lag, no game crash.

Ampolive: I'm sure I'm in the same chunk (removed a block on very top of chest).

To replicate: seed -1037759586794373933, coord of underwater ruin ca. -900 / z / -490. Singleplayer world. Plain vanilla MC.

I confirm what pine1needle writes for both 1.17.1 and 21w38a.

(edit: seed and coords have all negative sign, I don't know why it gets strikethrough when published)

migrated

I've made a ticket MC-238830 of the same issue not knowing about this ticket here which should just be merged but the thing is I did far more testing, so perhaps copy pasting the description of that bug and pasting it on here with edits based on the testing here (or at least some sections) would provide a much more in-detail description of this bug. No idea how to do this from my end though. 

migrated

In the world with same seed as of my previous comment, I found a shipwreck completely on land (coord 537/z/-1203), 3 chests, one with buried treasure map: no lag at all.

Lag seem to occur in my world only when chests are located underwater.

ampolive

I found that lag occurs even with empty maps.

migrated

I agree with ampolive. I just created a world in the most recent snapshot (21w42a), and opening the map chest on the shipwreck has a good chance to take ~15 seconds or so to generate/open. 2 of 3 map chests I opened lagged, even though only 1 had a buried treasure map (which was the one chest that opened fine), and I ran the /locate buried treasure command in 3 random locations, of which 2 of the 3 experienced the lag. 

This is a very strange issue, and here are some of my thoughts about it. When the chest is generating, I think it has to find the nearest buried treasure and generate that map for it, but as it only has a chance to appear in the chest it might not even generate within the chest. BUT I just checked the wiki, which says that the buried treasure map always spawns, which is certainly not happening right now. As for the command, I assume the target is the starting block for the structure, which for most is a block (or liquid depending on generation location) of some kind, but for the buried treasure it is probably an entity (the chest), so that might have something to do with it,

ampolive

@unknown I think that makes a lot of sense. Maybe it is supposed to generate a buried treasure map, but it has a limited "search range" (which I assume is around a couple thousand blocks maybe?) to locate a buried treasure within. So, if it doesn't find a buried treasure map nearby, it generates an empty map. Of course, this is just a hypothesis.

This was reported earlier as MC-238484, but at the time I couldn't reproduce the issue. MC-134334 states that this is intended, but this does not appear to be the case for underwater ruins. In the loot tables underwater_ruin_big.json and underwater_ruin_small.json, it is specifically defined for the map to be an exploration_map (i.e. buried treasure map). In any case, that is a separate issue.

migrated

I experienced this is in snapshot 21w44a in single player. While it may not be an option for all players, I was able to work around the issue by increasing the ram allotment  via the Lanucher > Installations >  [your install] > MORE OPTIONS > set "-Xmx#G" argument in JVM ARGUMENTS where # is the number of GB of RAM to allocate. There is still a significant lag spike, but the game no longer crashes.

 

(edit: Jira auto-formatting correction)

migrated

The problem is both cumulative and persistent.

Cumulative because the more map chests i open the worse it becomes until it crashes.

Persistent because even after restarting, opening that last fatal chest will crash it.

 

Also breaking the chest causes the lag spike/crash.

 

I'm on a 7year old mac mini, so it may be hitting me harder than others with a more solid system.

migrated

I do not believe this should have been marked as fixed, currently experiencing this issue on a 1.20.1 server.

ampolive

This particular issue was fixed in 1.18 Pre-release 3, with the remaining cases being fixed in 24w04a, a 1.20.5 snapshot (see MC-249136).

ampolive

boq

Confirmed

Important

Maps, World generation

buried-treasure-map, lag-spike, shipwreck

21w37a, 21w38a, 21w39a, 21w40a, 21w41a, 21w42a, 21w43a, 21w44a, 1.18 Pre-release 1

1.18 Pre-release 3

Retrieved