JDK-8038201 : Clean up misleading usage of malloc() in init_system_properties_values()
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: aix
  • Submitted: 2014-03-24
  • Updated: 2014-07-29
  • Resolved: 2014-04-01
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
8u20Fixed 9 b08Fixed
Description
In init_system_properties_values() NEW_C_HEAP_ARRAY is defined to malloc.
After calls to this macro, the result was checked for NULL.

Actually, NEW_C_HEAP_ARRAY exit the vm if it can not allocate memory.

Remove the misleading malloc macro and remove unnecessary checks for null
in os_linux.cpp and os_aix.cpp.
Comments
Or, you can change to NEW_C_HEAP_ARRAY_RETURN_NULL if you do want to handle the allocation failure.
24-03-2014