Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-172023

Potential race condition in ClientPackSource.downloadAndSelectResourcePack

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 20w06a
    • None
    • Plausible
    • Resource Packs
    • Low
    • Platform

      The bug

      There appears to be a potential race condition in net.minecraft.client.resources.ClientPackSource.downloadAndSelectResourcePack(String, String) (Mojang name).

      1. If a resource pack does not exist yet it is downloaded asynchronously.
      2. However, if the method is called again while the download is still in progress, it will incorrectly assume it was completely downloaded because the file exists.
      3. Since the file is not complete yet, either there is a hash mismatch (if a hash is provided) or setServerPack fails because the zip is malformed.
      4. The resource pack is therefore deleted.

      The end result can therefore be that both downloadAndSelectResourcePack calls fail.

            Unassigned Unassigned
            marcono1234 [Mod] Marcono1234
            Votes:
            5 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: