JDK-8208676 : Missing NULL check and resource leak in NetworkPerformanceInterface::NetworkPerformance::network_utilization
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 11
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: linux_redhat_7.3
  • CPU: x86
  • Submitted: 2018-08-02
  • Updated: 2018-08-23
  • Resolved: 2018-08-08
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 11 JDK 12
11 b27Fixed 12Fixed
Related Reports
Relates :  
Description
I have a consistent crash on RHEL 7.5 (didn't try other OS yet) when testing Mission Control with the latest mercurial of JDK 11 (at the time of writing this is revision 3f5a55b6bad8 from http://hg.openjdk.java.net/jdk/client/).

The crash is consistent and happens every time, the application I'm testing is the J2Demo that comes with the same JDK 11. The JDK is compiled from command line with all default options, no custom patches or changes.

I'm attaching the hs_err.

Mission Control seems to be able to record some events before the target JVM crashes.

Comments
Fix request approved.
07-08-2018

Fix Request This should be fixed for JDK11 as it would otherwise make JFR crash with default settings on certain machines. It may also not be possible to work around it depending on the interface configuration on the machine. The fix is simply to add a NULL check before a field access and ignore any such interfaces. In addition, a missing free should be added to avoid a memory leak. The risk should be close to 0%. The fix has been verified manually as well as passing existing tests. Markus Gr��nlund has reviewed it. The change can be found here: http://cr.openjdk.java.net/~rwestberg/8208676/webrev.01/
07-08-2018

Could reproduce this, it happens when the system has an interface without any address assigned. More specifically, the ifa_addr field in the ifaddrs struct returned by getifaddrs can be NULL. Simple way to reproduce on Fedora Core 28: $ sudo ip tuntap add tun42 mode tun Need to add a NULL check before dereferencing the field. Not quite sure it's feasible to create a regression test case for this as it requires machine-global configuration, I've verified it manually.
06-08-2018

[~rwestberg], can you take a look? I think this may be related to JDK-8003209.
02-08-2018

Impact: High (crash) Likelihood: Medium (happens every time on RHEL 7,5 when using JFR) Workaround: High (no know workaround) ILW = HMH = > P1
02-08-2018