RFR(S): 8247732: validate user-input intrinsic_ids in ControlIntrinsic
Liu, Xin
xxinliu at amazon.com
Wed Jul 22 07:12:40 UTC 2020
hi, Tobias,
Thank you to review my patch.
I make changes according to your feedbacks. here is the updated revision:
https://cr.openjdk.java.net/~xliu/8247732/01/webrev/
1. I move the validation logic for compiler directives to compilerOracle::scan_flag_and_value.
If something wrong happens in parser, the patch will "gracefully" quit JVM using jvm_exit(1). is that okay?
here is the example:
$./build/linux-x86_64-server-release/jdk/bin/java -XX:CompileCommand=option,java.util.HashMap::putVal,ccstrlist,DisableIntrinsic,_hello -version
CompileCommand: An error occurred during parsing
Line: option,java/util/HashMap putVal ccstrlist DisableIntrinsic _hello
Error: Unrecognized intrinsic detected in DisableIntrinsic: _hello
Usage: '-XX:CompileCommand=command,"package/Class.method()"'
Use: '-XX:CompileCommand=help' for more information.
2. I removed Method::external_name_short().
3. fixed indentation issue.
Test:
hotspot:tier1 and gtest:all
thanks,
--lx
________________________________________
From: Tobias Hartmann <tobias.hartmann at oracle.com>
Sent: Monday, July 20, 2020 1:23 AM
To: Liu, Xin; Nils Eliasson; hotspot-compiler-dev at openjdk.java.net; hotspot-runtime-dev
Subject: RE: [EXTERNAL] RFR(S): 8247732: validate user-input intrinsic_ids in ControlIntrinsic
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
Hi,
On 08.07.20 10:26, Liu, Xin wrote:
> ControlIntrinsic/DisableIntrinsic in compiler directives are more complex. The matched directive is only parsed when hotspot attempts to compile the corresponding method.
>
> I validate at that time and JVM will crash if it doesnot meet guarantee() statement.
I don't think a guarantee should be used here, i.e. the VM shouldn't crash but we should exit
gracefully with an error message. Isn't it possible to piggy-back on the error mechanism in
DirectivesParser?
> I added Method::external_name_short() which only returns the shorter method name in the form of "classname::method".
>
> Probably hotspot has had similar code, but I failed to discover. please let me know and I will remove it.
I would just use name_and_sig_as_C_string().
jvmFlagConstraintList.cpp:180/181
- Wrong indentation
jvmFlagConstraintsCompiler.cpp:388/400
- Maybe change the error message to "Unrecognized intrinsic detected in DisableIntrinsic [...]"
Best regards,
Tobias
More information about the hotspot-compiler-dev
mailing list