Exception in LeapC when closing application

#1708 · closed · 17 comments

View on GitHub ↗

daniel-mcguinness-ST

**Describe the bug** When closing an application built with the Ultraleap Tracking 7.3.0, LeapC throws an exception. ``` [Physics::Module] Cleanup current backend. [Physics::Module] Id: 0xf2b8ea05 Input System module state changed to: ShutdownInProgress. Input System polling thread stopped. Input System polling thread exited. Input System module state changed to: Shutdown. Exception: System.Threading.ThreadAbortException: Thread was being aborted. at (wrapper managed-to-native) LeapInternal.LeapC.PollConnection(intptr,uint,LeapInternal.LEAP_CONNECTION_MESSAGE&) at LeapInternal.Connection.processMessages () [0x0005e] in <638f1058d52441a2af5defa3e992ed04>:0 ``` **To Reproduce** This has been tested with Unity 6.3.10f1. 1. Create a new project. 2. Import Ultraleap Tracking 7.3.0. 3. Build and run project. 4. Close application. 5. Application will hang and LeapC exception will be shown in logs. **Expected behavior** Application closes cleanly. **Desktop (please complete the following information):** - OS: Windows 11

Comments

MaxPalmer-UH

We'll take a look at this, thanks for reporting. Might be a few days.

daniel-mcguinness-ST

Thank you! Let me know if there's anymore information I can provide that would help.

rblenkinsopp

I'm hoping this [pull-request](https://github.com/ultraleap/UnityPlugin/pull/1710) will resolve this issue. The thread was aborting due to a lack of a timeout on the `.Join()` operation. @daniel-mcguinness-ST Would you be able to pull this branch and test if it resolves the issue for you?

daniel-mcguinness-ST

Thank you, I will test this today!

daniel-mcguinness-ST

I'm no longer getting the exception in the log, but I'm still seeing the same behavior where the app hangs for several seconds when exiting.

rblenkinsopp

Thank you for testing and sorry it didn't resolve it completely. I'll have to take a more in depth look.

daniel-mcguinness-ST

Has there been any progress on this?

rblenkinsopp

I've done some further work in this PR: https://github.com/ultraleap/UnityPlugin/pull/1713 However I don't expect this to fully fix it (But it might improve the situation). I'm not on Windows at the moment so I can't immediately reproduce this to test fixes. It's possible the issue is in LeapC rather than the UnityPlugin.

daniel-mcguinness-ST

Meant to reply to this earlier, the issue still exists. If this might be an issue in LeapC is there somewhere else I should post about it?

rblenkinsopp

> Meant to reply to this earlier, the issue still exists. If this might be an issue in LeapC is there somewhere else I should post about it? No this is the correct place, and I've resolved a different LeapC issue here which might also be causing this, but I need to do some more testing against it: https://github.com/ultraleap/UnityPlugin/issues/1711, LeapC issues go through a different internal release cycle so it takes a bit longer to get fixes for that in the UnityPlugin.

daniel-mcguinness-ST

Ok, thanks for working on this! Any estimate for when we might see that fix?

MaxPalmer-UH

I'll take a look at the current state on Windows.

MaxPalmer-UH

Sadly, I can't reproduce the error following your steps on my Windows 11 system, after trying for a couple of hours. I'm on the 6.2 release of the tracking software, using Unity 6.3. I've tried creating a basic URP and BiRP project and then added 7.3.0 release and examples. I then build the desktop tracking scene. Looking at the log file for the app when I close, I don't see the exception, just the lines you see above it. Hopefully Rob's changes will fix it for you, but if I can't reproduce the issue, I can't confirm the branch has the fix. @daniel-mcguinness-ST

MaxPalmer-UH

Do you see the exception for every run of the app? What scene are you setting as the start-up scene? What version of the tracking software service are you running against? Are you running the desktop hand tracking (client), HMD or Screentop? Note, I have seen this exception in the past, but can't reproduce it today on this system/setup.

rblenkinsopp

I've just done some more testing on this and I'm correctly suppressed the exception, but I'm still seeing the hang, I've opened a separate sub-issue #1716 to track that part separately.

rblenkinsopp

@daniel-mcguinness-ST #1713 is now updated with multiple fixes, I think this should resolve these issue for you (it has foe me in my testing).

rblenkinsopp

Closing this as fixed by https://github.com/ultraleap/UnityPlugin/pull/1713