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

CTW: Runner can produce negative StressSeed

XMLWordPrintable

    • b11

        CtwRunner does abs(random.nextInt()), which would break when random returns Integer.MIN_VALUE. Its abs() would be negative, which would be caught by JVM argument parsing code as incorrectly specified option. This would yield a very rare CTW failure.

        https://github.com/openjdk/jdk/blob/cc276ff0dfa0a568ebf0a66e0762a6de19fa6a49/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java#L303

        Should probably do it like jcstress does it:
        https://github.com/openjdk/jcstress/blob/84bd76e115604e81e721674eff0ff39c5a3bf3b8/jcstress-core/src/main/java/org/openjdk/jcstress/vm/VMSupport.java#L565

              jcao Joshua Cao
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: