An internal crash occurs when trying to execute a part of codes #13

Open
opened 2023-10-26 04:09:59 +00:00 by BenForge0422 · 1 comment
BenForge0422 commented 2023-10-26 04:09:59 +00:00 (Migrated from git.qoto.org)

hs_err_pid16380.log

Running with a jar

terminate called after throwing an instance of 'char const*'

Running using IDE

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (0x20474343), pid=16380, tid=0x0000000000003568
#
# JRE version: OpenJDK Runtime Environment (8.0_382-b05) (build 1.8.0_382-b05)
# Java VM: OpenJDK 64-Bit Server VM (25.382-b05 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [KERNELBASE.dll+0x2cf19]
#
# Core dump written. Default location: ...\hs_err_pid16380.mdmp
#
# An error report file with more information is saved as:
# ...\hs_err_pid16380.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

I am not sure whether the problem is related to my device, but there is no clear indication for it.
It occurs when running Kernel#execute(int).

[hs_err_pid16380.log](/uploads/53cd9519c99b5e57883ffeb4a2edd105/hs_err_pid16380.log) Running with a jar ``` terminate called after throwing an instance of 'char const*' ``` Running using IDE ``` # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (0x20474343), pid=16380, tid=0x0000000000003568 # # JRE version: OpenJDK Runtime Environment (8.0_382-b05) (build 1.8.0_382-b05) # Java VM: OpenJDK 64-Bit Server VM (25.382-b05 mixed mode windows-amd64 compressed oops) # Problematic frame: # C [KERNELBASE.dll+0x2cf19] # # Core dump written. Default location: ...\hs_err_pid16380.mdmp # # An error report file with more information is saved as: # ...\hs_err_pid16380.log # # If you would like to submit a bug report, please visit: # https://github.com/adoptium/adoptium-support/issues # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # ``` I am not sure whether the problem is related to my device, but there is no clear indication for it. It occurs when running `Kernel#execute(int)`.
BenForge0422 commented 2023-10-26 09:20:14 +00:00 (Migrated from git.qoto.org)

When I tested more deeply:

  • Internal fatal error (as if before):
    public static void main(String[] args) {
        int[] a = new int[1];
        boolean s = false;
        Kernel kernel = new Kernel() {
            @Override
            public void run() {
                int id = getGlobalId();
                boolean j = !s;
                int k = a[0];
            }
        };
        kernel.execute(100);
    }
  • Run without error:
    public static void main(String[] args) {
        int[] a = new int[1];
        boolean s = false;
        Kernel kernel = new Kernel() {
            @Override
            public void run() {
                int id = getGlobalId();
                //boolean j = !s;
                int k = a[0];
            }
        };
        kernel.execute(100);
    }
  • NoSuchFieldError thrown:
    public static void main(String[] args) {
        int[] a = new int[1];
        boolean s = false;
        Kernel kernel = new Kernel() {
            @Override
            public void run() {
                int id = getGlobalId();
                boolean j = !s;
                //int k = a[0];
            }
        };
        kernel.execute(100);
    }

As of the NoSuchFieldError:

Exception in thread "main" java.lang.NoSuchFieldError: val$s
    at com.aparapi.internal.jni.KernelRunnerJNI.runKernelJNI(Native Method)
    at com.aparapi.internal.kernel.KernelRunner.executeOpenCL(KernelRunner.java:1330)
    at com.aparapi.internal.kernel.KernelRunner.executeInternalInner(KernelRunner.java:1855)
    at com.aparapi.internal.kernel.KernelRunner.executeInternalOuter(KernelRunner.java:1471)
    at com.aparapi.internal.kernel.KernelRunner.execute(KernelRunner.java:1454)
    at com.aparapi.Kernel.execute(Kernel.java:2907)
    at com.aparapi.Kernel.execute(Kernel.java:2864)
    at com.aparapi.Kernel.execute(Kernel.java:2839)

If I understand correctly, should these non-array final primitive variables not be passed into kernel?
This run successfully:

    public static void main(String[] args) {
		int[] a = new int[1];
		int l = 1;
		Kernel kernel = new Kernel() {
			@Override
			public void run() {
				int id = getGlobalId();
				int k = a[0] + l;
			}
		};
		kernel.execute(100);
	}

The current solution to prevent the error and to use boolean value at the same time is to turn it into an array.

When I tested more deeply: - Internal fatal error (as if before): ```java public static void main(String[] args) { int[] a = new int[1]; boolean s = false; Kernel kernel = new Kernel() { @Override public void run() { int id = getGlobalId(); boolean j = !s; int k = a[0]; } }; kernel.execute(100); } ``` - Run without error: ```java public static void main(String[] args) { int[] a = new int[1]; boolean s = false; Kernel kernel = new Kernel() { @Override public void run() { int id = getGlobalId(); //boolean j = !s; int k = a[0]; } }; kernel.execute(100); } ``` - `NoSuchFieldError` thrown: ```java public static void main(String[] args) { int[] a = new int[1]; boolean s = false; Kernel kernel = new Kernel() { @Override public void run() { int id = getGlobalId(); boolean j = !s; //int k = a[0]; } }; kernel.execute(100); } ``` As of the `NoSuchFieldError`: ``` Exception in thread "main" java.lang.NoSuchFieldError: val$s at com.aparapi.internal.jni.KernelRunnerJNI.runKernelJNI(Native Method) at com.aparapi.internal.kernel.KernelRunner.executeOpenCL(KernelRunner.java:1330) at com.aparapi.internal.kernel.KernelRunner.executeInternalInner(KernelRunner.java:1855) at com.aparapi.internal.kernel.KernelRunner.executeInternalOuter(KernelRunner.java:1471) at com.aparapi.internal.kernel.KernelRunner.execute(KernelRunner.java:1454) at com.aparapi.Kernel.execute(Kernel.java:2907) at com.aparapi.Kernel.execute(Kernel.java:2864) at com.aparapi.Kernel.execute(Kernel.java:2839) ``` If I understand correctly, should these non-array final primitive variables not be passed into kernel? This run successfully: ```java public static void main(String[] args) { int[] a = new int[1]; int l = 1; Kernel kernel = new Kernel() { @Override public void run() { int id = getGlobalId(); int k = a[0] + l; } }; kernel.execute(100); } ``` The current solution to prevent the error and to use boolean value at the same time is to turn it into an array.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aparapi/aparapi#13
No description provided.