Re: RFR: 8195129: System.load() fails to load from unicode paths [v3]

2021-06-08 Thread Maxim Kartashev
On Mon, 7 Jun 2021 18:46:11 GMT, Naoto Sato wrote: >> @mkartashev thank you for the detailed explanation. >> >> It is not clear to me that the JDK's conformance to being a Unicode >> application has significantly changed since the evaluation of JDK-8017274 - >> @naotoj can you comment on tha

Re: RFR: 8195129: System.load() fails to load from unicode paths [v3]

2021-06-07 Thread Naoto Sato
On Sun, 6 Jun 2021 22:25:44 GMT, David Holmes wrote: >> I think we need to establish some common ground before proceeding further >> with this fix. It's a bit of a long read; please, bear with me. >> >> The path name starts its life as a `jstring` in >> `Java_jdk_internal_loader_NativeLibrarie

Re: RFR: 8195129: System.load() fails to load from unicode paths [v3]

2021-06-07 Thread Maxim Kartashev
On Sun, 6 Jun 2021 22:25:44 GMT, David Holmes wrote: >> I think we need to establish some common ground before proceeding further >> with this fix. It's a bit of a long read; please, bear with me. >> >> The path name starts its life as a `jstring` in >> `Java_jdk_internal_loader_NativeLibrarie

Re: RFR: 8195129: System.load() fails to load from unicode paths [v3]

2021-06-06 Thread David Holmes
On Fri, 4 Jun 2021 14:00:25 GMT, Maxim Kartashev wrote: >> Not an expert by my understanding is that the VM only deals with modified >> UTF-8, as does JNI. So the incoming string should be modified-UTF8 IMO and >> then converted to UTF16. >> >> That said, this is shared code being modified on

Re: RFR: 8195129: System.load() fails to load from unicode paths [v3]

2021-06-04 Thread Naoto Sato
On Fri, 4 Jun 2021 14:00:25 GMT, Maxim Kartashev wrote: >> Not an expert by my understanding is that the VM only deals with modified >> UTF-8, as does JNI. So the incoming string should be modified-UTF8 IMO and >> then converted to UTF16. >> >> That said, this is shared code being modified on

Re: RFR: 8195129: System.load() fails to load from unicode paths [v3]

2021-06-04 Thread Maxim Kartashev
On Fri, 4 Jun 2021 02:12:42 GMT, David Holmes wrote: >> I am not sure we can pass non `modified UTF-8` through `JVM_LoadLibrary()`. >> Probably some VM folks can enlighten here? > > Not an expert by my understanding is that the VM only deals with modified > UTF-8, as does JNI. So the incoming s

Re: RFR: 8195129: System.load() fails to load from unicode paths [v3]

2021-06-04 Thread Maxim Kartashev
On Thu, 3 Jun 2021 17:51:54 GMT, Naoto Sato wrote: > I think we can simply limit the test platform only to Windows in @requires > tag in the test. Also, I would see the test case using some supplementary > characters. Done. - PR: https://git.openjdk.java.net/jdk/pull/4169

Re: RFR: 8195129: System.load() fails to load from unicode paths [v3]

2021-06-03 Thread David Holmes
On Thu, 3 Jun 2021 17:48:59 GMT, Naoto Sato wrote: >> Right; I changed the code in NativeLibraries.c to pass down true UTF-8 >> instead of "modified UTF-8". Please, take a look. > > I am not sure we can pass non `modified UTF-8` through `JVM_LoadLibrary()`. > Probably some VM folks can enlighte

Re: RFR: 8195129: System.load() fails to load from unicode paths [v3]

2021-06-03 Thread Naoto Sato
On Thu, 3 Jun 2021 06:59:01 GMT, Maxim Kartashev wrote: >> test/hotspot/jtreg/runtime/jni/loadLibraryUnicode/LoadLibraryUnicodeTest.java >> line 42: >> >>> 40: String nativePathSetting = "-Dtest.nativepath=" + >>> getSystemProperty("test.nativepath"); >>> 41: ProcessBuilder pb

Re: RFR: 8195129: System.load() fails to load from unicode paths [v3]

2021-06-03 Thread Naoto Sato
On Thu, 3 Jun 2021 06:55:26 GMT, Maxim Kartashev wrote: >> src/hotspot/os/windows/os_windows.cpp line 1491: >> >>> 1489: static errno_t convert_UTF8_to_UTF16(char const* utf8_str, LPWSTR* >>> utf16_str) { >>> 1490: return convert_to_UTF16(utf8_str, CP_UTF8, utf16_str); >>> 1491: } >> >> IIU

Re: RFR: 8195129: System.load() fails to load from unicode paths [v3]

2021-06-03 Thread Maxim Kartashev
On Tue, 1 Jun 2021 18:42:34 GMT, Naoto Sato wrote: >> Maxim Kartashev has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Coding style-related corrections. >> - Corrected the test to use Platform.sharedLibraryExt() > > test/hotspot/jtreg/

Re: RFR: 8195129: System.load() fails to load from unicode paths [v3]

2021-06-03 Thread Maxim Kartashev
On Tue, 1 Jun 2021 18:24:05 GMT, Naoto Sato wrote: >> Maxim Kartashev has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Coding style-related corrections. >> - Corrected the test to use Platform.sharedLibraryExt() > > src/hotspot/os/wind

Re: RFR: 8195129: System.load() fails to load from unicode paths [v3]

2021-06-01 Thread Naoto Sato
On Thu, 27 May 2021 16:14:38 GMT, Maxim Kartashev wrote: >> Character strings within JVM are produced and consumed in several formats. >> Strings come from/to Java in the UTF8 format and POSIX APIs (like fprintf() >> or dlopen()) consume strings also in UTF8. On Windows, however, the >> situa

Re: RFR: 8195129: System.load() fails to load from unicode paths [v3]

2021-05-27 Thread Maxim Kartashev
> Character strings within JVM are produced and consumed in several formats. > Strings come from/to Java in the UTF8 format and POSIX APIs (like fprintf() > or dlopen()) consume strings also in UTF8. On Windows, however, the situation > is far less simple: some new(er) APIs expect UTF16 (wide-ch