RFR: 8358892: RISC-V: jvm crash when running dacapo sunflow after JDK-8352504

Fei Yang fyang at openjdk.org
Mon Jun 9 22:23:27 UTC 2025


On Mon, 9 Jun 2025 16:27:54 GMT, Hamlin Li <mli at openjdk.org> wrote:

> Hi,
> Can you help to review this patch?
> 
> Thanks!
> 
> Currently, this issue is only reproducible with Dacapo sunflow.
> I tried to construct a simpler jtreg test to reproduce the issue, but can not find a way to do it till now, this task is tracked by https://bugs.openjdk.org/browse/JDK-8359045.
> 
> So, currently I can only verify the code by reviewing it.
> Or maybe it's better to leave it until we find the test?

Try this: 

public class Test {

    public static int[] nl = { 0, 0, 0 };
    public static int[] nr = { 1, 1, 1 };

    public static float[] nodeMin = { 0.0f, 0.0f, 0.0f };
    public static float[] nodeMax = { 0.1f, 0.1f, 0.1f };

    // for case BoolTest::ge
    public static int test1(int axis, int pPlanar, float dl, float dr) {
        boolean planarLeft = !(dl <= dr);
        int numLeft = nl[axis] + (planarLeft ? pPlanar : 0);
        int numRight = nr[axis] + (planarLeft ? 0 : pPlanar);
        return numLeft + numRight;
    }

    // for case BoolTest::gt
    public static int test2(int axis, int pPlanar, float dl, float dr) {
        boolean planarLeft = !(dl < dr);
        int numLeft = nl[axis] + (planarLeft ? pPlanar : 0);
        int numRight = nr[axis] + (planarLeft ? 0 : pPlanar);
        return numLeft + numRight;
    }

    public static void main(String[] args) {
        int ret = 0;

        // test case BoolTest::ge
        for (int i = 0; i < 20000; i++) {
            if (i % 2 == 0) {
              ret = test1(i % 3, i % 10, nodeMin[i % 3], nodeMax[i % 3]);
            } else {
              ret = test1(i % 3, i % 10, nodeMax[i % 3], nodeMin[i % 3]);
            }
        }
        System.out.println("test1 passed. result = " + ret);

        // test case BoolTest::gt
        for (int i = 0; i < 20000; i++) {
            if (i % 2 == 0) {
              ret = test2(i % 3, i % 10, nodeMin[i % 3], nodeMax[i % 3]);
            } else {
              ret = test2(i % 3, i % 10, nodeMax[i % 3], nodeMin[i % 3]);
            }
        }
        System.out.println("test2 passed. result = " + ret);
    }
}


$ java -XX:-TieredCompilation Test

This reduced test can reproduce the crash and cover both `BoolTest::gt` and `BoolTest::ge` cases.

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

PR Comment: https://git.openjdk.org/jdk/pull/25696#issuecomment-2957167157


More information about the hotspot-compiler-dev mailing list