RFR: 8283725: Launching java with "-Xlog:gc*=trace,safepoint*=trace,class*=trace" crashes the JVM

David Holmes dholmes at openjdk.java.net
Mon Mar 28 02:12:26 UTC 2022


I think the loop termination condition in `LogOutput::update_config_string` is not quite correct. We process "deviating tagsets" until there are no more - tracking `n_deviants` and `n_selections`. However, we can reach the case where `n_deviants == 1` and there are no further selections possible - `add_selections` finds no more subsets for the given tagset. This causes the guarantee to fire as it expects to see selections as long as we still have deviations. We can fix this by adding a new check at the bottom of the loop:

    if (n_deviates == 1 && n_selections == 0) {
      // we're done as we couldn't reduce things any further
      break;
    }

I do not know what a "deviating tagset" means so it is unclear whether the bug is not checking for this "1 and 0" case, or whether the bug is that we got that final 0. Hopefully someone else may be able to expand on that.

Testing:
- tiers 1-3

-------------

Commit messages:
 - 8283725: Launching java with "-Xlog:gc*=trace,safepoint*=trace,class*=trace" crashes the JVM

Changes: https://git.openjdk.java.net/jdk/pull/7978/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7978&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8283725
  Stats: 6 lines in 1 file changed: 5 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7978.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7978/head:pull/7978

PR: https://git.openjdk.java.net/jdk/pull/7978


More information about the hotspot-runtime-dev mailing list