RFR: 8297343: TestStress*.java fail with "got different traces for the same seed"

Tobias Hartmann thartmann at openjdk.org
Thu Nov 24 15:50:35 UTC 2022


On Thu, 24 Nov 2022 15:27:41 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> Root cause from Roberto's analysis:
> 
> "The regression seems to be due to the introduction of non-determinism
> in the node dumps of otherwise identical compilations."
> 
> "The problem seems to be that JDK-6312651 dumps interface sets in an
> order that is determined by the raw pointers of the set elements. This
> is unstable across different runs and leads to different node dumps
> for otherwise identical compilations."
> 
> "Stable node dumps are useful for debugging (e.g. when diffing
> compiler traces from two different runs), so the solution is probably
> dumping interface sets in some order (e.g. lexicographic order of each
> interface dump) that does not depend on raw pointer values."
> 
> This patch implements Roberto's recommendation by sorting interfaces
> on their ciBaseObject::_ident.

You also need to remove the tests from the problem list.

Looks good to me otherwise.

src/hotspot/share/opto/type.cpp line 3187:

> 3185: static int compare_interfaces(ciKlass** k1, ciKlass** k2) {
> 3186: return (int)((*k1)->ident() - (*k2)->ident());
> 3187: }

Suggestion:

static int compare_interfaces(ciKlass** k1, ciKlass** k2) {
  return (int)((*k1)->ident() - (*k2)->ident());
}

src/hotspot/share/opto/type.cpp line 3197:

> 3195:   GrowableArray<ciKlass*> interfaces;
> 3196:   interfaces.appendAll(&_list);
> 3197:   // Sort the interfaces so there's listed in the same order from one run to the other of the same compilation

Suggestion:

  // Sort the interfaces so they are listed in the same order from one run to the other of the same compilation

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

Marked as reviewed by thartmann (Reviewer).

PR: https://git.openjdk.org/jdk/pull/11357


More information about the hotspot-compiler-dev mailing list