Bug 1150932 - Include JDK with support for debugging internal JDK classes
Summary: Include JDK with support for debugging internal JDK classes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.8.0-openjdk
Version: 20
Hardware: All
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Omair Majid
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-09 08:33 UTC by Dominik Pospisil
Modified: 2015-05-27 16:03 UTC (History)
4 users (show)

Fixed In Version: java-1.8.0-openjdk-1.8.0.45-38.b14.fc20
Clone Of:
Environment:
Last Closed: 2015-05-27 16:03:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
compile java code using -g (328 bytes, patch)
2014-10-09 21:08 UTC, Omair Majid
no flags Details | Diff

Description Dominik Pospisil 2014-10-09 08:33:49 UTC
Description of problem:
Unable to step into JDK internal classes while debugging java code.

Please include JDK with debugging support so it is possible to step into JDK code and inspect variables as usual.

Actual results:
Variable information is not available, source compiled without -g option. Value of "stack" is not known.

Expected results:
Full debugging support.

It seems to be very difficult to trace down and report JDK related bugs in Fedora without JDK with debugging support.

Comment 1 Deepak Bhole 2014-10-09 14:30:51 UTC
We do ship the JDK with debugging info. Do you have java-1.8.0-openjdk-debuginfo installed?

Comment 2 Omair Majid 2014-10-09 20:07:15 UTC
I can confirm the behaviour. With the -src package installed, I can step into the classes and see the arguments and see the object itself but information about local variables is missing.

I am looking for a fix.

Comment 3 Omair Majid 2014-10-09 21:08:32 UTC
Created attachment 945437 [details]
compile java code using -g

This patch forces the build to use the `-g` flag with javac. It seems to work locally (at least, I can step into HashMap.getNode(int, Object) and see the value of the local variables).

I am not sure if this patch is the best approach - it diverges further from a plain upstream build. There are two possible options to consider: create a new debug flag upstream which (theoretically) doesn't alter optimizations from `release` but add all debug info in all places (in both java and native code). Or maybe patch upstream to add javac debug info on a standard OPENJDK build (like we already do with native code).

Comment 4 Andrew John Hughes 2014-10-09 23:49:12 UTC
Ah, both Deepak and I assumed you meant native code...

Omair, there is already such an option; DEBUG_CLASSFILES=true. If it's set and not being honoured, that's yet another regression in this new build system.

Comment 5 Dominik Pospisil 2014-10-10 07:33:35 UTC
How is that option supposed to work? I have tried setting this before launching debugged java app and debugger but did not help. Or is it JDK compile time switch?

Comment 6 Omair Majid 2014-10-10 14:48:14 UTC
(In reply to Andrew John Hughes from comment #4)
> Omair, there is already such an option; DEBUG_CLASSFILES=true. If it's set
> and not being honoured, that's yet another regression in this new build
> system.

It's not being set in the spec file. Let me test if adding it fixes it.

(In reply to Dominik Pospisil from comment #5)
> Or is it JDK compile time switch?

It's a compile time switch. The java-1.8.0-openjdk package will need to be updated.

Comment 7 Omair Majid 2014-10-10 15:29:21 UTC
DEBUG_CLASSFILES doesn't seem to work anymore :(

It is still defined in a number of places but not used:

$ grep -r CLASSFILES common/ make/ jdk/ hotspot/ build/
common/autoconf/jdk-options.m4:      DEBUG_CLASSFILES="false"
common/autoconf/jdk-options.m4:      DEBUG_CLASSFILES="true"
common/autoconf/jdk-options.m4:      DEBUG_CLASSFILES="true"
common/autoconf/jdk-options.m4:  AC_SUBST(DEBUG_CLASSFILES)
common/autoconf/generated-configure.sh:DEBUG_CLASSFILES
common/autoconf/generated-configure.sh:      DEBUG_CLASSFILES="false"
common/autoconf/generated-configure.sh:      DEBUG_CLASSFILES="true"
common/autoconf/generated-configure.sh:      DEBUG_CLASSFILES="true"
common/autoconf/hotspot-spec.gmk.in:DEBUG_CLASSFILES:=@DEBUG_CLASSFILES@
hotspot/src/share/vm/classfile/classFileStream.hpp:#ifndef SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP
hotspot/src/share/vm/classfile/classFileStream.hpp:#define SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP
hotspot/src/share/vm/classfile/classFileStream.hpp:#endif // SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP
build/jdk8.build/config.status:S["DEBUG_CLASSFILES"]="false"
Binary file build/jdk8.build/hotspot/linux_amd64_compiler2/product/precompiled.hpp.gch matches
build/jdk8.build/config.log:DEBUG_CLASSFILES='false'
build/jdk8.build/hotspot-spec.gmk:DEBUG_CLASSFILES:=false

Comment 8 Omair Majid 2014-10-10 19:42:59 UTC
I pinged upstream about this:
http://mail.openjdk.java.net/pipermail/build-dev/2014-October/013397.html

Comment 9 Omair Majid 2015-04-16 17:27:32 UTC
This was fixed for F22:
http://pkgs.fedoraproject.org/cgit/java-1.8.0-openjdk.git/commit/?id=9f31375ff638192c9bdd1a42efb8e1d6968af044

I will backport it to F20.

Comment 10 Omair Majid 2015-04-16 20:18:05 UTC
Fixed in java-1.8.0-openjdk-1.8.0.45-32.b13.fc20, but I am not going to push it right now. There's a security update in updates-testing and I don't want this minor bugfix to obsolete that.

Comment 11 Fedora Update System 2015-05-05 21:12:07 UTC
java-1.8.0-openjdk-1.8.0.45-32.b13.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/java-1.8.0-openjdk-1.8.0.45-32.b13.fc20

Comment 12 Fedora Update System 2015-05-14 12:49:28 UTC
java-1.8.0-openjdk-1.8.0.45-38.b14.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/java-1.8.0-openjdk-1.8.0.45-38.b14.fc20

Comment 13 Fedora Update System 2015-05-15 13:33:52 UTC
Package java-1.8.0-openjdk-1.8.0.45-38.b14.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing java-1.8.0-openjdk-1.8.0.45-38.b14.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-8251/java-1.8.0-openjdk-1.8.0.45-38.b14.fc20
then log in and leave karma (feedback).

Comment 14 Fedora Update System 2015-05-27 16:03:51 UTC
java-1.8.0-openjdk-1.8.0.45-38.b14.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.