Description
As reported in the analysis of JDK-8187884
Calvin Cheung added a comment - 5 hours ago
I did more investigation by instrumenting the ClassPathDirEntry::open_stream() in classLoader.cpp
and found that when it failed, it is due to the jio_snprintf() failed and returning NULL.
if (jio_snprintf(path, JVM_MAXPATHLEN, "%s%s%s", _dir, os::file_separator(), name) == -1) {
FREE_RESOURCE_ARRAY(char, path, JVM_MAXPATHLEN);
return NULL;
}
Returning NULL in the above subsequently causes the systemDictionary.cpp throws a CNFE as indicated by David in the above comment.
jio_snprintf() fails due to the JVM_MAXPATHLEN is too short on windows.
In jvm_windows.h:
#define JVM_MAXPATHLEN _MAX_PATH
According to MSDN, MAX_PATH is defined as 260
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
----
We need to get rid of this small path limitation if possible and also improve the error diagnostics so that it is evident why we are failing to load the class!
Calvin Cheung added a comment - 5 hours ago
I did more investigation by instrumenting the ClassPathDirEntry::open_stream() in classLoader.cpp
and found that when it failed, it is due to the jio_snprintf() failed and returning NULL.
if (jio_snprintf(path, JVM_MAXPATHLEN, "%s%s%s", _dir, os::file_separator(), name) == -1) {
FREE_RESOURCE_ARRAY(char, path, JVM_MAXPATHLEN);
return NULL;
}
Returning NULL in the above subsequently causes the systemDictionary.cpp throws a CNFE as indicated by David in the above comment.
jio_snprintf() fails due to the JVM_MAXPATHLEN is too short on windows.
In jvm_windows.h:
#define JVM_MAXPATHLEN _MAX_PATH
According to MSDN, MAX_PATH is defined as 260
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
----
We need to get rid of this small path limitation if possible and also improve the error diagnostics so that it is evident why we are failing to load the class!
Attachments
Issue Links
- relates to
-
JDK-8187884 [TESTBUG] compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading failed with ClassNotFoundException
- Resolved
-
JDK-8208623 [TESTBUG] runtime/LoadClass/LongBCP.java fails in AUFS file system
- Resolved