nyholku / purejavahidapi

Other
121 stars 69 forks source link

Removing device on MacOS Catalina freezes UI and hangs library #74

Open sargue opened 4 years ago

sargue commented 4 years ago

Disconnecting a Ledger USB devices freezes the UI (other parts of the app work fine). A Thread Dump shows this thread that looks like the internal handler for the device removal hang trying to close.

"jfx" #16 daemon prio=5 os_prio=31 cpu=4528.76ms elapsed=570.79s tid=0x00007f80ea1eb000 nid=0x307 in Object.wait()  [0x00007ffee649b000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(java.base@14.0.1/Native Method)
    - waiting on <no object reference available>
    at java.lang.Object.wait(java.base@14.0.1/Object.java:321)
    at purejavahidapi.shared.SyncPoint.waitAndSync(SyncPoint.java:55)
    - locked <0x000000070185df78> (a java.lang.Object)
    at purejavahidapi.macosx.HidDevice.close(HidDevice.java:337)
    - locked <0x000000070185e018> (a purejavahidapi.macosx.HidDevice)
    at purejavahidapi.macosx.HidDevice$HidDeviceRemovalCallback.hid_device_removal_callback(HidDevice.java:238)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@14.0.1/Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@14.0.1/NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@14.0.1/DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(java.base@14.0.1/Method.java:564)
    at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:520)
    at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:551)