JDK-8218581 : Incorrect exception message generation
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,12,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-02-06
  • Updated: 2019-10-04
  • Resolved: 2019-02-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13
11.0.5Fixed 13 b08Fixed
Related Reports
Relates :  
Description
The code which generates the message for the IllegalArgumentException when defining a module with an disallowed package name is not allocating enough resource area space for the message.

Specifically, this code in modules.cpp (http://hg.openjdk.java.net/jdk/jdk/file/d02f1f4ff3a6/src/hotspot/share/classfile/modules.cpp#l338):

    size_t pkg_len = strlen(package_name);
    char* pkg_name = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, pkg_len);
    strncpy(pkg_name, package_name, pkg_len);
    StringUtils::replace_no_expand(pkg_name, "/", ".");


Comments
Fix Request: Applies cleanly and fixes an inconsistency. Verified with tier1 testing. The fix was pushed to 13 in february this year and there was not follow up bugs AFAICT and the change is trivial.
20-08-2019