Skip to content

[BUG] App crashes in production on MacOS when inserting/removing YubiKey (callback on garbage collector delegate) #320

@vanillaFriday

Description

@vanillaFriday

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When using a function to access the YubiKey (e.g. YubiKeyDevice.FindAll(); or otpSession.CalculateChallengeResponse(Slot.ShortPress)) deploy the app on MacOs and plug in or out a YubiKey it crashes immediately. Starting the app from the terminal I have following error message:

Process terminated. A callback was made on a garbage collected delegate of type 'Yubico.Core!Yubico.PlatformInterop.NativeMethods+IOHIDDeviceCallback::Invoke'.
at Yubico.PlatformInterop.NativeMethods.CFRunLoopRunInMode(IntPtr, Double, Boolean)
at Yubico.Core.Devices.Hid.MacOSHidDeviceListener.ListeningThread()
at System.Threading.Thread+StartHelper.Callback(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
zsh: abort

I do have crashes as well when inserting/removing other non YubiKey devices. On Windows or with no YubiKey access on MacOs the app is stable.

Running the app in Rider does not lead to this error.

Expected Behavior

Using a Yubikey should not crash the app in production environment on MacOs.

Steps To Reproduce

I tried to simulate this behavior in a simple app but with no success -> here it's working fine. So I have no idea where the problem excatly comes from in more complex apps.

Version

1.14.0

Version

5.4.3

Anything else?

I use a MacBookPro with M1 chip and MacOS Sequoia v15.5

The app is a .NET 9.0 app for MacOs and Windows using Avalonia UI and MVVM Community Toolkit.

Any help how to deal with this (maybe there is a temporary work around possible) would be really helpfull!

Metadata

Metadata

Assignees

No one assigned

    Labels

    added to internal trackerWhen the issue has been added to our internal issue trackerbugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions