Bug 205229 - java/openjdk8 possible unsatisfied link of getSystemCpuLoad()
Summary: java/openjdk8 possible unsatisfied link of getSystemCpuLoad()
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Greg Lewis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-10 20:23 UTC by Tobias Feldhaus
Modified: 2018-03-15 22:58 UTC (History)
5 users (show)

See Also:


Attachments
Java Stacktrace (2.18 KB, text/plain)
2015-12-10 20:23 UTC, Tobias Feldhaus
no flags Details
stacktrace for new crash with build 1.8.0_66-b17 (31.38 KB, text/plain)
2016-01-03 15:23 UTC, Tobias Feldhaus
no flags Details
Stacktrace of selfpatched build that returns 0 instead of -1 (31.92 KB, text/plain)
2016-01-05 08:40 UTC, Tobias Feldhaus
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Feldhaus 2015-12-10 20:23:35 UTC
Created attachment 164087 [details]
Java Stacktrace

While trying to port Facebook's Presto (https://prestodb.io/) to FreeBSD 10.2, I got the following exception (running openjdk8-8.60.24_1):

javax.management.RuntimeErrorException: java.lang.UnsatisfiedLinkError: sun.management.OperatingSystemImpl.getSystemCpuLoad()D

(Stacktrace is attached) Could this be an OpenJDK bug?
Comment 1 Jung-uk Kim freebsd_committer freebsd_triage 2015-12-10 20:50:59 UTC
(In reply to Tobias Feldhaus from comment #0)
> Could this be an OpenJDK bug?

It is one of unimplemented features for BSD platforms.
Comment 2 Tobias Feldhaus 2015-12-10 21:22:04 UTC
(In reply to Jung-uk Kim from comment #1)

So there is no way to make software work that uses com.sun.jmx.mbeanserver.JmxMBeanServer as this is dependent on this method?
Comment 3 Jung-uk Kim freebsd_committer freebsd_triage 2015-12-10 23:26:58 UTC
(In reply to Tobias Feldhaus from comment #2)
> So there is no way to make software work that uses
> com.sun.jmx.mbeanserver.JmxMBeanServer as this is dependent on this method?

Correct, at least for now.
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-01-02 09:30:31 UTC
A commit references this bug:

Author: glewis
Date: Sat Jan  2 09:30:21 UTC 2016
New revision: 405058
URL: https://svnweb.freebsd.org/changeset/ports/405058

Log:
  . Stub implementation of OperatingSystemImpl.

  PR:		205229

Changes:
  head/java/openjdk8/Makefile
  head/java/openjdk8/files/patch-jdk-src-solaris-native-sun-management-BsdOperatingSystem.c
Comment 5 Tobias Feldhaus 2016-01-03 15:23:52 UTC
Created attachment 165000 [details]
stacktrace for new crash with build 1.8.0_66-b17
Comment 6 Tobias Feldhaus 2016-01-03 15:25:28 UTC
With newest OpenJDK version from the Ports tree the build fails with an Internal Error (os_bsd.cpp:4321). See new Attachment (OpenJDK Runtime Environment (8.0_66-b17) (build 1.8.0_66-b17).

ports r405058
Comment 7 Kubilay Kocak freebsd_committer freebsd_triage 2016-01-03 16:13:24 UTC
Assign to committer that .. committed/resolved

@Tobias, please create a new issue for the build regression please, adding this issue (bug 205229) to the See Also: field
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2016-01-03 16:24:01 UTC
This issue can be closed now. The regression (reported in comment 6) is being tracked in bug 205843
Comment 9 Greg Lewis freebsd_committer freebsd_triage 2016-01-03 20:53:30 UTC
The issue should stay open.  All my commit did was correctly indicate that these functions are unimplemented on FreeBSD.  I've closed 205843 as working as intended.  This stays open to track that they are unimplemented and that we need to come up with an implementation.
Comment 10 Greg Lewis freebsd_committer freebsd_triage 2016-01-04 00:21:36 UTC
If you want to get Presto working, then alter the patch I committed last time to return 0 instead of -1.  -1 indicates the feature is unimplemented (which is true).  0 will mean you get garbage data but the feature will be detected as implemented.
Comment 11 Tobias Feldhaus 2016-01-05 08:38:48 UTC
Thanks Greg, however, even when I alter the patch to return 0 instead of -1 and do an uninstall - clean - reinstall, the Stacktrace stays almost the same. (See new stacktrace.)
Comment 12 Tobias Feldhaus 2016-01-05 08:40:40 UTC
Created attachment 165095 [details]
Stacktrace of selfpatched build that returns 0 instead of -1
Comment 13 Jung-uk Kim freebsd_committer freebsd_triage 2016-01-05 21:50:32 UTC
Your stack trace shows it has nothing to do with the original PR.  Actually, the crash is related to Bug 205523.
Comment 14 commit-hook freebsd_committer freebsd_triage 2016-01-13 18:14:31 UTC
A commit references this bug:

Author: jkim
Date: Wed Jan 13 18:13:57 UTC 2016
New revision: 406064
URL: https://svnweb.freebsd.org/changeset/ports/406064

Log:
  MFH:	r405058, r405320

  - Stub implementation of OperatingSystemImpl.
  - Partially implement getThreadUserTime() using getrusage(2).  Note we can
  only get usage for the current thread.  Return -1 if the requested function
  is not supported, i.e., user time for other threads, rather than crash.
  - Properly implement os::elapsedVTime() using getrusage().  Basically, it is
  taken from Linux version.
  - Temporarily revert r403748 to fix bootstrapping with earlier OpenJDK8.

  PR:		205229, 205523, 205544, 205843
  Approved by:	ports-secteam (feld)

Changes:
_U  branches/2016Q1/
  branches/2016Q1/java/openjdk8/Makefile
  branches/2016Q1/java/openjdk8/files/patch-hotspot_src_os_bsd_vm_os__bsd.cpp
  branches/2016Q1/java/openjdk8/files/patch-jdk-src-solaris-native-sun-management-BsdOperatingSystem.c
Comment 15 Walter Schwarzenfeld freebsd_triage 2018-01-13 01:12:25 UTC
Forgotten to close?
Comment 16 TAO ZHOU 2018-03-14 23:49:36 UTC
Is there a plan to implement this feature in FreeBSD.
I am using pinpoint and there are no CPU data. At the logs, I see cpuLoad:TCpuLoad(jvmCpuLoad:-1.0, systemCpuLoad:-1.0).

I would rather see the java exception instead of -1.