Bug 721068 - visualvm has a null-pointer exception when trying to show allocation stack trace
Summary: visualvm has a null-pointer exception when trying to show allocation stack trace
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: visualvm
Version: 15
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: jiri vanek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-13 16:01 UTC by Andreas Girgensohn
Modified: 2012-08-07 16:42 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-07 16:42:14 UTC
Type: ---


Attachments (Terms of Use)
Log file (68.95 KB, application/octet-stream)
2011-07-13 16:01 UTC, Andreas Girgensohn
no flags Details
Memory snapshot (93.48 KB, application/octet-stream)
2011-07-13 16:03 UTC, Andreas Girgensohn
no flags Details

Description Andreas Girgensohn 2011-07-13 16:01:40 UTC
Created attachment 512695 [details]
Log file

Description of problem:

When selecting "Show Allocation Stack Trace" for an item in a memory profiler snapshot of Tomcat 6, only an indication of an exception appears.  The attached log file shows the stack trace.

Version-Release number of selected component (if applicable):

tomcat6-6.0.32-5.fc15.noarch
java-1.6.0-openjdk-1.6.0.0-58.1.10.2.fc15.x86_64
visualvm-1.3.2-1.2.8.fc15.x86_64

How reproducible:

Only for snapshots taken when Tomcat was busy.  Later snapshots of the same process work fine.

Steps to Reproduce:
1. Select the Tomcat process in VisualVM.
2. Select "Record allocations stack traces" in "Memory settings"
3. Start the memory profiler
4. Take a snapshot
5. Select "Show Allocation Stack Trace" for an item in the list
  
Actual results:

Indication of an exception

Expected results:

Display of memory allocation traces

Additional info:

Comment 1 Andreas Girgensohn 2011-07-13 16:03:10 UTC
Created attachment 512697 [details]
Memory snapshot

Comment 2 Andreas Girgensohn 2011-07-13 19:43:00 UTC
This patch provides a band-aid for the situation.  It does not address the root cause of why className is null but it allows the display of the allocation stack trace.  Leaving className as null prevents the whole tree from getting displayed no matter what the value of thisNodeOk is.

--- netbeans/lib.profiler/src/org/netbeans/lib/profiler/results/memory/PresoObjAllocCCTNode.java~  2010-10-29 10:00:35.000000000 -0700
+++ netbeans/lib.profiler/src/org/netbeans/lib/profiler/results/memory/PresoObjAllocCCTNode.java   2011-07-13 11:47:20.000000000 -0700
@@ -274,6 +274,8 @@
             }
         }
 
+        if (className == null)
+          className = "unknown";
         // If any object allocations that happen in our own code are caught (which shouldn't happen),
         // make sure to conceal this data here.
         boolean thisNodeOk = !className.equals("org.netbeans.lib.profiler.server.ProfilerServer"); // NOI18N

Comment 3 Andreas Girgensohn 2011-07-14 00:44:49 UTC
I discovered warnings in /var/log/tomcat6/catalina.out

Profiler Agent: JNI On Load Initializing...
Profiler Agent: JNI OnLoad Initialized successfully
Profiler Agent: Waiting for connection on port 5140 (Protocol version: 10)
Profiler Agent: Established connection with the tool
Profiler Agent: Local accelerated session
Profiler Agent: 250 classes cached.
Profiler Agent: 250 classes cached.
*** Profiler engine warning: class sun.reflect.GeneratedSerializationConstructorAccessor25 that should be instrumented is not loaded by target VM
*** Requested classloader: sun.reflect.DelegatingClassLoader@163fc47c, its class = class sun.reflect.DelegatingClassLoader, index = 3, hashcode = 373277820
*** Profiler engine warning: target VM cannot load class to instrument sun.reflect.GeneratedSerializationConstructorAccessor25
*** probably it has been unloaded recently
... (about 50 more classes that could not be loaded)
Profiler Agent: Redefining 100 classes at idx 0, out of total 1183 
Profiler Agent: Redefining 100 classes at idx 100, out of total 1183 
... 
Profiler Agent: Redefining 83 classes at idx 1100, out of total 1183 
Profiler Agent Warning: Cannot convert 0x7f7614000b70
Profiler Agent Warning: Cannot convert 0x7f7614000b78
... (298 different values; warnings displayed about 880,000 times)
Profiler Agent Warning: Cannot convert 0x7f763c00aef0

Comment 4 Fedora End Of Life 2012-08-07 16:42:16 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


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