JDK-8027914 : Client JVM silently exit with fail exit code when running in compact(1,2) with options -Dcom.sun.management and -XX:+ManagementServer
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8u60
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2013-11-06
  • Updated: 2015-09-29
  • Resolved: 2015-03-17
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 8 JDK 9
8u60 b08Fixed 9Fixed
Related Reports
Relates :  
Description
There is no message about failed exit.

roman@rmatafon:~/development/EmbMinimalVMTestSuite/src$ /home/roman/prog/jdk/jres/compact2-b114/bin/java -client -Dcom.sun.management -version
roman@rmatafon:~/development/EmbMinimalVMTestSuite/src$ echo $?
1
roman@rmatafon:~/development/EmbMinimalVMTestSuite/src$ /home/roman/prog/jdk/jres/compact2-b114/bin/java -client -version
java version "1.8.0-ea"
Java(TM) SE Embedded Runtime Environment (build 1.8.0-ea-b114, profile compact2, headless)
Java HotSpot(TM) Embedded Client VM (build 25.0-b56, mixed mode)
roman@rmatafon:~/development/EmbMinimalVMTestSuite/src$ echo $?
0

Comments
Re-targetted to 8u60
21-10-2014

The fix in not in mainline 8u - that is what this bug is for.
04-09-2014

Can this bug be closed since the fix has gone into 8u6 and 9?
03-09-2014

8-pool is not a valid AffectsVersion - it should have been left at 8.
18-12-2013

The Agent would print a rather terse message on failure and then hit this exit path, so I don't think we need to go to great lengths to try and explain that this is a compact profile etc. I think we can simply modify Management::initialize as follows: // Load and initialize the sun.management.Agent class // invoke startAgent method to start the management server Handle loader = Handle(THREAD, SystemDictionary::java_system_loader()); Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, ! THREAD); + if (HAS_PENDING_EXCEPTION) + vm_exit_during_initialization("Management agent initialization failure") and perhaps include the exception type & message.
06-11-2013

This happens because in client and server VM we have management VM code so -Dcom.sun.management argument is accepted. However, depending on which profile you are running, there may or may not be the sun.management.Agent class. If that class is not present then the initialization of management code fails when called from the early VM init code in thread.cpp::create_vm(): #if INCLUDE_MANAGEMENT Management::initialize(THREAD); #endif // INCLUDE_MANAGEMENT if (HAS_PENDING_EXCEPTION) { // management agent fails to start possibly due to // configuration problem and is responsible for printing // stack trace if appropriate. Simply exit VM. vm_exit(1); } That is where the process exit code gets generated. I suppose that in management::initialize() we can print a better message?
06-11-2013