JDK-5033592 : JVMTI Doc: Inconsistent character encoding for Agent_OnLoad option string, ...
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 5.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-04-19
  • Updated: 2017-05-16
  • Resolved: 2004-06-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.
Other
5.0 b55Fixed
Related Reports
Relates :  
Relates :  
Description

Name: nl37777			Date: 04/19/2004

The new JVMTI SPI function Agent_OnLoad receives an 
options string. The specification of Agent_OnLoad does not specify the 
character encoding used for Agent_OnLoad, and parts of the 
implementation disagree on the character encoding.

Agent_OnLoad receives the options from the command line through the JNI 
function JNI_CreateJavaVM. This function has traditionally received the 
options in platform encoding, and the specification is being updated 
under 4915107 to clarify this. However, the agents that provide the 
JDWP backend and the java.lang.instrument SPI interpret the option 
string as modified UTF-8, either by matching them against signatures 
obtained from functions such as GetClassSignature or by converting them 
to String objects using NewStringUTF.

The character encoding for the Agent_OnLoad options string needs to be 
clearly specified, and the necessary character conversions added to 
ensure that the options are interpreted correctly in all cases.
======================================================================

Name: nl37777			Date: 04/30/2004

A related problem exists for four functions provided in 
the JVMTI API:
     GetSystemProperty
     SetSystemProperty
     GetSystemProperties
     AddToBootstrapClassLoaderSearch
These functions assume that the strings that they accept or return are 
encoded in platform encoding. This is not documented, and in any case 
it would be better if these methods used the same encoding as all other 
JVMTI interfaces, that is, modified UTF-8.


======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta2 tiger-rc FIXED IN: tiger-rc INTEGRATED IN: tiger-b55 tiger-rc
08-07-2004

EVALUATION ###@###.### 2004-04-27 The JVMTI spec will be clarified to state that the option string is in the platfrom encoding. Also, see bug: 5038637 java -agent/-agentlib/-Xrunjdwp options not treated as platform encoded chars
08-07-2004

PUBLIC COMMENTS The new JVMTI SPI function Agent_OnLoad receives an options string. The specification of Agent_OnLoad does not specify the character encoding used for Agent_OnLoad, and parts of the implementation disagree on the character encoding. Agent_OnLoad receives the options from the command line through the JNI function JNI_CreateJavaVM. This function has traditionally received the options in platform encoding, and the specification is being updated under 4915107 to clarify this. However, the agents that provide the JDWP backend and the java.lang.instrument SPI interpret the option string as modified UTF-8, either by matching them against signatures obtained from functions such as GetClassSignature or by converting them to String objects using NewStringUTF. The character encoding for the Agent_OnLoad options string needs to be clearly specified, and the necessary character conversions added to ensure that the options are interpreted correctly in all cases. A related problem exists for four functions provided in the JVMTI API: GetSystemProperty SetSystemProperty GetSystemProperties AddToBootstrapClassLoaderSearch These functions assume that the strings that they accept or return are encoded in platform encoding. This is not documented, and in any case it would be better if these methods used the same encoding as all other JVMTI interfaces, that is, modified UTF-8.
08-07-2004

SUGGESTED FIX The entry point: Agent_OnLoad and the four functions: GetSystemProperty SetSystemProperty GetSystemProperties AddToBootstrapClassLoaderSearch must all clarify that their string parameters are modified UTF-8. ###@###.### 2004-05-18
18-05-2004