Skip to content

[Bug] HidSharp.LinuxHidManager.GetDeviceKeys crash on Linux with il2cpp backend #315

Closed

Description

@LeZi9916

ref: https://unity3d.atlassian.net/servicedesk/customer/portal/2/IN-151285

#11 NativeMethodsLibudev1_udev_enumerate_unref
#12 LinuxHidManager_GetDeviceKeys
#13 HidManager_GetDevices
#14 HidManager_GetDevices
#15 DeviceList_GetHidDevices
#16 IODetector_Init
#17 GameManager_StartInternal (coroutine)
#18 GameManager_Start
#20 il2cpp::vm::Runtime::InvokeWithThrow

Frames #11-#15 belong to HidSharp: its Linux backend (LinuxHidManager) and its libudev.so.1 P/Invoke bindings (NativeMethodsLibudev1). Frames #16-#19 are your own code, where > IODetector.Init calls into HidSharp from a coroutine started in GameManager.Start.

The double free occurs inside libudev, reached directly from HidSharp's udev_enumerate_unref call. There is no engine code between your script and libudev; the engine's only > involvement is il2cpp::vm::Runtime::Invoke dispatching your MonoBehaviour's Start(). This also explains why the crash is identical with the Input System package and with the > old Input Manager, as HidSharp communicates with libudev directly and does not use Unity's input stack.

Activity

  1. added
    bugSomething isn't working
    linuxIssues specific to Linux
    on Aug 20, 2026
  2. changed the title [-][Linux][Bug] HidSharp.LinuxHidManager.GetDeviceKeys crash on Linux with il2cpp backend[/-] [+][Bug] HidSharp.LinuxHidManager.GetDeviceKeys crash on Linux with il2cpp backend[/+] on Sep 6, 2026
  3. added
    ioIndicates issues related to I/O devices or functionality
    on Oct 3, 2026
  4. LeZi9916 commented on Oct 25, 2026

    @LeZi9916
    MemberAuthor

    fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingioIndicates issues related to I/O devices or functionalitylinuxIssues specific to Linux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions