There are a number of usages of NULL introduced in CRaC code
Below is the output of test/hotspot/jtreg/sources/TestNoNULL.java
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/linux/crac_linux.cpp at line 277:
if (_attach_op == NULL)
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/linux/crac_linux.cpp at line 288:
if (_attach_op == NULL)
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/linux/os_linux.hpp at line 296:
if (cpu_to_node() != NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/posix/signals_posix.cpp at line 1546:
const char *signal_engines[] = { "criu", "criuengine", "sim", "simengine", "pause", "pauseengine", NULL };
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/posix/signals_posix.cpp at line 1547:
for (int i = 0; signal_engines[i] != NULL; ++i) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/posix/attachListener_posix.cpp at line 279:
PosixAttachListener::_current_op = NULL;
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/windows/os_windows.cpp at line 4732:
if (wide_path == NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/windows/os_windows.cpp at line 4744:
if (wide_path == NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/gc/g1/g1UncommitRegionTask.cpp at line 137:
// If _instance is NULL G1 GC is either not in use or its collection has not yet been executed.
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/services/diagnosticCommand.cpp at line 1067:
if (str != NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/compiler/compileLog.cpp at line 197:
_out = NULL;
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/globals.hpp at line 1959:
product(ccstr, CRaCCheckpointTo, NULL, RESTORE_SETTABLE, \\
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/globals.hpp at line 1962:
product(ccstr, CRaCRestoreFrom, NULL, RESTORE_SETTABLE, \\
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/globals.hpp at line 1990:
product(ccstr, CRaCIgnoredFileDescriptors, NULL, RESTORE_SETTABLE, \\
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 1119:
if (equal_sign == NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 1270:
assert(key != NULL, "key should not be NULL");
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 1271:
assert(value != NULL, "value should not be NULL");
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 1292:
const char* key = NULL;
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 1293:
const char* value = NULL;
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 2205:
const char *tail = NULL;
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 2219:
const char* key = NULL;
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 2220:
const char* value = NULL;
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 2227:
if (old_java_command != NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 2246:
if (flag != NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/crac_structs.hpp at line 48:
_msg(NULL)
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/crac_structs.hpp at line 80:
while (props != NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/crac_structs.hpp at line 100:
_raw_content(NULL),
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/crac_structs.hpp at line 102:
_args(NULL)
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/crac_structs.hpp at line 137:
while (p != NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/crac_structs.hpp at line 181:
, _attach_op(jcmd_stream ? PosixAttachListener::get_current_op() : NULL)
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/cpu/x86/globals_x86.hpp at line 195:
product(ccstr, CPUFeatures, NULL, "CPU feature set, " \\
java.lang.RuntimeException: Test found 31 usages of 'NULL' in source files. See errors above.
at TestNoNULL.main(TestNoNULL.java:70)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:335)
at java.base/java.lang.Thread.run(Thread.java:1447)
Below is the output of test/hotspot/jtreg/sources/TestNoNULL.java
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/linux/crac_linux.cpp at line 277:
if (_attach_op == NULL)
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/linux/crac_linux.cpp at line 288:
if (_attach_op == NULL)
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/linux/os_linux.hpp at line 296:
if (cpu_to_node() != NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/posix/signals_posix.cpp at line 1546:
const char *signal_engines[] = { "criu", "criuengine", "sim", "simengine", "pause", "pauseengine", NULL };
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/posix/signals_posix.cpp at line 1547:
for (int i = 0; signal_engines[i] != NULL; ++i) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/posix/attachListener_posix.cpp at line 279:
PosixAttachListener::_current_op = NULL;
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/windows/os_windows.cpp at line 4732:
if (wide_path == NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/os/windows/os_windows.cpp at line 4744:
if (wide_path == NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/gc/g1/g1UncommitRegionTask.cpp at line 137:
// If _instance is NULL G1 GC is either not in use or its collection has not yet been executed.
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/services/diagnosticCommand.cpp at line 1067:
if (str != NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/compiler/compileLog.cpp at line 197:
_out = NULL;
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/globals.hpp at line 1959:
product(ccstr, CRaCCheckpointTo, NULL, RESTORE_SETTABLE, \\
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/globals.hpp at line 1962:
product(ccstr, CRaCRestoreFrom, NULL, RESTORE_SETTABLE, \\
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/globals.hpp at line 1990:
product(ccstr, CRaCIgnoredFileDescriptors, NULL, RESTORE_SETTABLE, \\
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 1119:
if (equal_sign == NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 1270:
assert(key != NULL, "key should not be NULL");
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 1271:
assert(value != NULL, "value should not be NULL");
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 1292:
const char* key = NULL;
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 1293:
const char* value = NULL;
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 2205:
const char *tail = NULL;
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 2219:
const char* key = NULL;
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 2220:
const char* value = NULL;
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 2227:
if (old_java_command != NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/arguments.cpp at line 2246:
if (flag != NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/crac_structs.hpp at line 48:
_msg(NULL)
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/crac_structs.hpp at line 80:
while (props != NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/crac_structs.hpp at line 100:
_raw_content(NULL),
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/crac_structs.hpp at line 102:
_args(NULL)
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/crac_structs.hpp at line 137:
while (p != NULL) {
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/share/runtime/crac_structs.hpp at line 181:
, _attach_op(jcmd_stream ? PosixAttachListener::get_current_op() : NULL)
Error: 'NULL' found in /home/runner/work/crac/crac/src/hotspot/cpu/x86/globals_x86.hpp at line 195:
product(ccstr, CPUFeatures, NULL, "CPU feature set, " \\
java.lang.RuntimeException: Test found 31 usages of 'NULL' in source files. See errors above.
at TestNoNULL.main(TestNoNULL.java:70)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:335)
at java.base/java.lang.Thread.run(Thread.java:1447)
- links to
-
Commit(crac) openjdk/crac/eea5480c
-
Review(crac) openjdk/crac/237