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

Fei Yang fyang at openjdk.org
Wed Jun 11 03:40:31 UTC 2025


On Tue, 10 Jun 2025 16:13:44 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?
>
> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
> 
>   typo

Hi,
> We need new implementation for BoolTest::ge/gt, because of NaN cases. It's done.

Hmm, I don't understand why your first commit (https://github.com/openjdk/jdk/pull/25696/commits/e5b06b5621b01dbb557fc21881307c9131f4bb53) won't work for NaN cases.
Do you have more details or maybe a small test case to demo your concern?

I also changed my test a bit and tried NaN cases and it still works if I use your first commit (https://github.com/openjdk/jdk/pull/25696/commits/e5b06b5621b01dbb557fc21881307c9131f4bb53).


public class Test {

    // return 1 if dl > dr, 0 otherwise.
    public static int test_float_gt(float dl, float dr) {
        return !(dl <= dr) ? 1 : 0;
    }

    // return 1 if dl <= dr, 0 otherwise.
    public static int test_float_ge(float dl, float dr) {
        return !(dl < dr) ? 1 : 0;
    }

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

        // test case BoolTest::ge
        for (int i = 0; i < 20000; i++) {
            if ((i % 2) == 0) {
                ret = test_float_gt(1.0f, Float.NaN);                  <===============
                if (ret != 1) {
                    throw new Exception("test_float_gt failed.");
                }
            } else {
                ret = test_float_gt(2.0f, 1.0f);
                if (ret != 1) {
                    throw new Exception("test_float_gt failed.");
                }
            }
        }
        System.out.println("test_float_gt passed.");

        // test case BoolTest::gt
        for (int i = 0; i < 20000; i++) {
            if ((i % 2) == 0) {
                ret = test_float_ge(1.0f, Float.NaN);                  <===============
                if (ret != 1) {
                    throw new Exception("test_float_ge failed.");
                }
            } else {
                ret = test_float_ge(2.0f, 1.0f);
                if (ret != 1) {
                    throw new Exception("test_float_ge failed.");
                }
            }
        }
        System.out.println("test_float_ge passed.");
    }
}

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

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


More information about the hotspot-compiler-dev mailing list