RFR(XS): 8231885: Fix/remove malformed assert in os_windows.cpp

Daniel D. Daugherty daniel.daugherty at oracle.com
Fri Oct 4 13:55:51 UTC 2019


Thumbs up. This is a trivial fix and only requires 1 (R)eviewer and does
not need to wait 24 hours.

Dan


On 10/4/19 9:27 AM, Langer, Christoph wrote:
> Hi,
>
> please review a one(two)-line fix for a recent change in os_windows.cpp.
>
> The fix introduced a malformed assertion which doesn't provide an assertion message. Testing in jdk/jdk wouldn't bring up the issue but I just discovered it when attempting to backport it to jdk11. Probably due to the older compiler or some other thing that is different there the fastdebug build failed.
>
> One could add a message to the assertion. But I think handing a malformed path that starts with 3 or more '\' to wide_abs_unc_path will either cause an error code and the caller should be able to cope with that or windows is tolerant enough to accept it as a UNC path still. We can leave that to the operating system. So I decided to simply remove the assertion.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8231885
> Problematic statement: http://hg.openjdk.java.net/jdk/jdk/file/13f29c43b6c7/src/hotspot/os/windows/os_windows.cpp#l4192
>
> Fix:
>
> diff -r e25b317d0350 -r 3f89a4aa0c2d src/hotspot/os/windows/os_windows.cpp
> --- a/src/hotspot/os/windows/os_windows.cpp     Thu Oct 03 18:59:56 2019 +0100
> +++ b/src/hotspot/os/windows/os_windows.cpp     Fri Oct 04 14:11:47 2019 +0100
> @@ -4189,8 +4189,6 @@
>       if (::isalpha(buf[0]) && !::IsDBCSLeadByte(buf[0]) && buf[1] == ':' && buf[2] == '\\') {
>         prefix = L"\\\\?\\";
>       } else if (buf[0] == '\\' && buf[1] == '\\') {
> -      assert(buf[2] != '\\');
> -
>         if (buf[2] == '?' && buf[3] == '\\') {
>           prefix = L"";
>           needs_fullpath = false;
>
>
> Thanks
> Christoph
>



More information about the hotspot-runtime-dev mailing list