You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "patrickptibco (via GitHub)" <gi...@apache.org> on 2023/08/17 19:34:58 UTC
[GitHub] [netbeans] patrickptibco opened a new issue, #6357: NPE when parsing STICKY_CLASS tags in hprof heap dump
patrickptibco opened a new issue, #6357:
URL: https://github.com/apache/netbeans/issues/6357
### Apache NetBeans version
Apache NetBeans 18
### What happened
I was attempting to load a hprof from visualvm 2.1.6 in the netbeans profiler. Instead of loading, it threw an NPE
```
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.netbeans.lib.profiler.heap.Instance.getInstanceId()" because the return value of "org.netbeans.lib.profiler.heap.GCRoot.getInstance()" is null
at org.netbeans.lib.profiler.heap.HprofGCRoots.getGCRoot(HprofGCRoots.java:96)
at org.netbeans.lib.profiler.heap.NearestGCRoot.writeConnection(NearestGCRoot.java:311)
at org.netbeans.lib.profiler.heap.NearestGCRoot.writeClassConnection(NearestGCRoot.java:294)
at org.netbeans.lib.profiler.heap.NearestGCRoot.computeOneLevel(NearestGCRoot.java:219)
at org.netbeans.lib.profiler.heap.NearestGCRoot.computeGCRoots(NearestGCRoot.java:109)
at org.netbeans.lib.profiler.heap.NearestGCRoot.getLeaves(NearestGCRoot.java:373)
at org.netbeans.lib.profiler.heap.HprofHeap.computeRetainedSize(HprofHeap.java:704)
at org.netbeans.lib.profiler.heap.HprofHeap.getBiggestObjectsByRetainedSize(HprofHeap.java:186)
```
### How to reproduce
Minimal code:
```java
package simpletest;
import java.io.File;
import org.netbeans.lib.profiler.heap.HeapFactory;
public class Test {
public static void main(String[] args) throws Exception {
HeapFactory.createHeap(new File(args[0])).getBiggestObjectsByRetainedSize(15); // number doesn't matter
}
}
```
Minimal pom:
```xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.netbeans.modules</groupId>
<artifactId>org-netbeans-lib-profiler</artifactId>
<version>RELEASE180</version>
</dependency>
</dependencies>
</project>
```
Dump causing issues: [upload error]
I narrowed it down to the tags from `computeGCRootsFor(heap.getHeapTagBound(HprofHeap.ROOT_STICKY_CLASS), rootList);` being somehow wrong. Commenting out the sticky class in HprofGCRoots avoids the crash, but obviously isn't correct.
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
RHEL8.8
### JDK
openjdk 1.8.0.372 && oracle 17.0.6
### Apache NetBeans packaging
Other
### Anything else
From maven jars.
Triggering hprof: Uploading, please hold
### Are you willing to submit a pull request?
No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] NPE when parsing STICKY_CLASS tags in hprof heap dump [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #6357:
URL: https://github.com/apache/netbeans/issues/6357#issuecomment-1817892042
@thurka you are probably the most qualified to take a look at this. I suppose the heapdump format changed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] NPE when parsing STICKY_CLASS tags in hprof heap dump [netbeans]
Posted by "32kda (via GitHub)" <gi...@apache.org>.
32kda commented on issue #6357:
URL: https://github.com/apache/netbeans/issues/6357#issuecomment-4665873693
I think the same issue here, while trying to get retained size:
`java.lang.NullPointerException: Cannot invoke "org.netbeans.lib.profiler.heap.Instance.getInstanceId()" because the return value of "org.netbeans.lib.profiler.heap.GCRoot.getInstance()" is null
at org.netbeans.lib.profiler.heap.HprofGCRoots.getGCRoot(HprofGCRoots.java:96)
at org.netbeans.lib.profiler.heap.NearestGCRoot.writeConnection(NearestGCRoot.java:311)
at org.netbeans.lib.profiler.heap.NearestGCRoot.writeConnection(NearestGCRoot.java:303)
at org.netbeans.lib.profiler.heap.NearestGCRoot.computeOneLevel(NearestGCRoot.java:213)
at org.netbeans.lib.profiler.heap.NearestGCRoot.computeGCRoots(NearestGCRoot.java:109)
at org.netbeans.lib.profiler.heap.NearestGCRoot.getLeaves(NearestGCRoot.java:373)
at org.netbeans.lib.profiler.heap.HprofHeap.computeRetainedSize(HprofHeap.java:704)
at org.netbeans.lib.profiler.heap.HprofHeap.getRetainedSize(HprofHeap.java:407)`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] NPE when parsing STICKY_CLASS tags in hprof heap dump [netbeans]
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing closed issue #6357: NPE when parsing STICKY_CLASS tags in hprof heap dump
URL: https://github.com/apache/netbeans/issues/6357
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists