Open L12C opened 2 years ago
NPE is fixed by GH-368. BTW: You are running VisualVM 2.1, not 2.1.1 as mentioned above.
You're right about the version, I misread the package version which is 2.1-1.
Unfortunately, I wasn't able to build the current master branch to verify this fixes the error
Simply patching visualvm/visualvm/libs.profiler/lib.profiler/build.xml to include a more recent source and target version results in a different error:
You need to build it with JDK 8. See README.md.
Same issue here, VisualVM hangs as soon as any application is touched.
I with multiple different versions, including current version 2.1.7, jstack
produces the following thread-dump
"AWT-EventQueue-0" #22 prio=6 os_prio=0 cpu=1605,24ms elapsed=185,62s tid=0x00007f7760139000 nid=0x162e00 runnable [0x00007f776d67c000]
java.lang.Thread.State: RUNNABLE
at sun.tools.attach.VirtualMachineImpl.connect(jdk.attach@11.0.20.1/Native Method)
at sun.tools.attach.VirtualMachineImpl.<init>(jdk.attach@11.0.20.1/VirtualMachineImpl.java:119)
at sun.tools.attach.AttachProviderImpl.attachVirtualMachine(jdk.attach@11.0.20.1/AttachProviderImpl.java:58)
at com.sun.tools.attach.VirtualMachine.attach(jdk.attach@11.0.20.1/VirtualMachine.java:207)
at org.graalvm.visualvm.attach.AttachModelImpl.getVirtualMachine(AttachModelImpl.java:159)
at org.graalvm.visualvm.attach.AttachModelImpl.executeJCmd(AttachModelImpl.java:213)
- locked <0x00000000d5106200> (a org.graalvm.visualvm.attach.AttachModelImpl)
at org.graalvm.visualvm.attach.AttachModelImpl.executeJCmd(AttachModelImpl.java:182)
at org.graalvm.visualvm.jfr.model.impl.JfrModelImpl.executeJCmd(JfrModelImpl.java:216)
at org.graalvm.visualvm.jfr.model.impl.JfrModelImpl.isJfrAvailable(JfrModelImpl.java:86)
at org.graalvm.visualvm.jfr.model.impl.JfrModelProvider.createModelFor(JfrModelProvider.java:43)
at org.graalvm.visualvm.jfr.model.impl.JfrModelProvider.createModelFor(JfrModelProvider.java:39)
at org.graalvm.visualvm.core.model.ModelFactory.getModel(ModelFactory.java:105)
- locked <0x00000000d123af10> (a org.graalvm.visualvm.jvmstat.application.JvmstatApplication)
at org.graalvm.visualvm.tools.jfr.JfrModelFactory.getJFRFor(JfrModelFactory.java:64)
at org.graalvm.visualvm.jvm.JVMImpl.isJfrAvailable(JVMImpl.java:495)
at org.graalvm.visualvm.jfr.JFRSnapshotSupport.supportsJfrDump(JFRSnapshotSupport.java:140)
at org.graalvm.visualvm.jfr.impl.JFRDumpAction.isEnabled(JFRDumpAction.java:96)
at org.graalvm.visualvm.core.ui.actions.MultiDataSourceAction.updateState(MultiDataSourceAction.java:76)
at org.graalvm.visualvm.jfr.impl.JFRDumpAction.updateState(JFRDumpAction.java:118)
at org.graalvm.visualvm.core.ui.actions.DataSourceAction$1.selectionChanged(DataSourceAction.java:87)
at org.graalvm.visualvm.core.explorer.ExplorerSupport$ExplorerTreeSelectionListener.valueChanged(ExplorerSupport.java:272)
at javax.swing.JTree.fireValueChanged(java.desktop@11.0.20.1/JTree.java:2967)
at javax.swing.JTree$TreeSelectionRedirector.valueChanged(java.desktop@11.0.20.1/JTree.java:3456)
at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(java.desktop@11.0.20.1/DefaultTreeSelectionModel.java:641)
at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(java.desktop@11.0.20.1/DefaultTreeSelectionModel.java:1111)
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(java.desktop@11.0.20.1/DefaultTreeSelectionModel.java:297)
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(java.desktop@11.0.20.1/DefaultTreeSelectionModel.java:191)
at javax.swing.JTree.setSelectionPath(java.desktop@11.0.20.1/JTree.java:1656)
at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(java.desktop@11.0.20.1/BasicTreeUI.java:2736)
at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(java.desktop@11.0.20.1/BasicTreeUI.java:4016)
at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(java.desktop@11.0.20.1/BasicTreeUI.java:3955)
at java.awt.AWTEventMulticaster.mousePressed(java.desktop@11.0.20.1/AWTEventMulticaster.java:287)
at java.awt.Component.processMouseEvent(java.desktop@11.0.20.1/Component.java:6632)
at javax.swing.JComponent.processMouseEvent(java.desktop@11.0.20.1/JComponent.java:3342)
at org.graalvm.visualvm.core.explorer.ExplorerComponent$1.processMouseEvent(ExplorerComponent.java:110)
at java.awt.Component.processEvent(java.desktop@11.0.20.1/Component.java:6400)
at java.awt.Container.processEvent(java.desktop@11.0.20.1/Container.java:2263)
at java.awt.Component.dispatchEventImpl(java.desktop@11.0.20.1/Component.java:5011)
at java.awt.Container.dispatchEventImpl(java.desktop@11.0.20.1/Container.java:2321)
at java.awt.Component.dispatchEvent(java.desktop@11.0.20.1/Component.java:4843)
at java.awt.LightweightDispatcher.retargetMouseEvent(java.desktop@11.0.20.1/Container.java:4918)
at java.awt.LightweightDispatcher.processMouseEvent(java.desktop@11.0.20.1/Container.java:4544)
at java.awt.LightweightDispatcher.dispatchEvent(java.desktop@11.0.20.1/Container.java:4488)
at java.awt.Container.dispatchEventImpl(java.desktop@11.0.20.1/Container.java:2307)
at java.awt.Window.dispatchEventImpl(java.desktop@11.0.20.1/Window.java:2772)
at java.awt.Component.dispatchEvent(java.desktop@11.0.20.1/Component.java:4843)
at java.awt.EventQueue.dispatchEventImpl(java.desktop@11.0.20.1/EventQueue.java:772)
at java.awt.EventQueue$4.run(java.desktop@11.0.20.1/EventQueue.java:721)
at java.awt.EventQueue$4.run(java.desktop@11.0.20.1/EventQueue.java:715)
at java.security.AccessController.doPrivileged(java.base@11.0.20.1/Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(java.base@11.0.20.1/ProtectionDomain.java:85)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(java.base@11.0.20.1/ProtectionDomain.java:95)
at java.awt.EventQueue$5.run(java.desktop@11.0.20.1/EventQueue.java:745)
at java.awt.EventQueue$5.run(java.desktop@11.0.20.1/EventQueue.java:743)
at java.security.AccessController.doPrivileged(java.base@11.0.20.1/Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(java.base@11.0.20.1/ProtectionDomain.java:85)
at java.awt.EventQueue.dispatchEvent(java.desktop@11.0.20.1/EventQueue.java:742)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
at java.awt.EventDispatchThread.pumpOneEventForFilters(java.desktop@11.0.20.1/EventDispatchThread.java:203)
at java.awt.EventDispatchThread.pumpEventsForFilter(java.desktop@11.0.20.1/EventDispatchThread.java:124)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(java.desktop@11.0.20.1/EventDispatchThread.java:113)
at java.awt.EventDispatchThread.pumpEvents(java.desktop@11.0.20.1/EventDispatchThread.java:109)
at java.awt.EventDispatchThread.pumpEvents(java.desktop@11.0.20.1/EventDispatchThread.java:101)
at java.awt.EventDispatchThread.run(java.desktop@11.0.20.1/EventDispatchThread.java:90)
@centic9 Can you provide steps to reproduce it? Thanks.
It happens consistently when I open visualvm and click on any of the running java processes in the list.
It does not help me much. There must be something specific to your setup, OS, JVM or running java processes. it would be great if you can discover it. Are you able to replicate it in different environment? Like different machnie or under different user?
Any hint what to look for based on the stack-trace?
I.e. permission handling? JDK version mismatch? Inter-process communication problems? ...
It looks to me like Inter-process communication problem, but it is hard so say. What OS are you using? Can you attach VisualVM log file?
Sorry for the noise. After shutting down things one-by-one I found a Java process in a strange state which also did not react to normal kill
any more. After removing it via kill -9
, visualvm works again.
So a single broken process can break this type of communication for all Java processes on the same machine. :(
Thanks for update.
Describe the bug Clicking (Both left- and right-clicking) a running local application causes VisualVM to freeze.
To Reproduce This will probably not reproduce it for you, but it's all I did
Expected behavior VisualVM should open the view for this running process
VisualVM log
Click to expand
``` ------------------------------------------------------------------------------- >Log Session: Sunday, December 19, 2021 at 11:54:20 PM Central European Standard Time >System Info: Product Version = VisualVM 2.1 Operating System = Linux version 5.15.7-arch1-1 running on amd64 Java; VM; Vendor = 17.0.1; OpenJDK 64-Bit Server VM 17.0.1+12; N/A Runtime = OpenJDK Runtime Environment 17.0.1+12 Java Home = /usr/lib/jvm/java-17-openjdk System Locale; Encoding = de_DE (visualvm); UTF-8 Home Directory = /home/user Current Directory = /home/user User Directory = /home/user/.visualvm/2.1 Cache Directory = /home/user/.cache/visualvm/2.1 Installation = /usr/share/visualvm/visualvm /usr/share/visualvm/platform Boot & Ext. Classpath = Application Classpath = /usr/share/visualvm/platform/lib/boot.jar:/usr/share/visualvm/platform/lib/org-openide-modules.jar:/usr/share/visualvm/platform/lib/org-openide-util.jar:/usr/share/visualvm/platform/lib/org-openide-util-lookup.jar:/usr/share/visualvm/platform/lib/org-openide-util-ui.jar Startup Classpath = /usr/share/visualvm/platform/core/core-base.jar:/usr/share/visualvm/platform/core/asm-commons-8.0.1.jar:/usr/share/visualvm/platform/core/core.jar:/usr/share/visualvm/platform/core/org-netbeans-libs-asm.jar:/usr/share/visualvm/platform/core/asm-8.0.1.jar:/usr/share/visualvm/platform/core/org-openide-filesystems.jar:/usr/share/visualvm/platform/core/asm-tree-8.0.1.jar:/usr/share/visualvm/visualvm/core/org-graalvm-visualvm-modules-startup.jar:/usr/share/visualvm/visualvm/core/locale/core_visualvm.jar ------------------------------------------------------------------------------- INFO [org.netbeans.core.startup.NbEvents]: Turning on modules: org.openide.util.lookup [8.46 20210621-2172674416] org.openide.util [9.19 20210621-2172674416] org.openide.util.ui [9.20 20210621-2172674416] org.openide.modules [7.60 20210621-2172674416] org.netbeans.api.annotations.common/1 [1.40 20210621-2172674416] org.openide.filesystems [9.23 20210621-2172674416] org.openide.awt [7.80 20210621-2172674416] org.netbeans.api.progress/1 [1.60 20210621-2172674416] org.netbeans.api.progress.nb [1.60 20210621-2172674416] org.openide.dialogs [7.54 20210621-2172674416] org.openide.nodes [7.57 20210621-2172674416] org.openide.windows [6.89 20210621-2172674416] org.netbeans.modules.editor.mimelookup/1 [1.52 20210621-2172674416] org.openide.text [6.80 20210621-2172674416] org.netbeans.api.scripting [1.9 20210621-2172674416] org.netbeans.swing.tabcontrol [1.68 20210621-2172674416] org.netbeans.swing.outline [1.46 20210621-2172674416] org.openide.explorer [6.74 20210621-2172674416] org.openide.actions [6.51 20210621-2172674416] org.netbeans.modules.queries/1 [1.55 20210621-2172674416] org.netbeans.api.templates [1.20 20210621-2172674416] org.openide.filesystems.nb [9.22 20210621-2172674416] org.openide.loaders [7.81 20210621-2172674416] org.netbeans.api.intent [1.14 20210621-2172674416] org.netbeans.api.io [1.15 20210621-2172674416] org.openide.io [1.61 20210621-2172674416] org.netbeans.swing.plaf [1.54 20210621-2172674416] org.netbeans.modules.keyring [1.36 20210621-2172674416] org.netbeans.libs.asm [5.15 20210621-2172674416] org.netbeans.bootstrap/1 [2.90 20210621-2172674416] org.netbeans.core.startup.base [1.74.0.1 1 20210621-2172674416] org.netbeans.core.startup/1 [1.74.0.1 20210621-2172674416] org.netbeans.modules.sampler [1.26 20210621-2172674416] org.netbeans.core/2 [3.63 20210621-2172674416] org.netbeans.spi.quicksearch [1.39 20210621-2172674416] org.netbeans.modules.options.api/1 [1.57 20210621-2172674416] org.netbeans.libs.flatlaf/1 [1.6 20210621-2172674416] org.netbeans.swing.laf.flatlaf [1.5 20210621-2172674416] org.netbeans.modules.settings/1 [1.61 20210621-2172674416] org.netbeans.modules.sendopts/2 [2.48 20210621-2172674416] org.netbeans.modules.progress.ui [1.45 20210621-2172674416] org.netbeans.modules.options.keymap [1.49 20210621-2172674416] org.netbeans.modules.masterfs/2 [2.67.0.2 2 20210621-2172674416] org.netbeans.modules.masterfs.ui [2.15.0.2 20210621-2172674416] org.netbeans.modules.masterfs.nio2 [1.27 20210621-2172674416] org.netbeans.libs.jna/2 [2.7 20210621-2172674416] org.netbeans.modules.masterfs.linux [1.25 20210621-2172674416] org.netbeans.modules.keyring.fallback [1.20 20210621-2172674416] org.netbeans.modules.keyring.impl [1.36 20210621-2172674416] org.netbeans.modules.editor.mimelookup.impl/1 [1.44 20210621-2172674416] org.netbeans.modules.autoupdate.services [1.67 20210621-2172674416] org.netbeans.modules.autoupdate.ui [1.58 20210621-2172674416] org.netbeans.modules.autoupdate.cli [1.25 20210621-2172674416] org.netbeans.libs.jna.platform/2 [2.7 20210621-2172674416] org.netbeans.core.windows/2 [2.97 20210621-2172674416] org.netbeans.core.ui/1 [1.57 20210621-2172674416] org.netbeans.core.network [1.24 20210621-2172674416] org.netbeans.core.nativeaccess/1 [1.43 20210621-2172674416] org.netbeans.core.multitabs/1 [1.24.0.1 1 20210621-2172674416] org.netbeans.core.io.ui/1 [1.42 20210621-2172674416] org.graalvm.visualvm.lib.jfluid/2 [2.9 210708] org.graalvm.visualvm.lib.charts/2 [2.0 210708] org.graalvm.visualvm.lib.common/2 [2.4 210708] org.graalvm.visualvm.lib.profiler.api/2 [2.2 210708] org.graalvm.visualvm.lib.ui/2 [2.4 210708] org.graalvm.visualvm.uisupport/2 [2.1 210708] org.graalvm.visualvm.core/2 [2.4 210708] org.graalvm.visualvm.host/2 [2.1 210708] org.graalvm.visualvm.application/2 [2.2 210708] org.graalvm.visualvm.tools/2 [2.2 210708] org.graalvm.visualvm.coredump/2 [2.1 210708] org.graalvm.visualvm.threaddump/2 [2.1 210708] org.graalvm.visualvm.lib.profiler.utilities/2 [2.0 210708] org.graalvm.visualvm.lib.profiler.attach/2 [2.0 210708] org.graalvm.visualvm.lib.profiler/2 [2.4 210708] org.graalvm.visualvm.lib.profiler.snaptracer/2 [2.0 210708] org.graalvm.visualvm.profiling/2 [2.3 210708] org.graalvm.visualvm.lib.profiler.oql/2 [2.0 210708] org.graalvm.visualvm.lib.profiler.heapwalker/2 [2.1 210708] org.graalvm.visualvm.heapviewer/2 [2.3 210708] org.graalvm.visualvm.heapdump/2 [2.1 210708] org.graalvm.visualvm.sampler.truffle/2 [2.1 210708] org.graalvm.visualvm.sampler/2 [2.2 210708] org.graalvm.visualvm.sa/2 [2.0 210708] org.graalvm.visualvm.modules.startup/2 [2.1 210708] org.graalvm.visualvm.profiler/2 [2.1 210708] org.graalvm.visualvm.pluginimporter [1.0 210708] org.graalvm.visualvm.modules.appui/2 [2.1 210708] org.graalvm.visualvm.jvmstat/2 [2.0 210708] org.graalvm.visualvm.jvm/2 [2.0 210708] org.graalvm.visualvm.jmx/2 [2.2 210708] org.graalvm.visualvm.charts/2 [2.0 210708] org.graalvm.visualvm.jfr/2 [2.3 210708] org.graalvm.visualvm.jfr.jdk9/2 [2.1 210708] org.graalvm.visualvm.jfr.jdk11/2 [2.1 210708] org.graalvm.visualvm.jfr.generic/2 [2.1 210708] org.graalvm.visualvm.host.views/2 [2.0 210708] org.graalvm.visualvm.host.remote/2 [2.0 210708] org.graalvm.visualvm.heapviewer.truffle/2 [2.0 210708] org.graalvm.visualvm.heapviewer.console/2 [2.0 210708] org.graalvm.visualvm.application.views/2 [2.0 210708] org.graalvm.visualvm.graalvm/2 [2.0 210708] org.graalvm.visualvm.gotosource/2 [2.0 210708] org.graalvm.visualvm.attach/2 [2.0 210708] Cannot initialize GTK colors - using hardcoded defaults: java.lang.reflect.InaccessibleObjectException: Unable to make protected abstract java.awt.Color javax.swing.plaf.synth.SynthStyle.getColorForState(javax.swing.plaf.synth.SynthContext,javax.swing.plaf.synth.ColorType) accessible: module java.desktop does not "opens javax.swing.plaf.synth" to unnamed module @400efd6e INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy resolver: no suitable found, using fallback. INFO [org.netbeans.core.network.proxy.fallback.FallbackNetworkProxy]: Fallback system proxy resolver: no http_proxy variable found INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy reloading succeeded. INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy - mode: direct INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy: fell to default (correct if direct mode went before) INFO [org.netbeans.ui.metrics.laf]: USG_LOOK_AND_FEEL Diagnostic information Input arguments: -Djdk.home=/usr/lib/jvm/default -Dnetbeans.default_userdir_root=/home/user/.visualvm -Dnetbeans.dirs=/usr/share/visualvm/visualvm: -Dnetbeans.home=/usr/share/visualvm/platform -Dawt.useSystemAAFontSettings=on -Xms24m -Xmx768m -Dnetbeans.accept_license_class=org.graalvm.visualvm.modules.startup.AcceptLicense -Dnetbeans.importclass=org.graalvm.visualvm.modules.startup.ImportSettings -Dsun.jvmstat.perdata.syncWaitMs=10000 -Dsun.java2d.noddraw=true -Dsun.java2d.d3d=false -Dorg.netbeans.core.TimeableEventQueue.quantum=360000 -Dpolyglot.js.nashorn-compat=true -Dsun.misc.URLClassPath.disableJarChecking=true -Djdk.attach.allowAttachSelf=true -Dorg.openide.util.ImageUtilities.level=950 --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor.event=ALL-UNNAMED --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED --add-exports=java.desktop/sun.swing=ALL-UNNAMED --add-exports=jdk.attach/sun.tools.attach=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.lang.ref=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.desktop/javax.swing=ALL-UNNAMED --add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED -XX:+IgnoreUnrecognizedVMOptions -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/user/.visualvm/2.1/var/log/heapdump.hprof Compiler: HotSpot 64-Bit Tiered Compilers Heap memory usage: initial 24,0MB maximum 768,0MB Non heap memory usage: initial 7,3MB maximum -1b Garbage collector: G1 Young Generation (Collections=11 Total time spent=0s) Garbage collector: G1 Old Generation (Collections=0 Total time spent=0s) Classes: loaded=6079 total loaded=6079 unloaded 0 INFO [org.netbeans.core.ui.warmup.DiagnosticTask]: Total memory 16.715.952.128 INFO [null]: Total physical memory 16.715.952.128 INFO [org.graalvm.visualvm.attach.AttachModelImpl]: executeJCmd com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file /proc/18340/root/tmp/.java_pid18340: target process 18340 doesn't respond within 10500ms or HotSpot VM not loaded at jdk.attach/sun.tools.attach.VirtualMachineImpl.Desktop:
Additional context