RCE fuzzer test

XMLWordPrintable

      Ideas from [~epeter]:

          Randomly generate some loop shapes with RangeChecks and checkIndex/L and MemorySegment.
          Make sure all sorts of addressing shapes are generated, including the ConvI2L pattern of this PR here.
          Make sure the generation has a good structure, so we can easily extend with more patterns.
          First, pick the accessed range so that we have everything in bounds. Warmup and compilation should happen under this condition.
          Then, generate some out of bounds range, call the method and verify that the exception is triggered, and other side effects are also correct (e.g. half-written arrays).
          Bonus: find a way to generate IR rule, and verify the RCE happened, and no unexpected RangeCheck/if is still in the loop.

      Such a fuzzer should probably be integrated separately. But I would prefer if we had such testing before we are adding more optimizations in this sensitive area.

      This test below was used to verify aliasing, but it generates various loop shapes and does value verification, as well as IR verification - so it may be an inspiration:
      test/hotspot/jtreg/compiler/loopopts/superword/TestAliasingFuzzer.java


      ref. https://github.com/openjdk/jdk/pull/29392#issuecomment-3952447798

            Assignee:
            Unassigned
            Reporter:
            Kerem Kat
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: