Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8216427

ciMethodData::load_extra_data() does not always unpack the last entry

XMLWordPrintable

    • b31
    • 9
    • b28

        When unpacking the extra data section of the MDOs, the source and destination might not have the same number of entries, because there can be safepoints between cloning the extra data section of the MDO and unpacking the source entries to the destination entries.

        Therefore the unpacking loop loops through all the source entries and copies them to the destination. Except the last DataLayout::arg_info_data_tag entry, that never gets copied form the source to the destination. Therefore, if a safepoint occurred between cloning the extra data section and unpacking its entries in ciMethodData::load_extra_data(), the last entry could contain random bogus memory.

        It seems like the reason the last entry is not copied is because the copying requires a length which is calculated by taking the difference between the current entry and the next entry in the loop. But as there is no next entry when you are at the last entry, the copying is simply not performed, instead of calculating what the length of that entry would be.

              eosterlund Erik Österlund
              eosterlund Erik Österlund
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: