mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8066448: SmallCodeCacheStartup.java exits with exit code 1
Check for VirtualMachineError in case VM initialization fails. Reviewed-by: kvn
This commit is contained in:
parent
65fe921d3d
commit
f9806ff009
2 changed files with 18 additions and 11 deletions
|
@ -936,7 +936,7 @@ address Method::make_adapters(methodHandle mh, TRAPS) {
|
|||
// so making them eagerly shouldn't be too expensive.
|
||||
AdapterHandlerEntry* adapter = AdapterHandlerLibrary::get_adapter(mh);
|
||||
if (adapter == NULL ) {
|
||||
THROW_MSG_NULL(vmSymbols::java_lang_VirtualMachineError(), "out of space in CodeCache for adapters");
|
||||
THROW_MSG_NULL(vmSymbols::java_lang_VirtualMachineError(), "Out of space in CodeCache for adapters");
|
||||
}
|
||||
|
||||
mh->set_adapter_entry(adapter);
|
||||
|
|
|
@ -24,12 +24,13 @@
|
|||
/*
|
||||
* @test
|
||||
* @bug 8023014
|
||||
* @summary Test ensures that there is no crash if there is not enough ReservedCodeacacheSize
|
||||
* @summary Test ensures that there is no crash if there is not enough ReservedCodeCacheSize
|
||||
* to initialize all compiler threads. The option -Xcomp gives the VM more time to
|
||||
* to trigger the old bug.
|
||||
* trigger the old bug.
|
||||
* @library /testlibrary
|
||||
*/
|
||||
import com.oracle.java.testlibrary.*;
|
||||
import static com.oracle.java.testlibrary.Asserts.assertTrue;
|
||||
|
||||
public class SmallCodeCacheStartup {
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
@ -38,7 +39,13 @@ public class SmallCodeCacheStartup {
|
|||
"-Xcomp",
|
||||
"-version");
|
||||
OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
|
||||
try {
|
||||
analyzer.shouldHaveExitValue(0);
|
||||
} catch (RuntimeException e) {
|
||||
// Error occurred during initialization, did we run out of adapter space?
|
||||
assertTrue(analyzer.getOutput().contains("VirtualMachineError: Out of space in CodeCache"),
|
||||
"Expected VirtualMachineError");
|
||||
}
|
||||
|
||||
System.out.println("TEST PASSED");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue