From the review of JEP 479:
In src/hotspot/os/windows/os_windows.cpp, around line 5863: https://github.com/openjdk/jdk/pull/21744#discussion_r1828969105
"[pre-existing, and can't comment on line 5858 because it's not sufficiently near a change.] The calculation of len is wasting a byte when lib_name is null. The +2 accounts for the terminating NUL and the underscore separator between the sym_name part and the lib_name part. That underscore isn't added when there isn't a lib_name part. I think the simplest fix would be to change name_len to (name_len +1) and +2 to +1 in that calculation. And add some
commentary.
-----
The same code pattern exists in os_posix.cpp
I opted for a solution where name_len always reflects the actual length of the lib name - otherwise we need to subtract the 1 again when doing the strncat. I also made the need for the underscore explicit.
In src/hotspot/os/windows/os_windows.cpp, around line 5863: https://github.com/openjdk/jdk/pull/21744#discussion_r1828969105
"[pre-existing, and can't comment on line 5858 because it's not sufficiently near a change.] The calculation of len is wasting a byte when lib_name is null. The +2 accounts for the terminating NUL and the underscore separator between the sym_name part and the lib_name part. That underscore isn't added when there isn't a lib_name part. I think the simplest fix would be to change name_len to (name_len +1) and +2 to +1 in that calculation. And add some
commentary.
-----
The same code pattern exists in os_posix.cpp
I opted for a solution where name_len always reflects the actual length of the lib name - otherwise we need to subtract the 1 again when doing the strncat. I also made the need for the underscore explicit.
- relates to
-
JDK-8343703 Symbol name cleanups after JEP 479
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk/3d0d0e62
-
Review(master) openjdk/jdk/22404