oracle / visualvm

VisualVM is an All-in-One Java Troubleshooting Tool
https://visualvm.github.io/
Other
2.88k stars 304 forks source link

NullPointerException on MacOS during startup with DisplayLink #84

Closed andyflatt closed 6 years ago

andyflatt commented 6 years ago

I have been trying to run VisualVM on my mac all morning. I have updated to the latest JDK and am still having issues. Hopefully I missed something simple.

laptop:bin user1$ jvisualvm --jdkhome /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home -J-Dnetbeans.logger.console=true
-------------------------------------------------------------------------------
>Log Session: Tuesday, May 1, 2018 11:51:10 AM BST
>System Info: 
  Product Version         = Java VisualVM
  Operating System        = Mac OS X version 10.13.3 running on x86_64
  Java; VM; Vendor        = 1.8.0_172; Java HotSpot(TM) 64-Bit Server VM 25.172-b11; Oracle Corporation
  Runtime                 = Java(TM) SE Runtime Environment 1.8.0_172-b11
  Java Home               = /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre
  System Locale; Encoding = en_GB (visualvm); UTF-8
  Home Directory          = /Users/user1
  Current Directory       = /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/bin
  User Directory          = /Users/user1/Library/Application Support/VisualVM/8u131
  Cache Directory         = /Users/user1/Library/Caches/VisualVM/8u131
  Installation            = /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/visualvm
                            /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/profiler
                            /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform
  Boot & Ext. Classpath   = /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/classes:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/System/Library/Java/Extensions/MRJToolkit.jar
  Application Classpath   = /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/lib/boot.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/lib/org-openide-modules.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/lib/org-openide-util-lookup.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/lib/org-openide-util.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/lib/locale/boot_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/lib/locale/boot_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-modules_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-modules_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-util-lookup_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-util-lookup_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-util_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-util_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/tools.jar
  Startup Classpath       = /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/core/org-openide-filesystems.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/core/core.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/core/locale/core_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/core/locale/org-openide-filesystems_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/core/locale/org-openide-filesystems_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/platform/core/locale/core_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/visualvm/core/com-sun-tools-visualvm-modules-startup.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/visualvm/core/locale/com-sun-tools-visualvm-modules-startup_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/visualvm/core/locale/core_visualvm.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/visualvm/visualvm/core/locale/com-sun-tools-visualvm-modules-startup_ja.jar
-------------------------------------------------------------------------------
java.lang.NullPointerException
    at java.awt.Window.init(Window.java:497)
    at java.awt.Window.<init>(Window.java:537)
    at java.awt.Frame.<init>(Frame.java:420)
    at org.netbeans.core.startup.Splash.setRunning(Splash.java:119)
    at org.netbeans.core.startup.Main.start(Main.java:257)
    at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:84)
    at java.lang.Thread.run(Thread.java:748)
thurka commented 6 years ago

Do you have external monitor connected via some non-standard graphics card? Are you using DisplayLink?

thurka commented 6 years ago

Closing until more info is available.

andyflatt commented 6 years ago

I have an external monitor connected via DisplayLink using a Dell Docking Station Model D6000.

thurka commented 6 years ago

Try to disconnect DisplayLink USB adapter and start VisualVM. Does it fix the problem?

bobbui commented 6 years ago

I'm having the same problem, I'm using external monitor but not using DisplayLink USB. Any idea how to solve it?

bobbui commented 6 years ago

Managed to fix it by download latest JDK

brunchboy commented 6 years ago

I just moved to a new model MacBookPro, and find that any Java application crashes with a similar NullPointerException when I try to create any Swing windows if I am running in clamshell mode, with my monitors connected by a Belkin Thunderbolt 3 Express dock (one 4K display via HDMI, one LED Cinema Display via DisplayPort).

I updated to the latest releases of JDK 8 and JDK 10, and the same problem occurs. I need to open the laptop for Swing windows to be opened successfully.

Where is the best place to report this bug?

brunchboy commented 6 years ago

(I found where to submit bugs, but now I can’t reproduce the problem any longer. The OS must have been in a weird state. Sorry about the noise here, I will submit the issue in the right place if it recurs.)

h3adache commented 5 years ago

Still running into this using latest jdk 8.

1.8.0_202; Java HotSpot(TM) 64-Bit Server VM 25.202-b08

java.lang.NullPointerException
    at java.awt.Window.init(Window.java:497)
    at java.awt.Window.<init>(Window.java:537)
    at java.awt.Frame.<init>(Frame.java:420)
    at org.netbeans.core.startup.Splash.setRunning(Splash.java:119)
    at org.netbeans.core.startup.Main.start(Main.java:257)
    at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:84)
    at java.lang.Thread.run(Thread.java:748)

Also running multiple monitors with DisplayLink. If I remove it from the dock it's fine, once you connect it back it crashes.

Process:               java [57057]
Path:                  /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/bin/java
Identifier:            net.java.openjdk.cmd
Version:               1.0 (1.0)
Code Type:             X86-64 (Native)
Parent Process:        ??? [56764]
Responsible:           java [57057]
User ID:               501

Date/Time:             2019-01-28 14:57:46.296 -0500
OS Version:            Mac OS X 10.14.2 (18C54)
Report Version:        12
Bridge OS Version:     3.2 (16P2542)
Anonymous UUID:        393F2990-4C37-85A4-0554-6FC58C98EB20

Sleep/Wake UUID:       E0D2829C-49D7-4A81-BA32-7A4B1C2CD5CB

Time Awake Since Boot: 190000 seconds
Time Since Wake:       19000 seconds

System Integrity Protection: enabled

Crashed Thread:        28  Java: Java2D Queue Flusher

Exception Type:        EXC_BAD_ACCESS (SIGABRT)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000003
Exception Note:        EXC_CORPSE_NOTIFY

VM Regions Near 0x3:
--> 
    __TEXT                 0000000106a9a000-0000000106aac000 [   72K] r-x/rwx SM=COW  /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/bin/java

Application Specific Information:
abort() called
PhilippSalvisberg commented 5 years ago

I have the same problem. I've opened a thread in the DisplayLink forum.

The workaround is to keep the MacBook lid open and ensure that mirroring is disabled and the MacBook screen is the primary display (white bar on MacBook in Display Arrangement as shown below).

display_arrangement

thurka commented 5 years ago

@PhilippSalvisberg Maybe this is JDK bug and DisplayLink driver does nothing wrong.

PhilippSalvisberg commented 5 years ago

@thurka maybe. In fact I run the code I've posted in the DisplayLink forum with JDK7, JDK8, JDK11 and JDK12. And guess what? It worked with JDK7 (NPE with other JDKs). This at least indicates, that it could be a JDK issue.

Any idea how to address that properly?

PhilippSalvisberg commented 5 years ago

@thurka fyi: I've opened SR 3-19669687661 : NullPointerException on MacOS during startup of Swing app with DisplayLink dock

thurka commented 5 years ago

Any idea how to address that properly?

You can file JDK bug at https://bugreport.java.com/bugreport/

thurka commented 5 years ago

I've opened SR 3-19669687661

What is SR 3-19669687661?

PhilippSalvisberg commented 5 years ago

SR is a Service Request and the 3-19669687661 is the ticket number . I was told that that's one of the options for Oracle customers.

thurka commented 5 years ago

JDK bug: JDK-8223158

Jezdufourq commented 5 years ago

I have been having the same issue with my setup. I have two external monitors going through a targus dock powered by display link. I am using IntelliJ, and whenever I am building Java apps with Swing, I can't view the swing application window, and it freezes.

thurka commented 4 years ago

The JDK bug JDK-8223158 is fixed in 8u231, 11.0.7 and 13.0.4

dpapukchiev commented 3 years ago

For me, the issue with the startup was resolved when I disconnected the display port ..