Giter Site home page Giter Site logo

Linux: Hanging inside hid_close() about hidapi HOT 3 CLOSED

libusb avatar libusb commented on August 27, 2024
Linux: Hanging inside hid_close()

from hidapi.

Comments (3)

Youw avatar Youw commented on August 27, 2024

I wasn't able to reproduce the original issue, presumably because I don't have a device that would allow me to do so.
I believe there is a race condition, that when hit, may lead to deadlock, when trying to close the device, in case if device submits transfers/interruptions frequently, and device is being closed exactly during successful handling of such transfer.

The fix suggested in #143 kind-of fixes the issue. Kind-of, because it constantly tries not to hit a deadlock, but a race condition is still there, it is a root cause, and we better fix a root cause, not symptoms.

@vozhyk-com would you be able to check a patch I prepared, with your device? https://github.com/libusb/hidapi/tree/libusb-hang

from hidapi.

vozhyk-com avatar vozhyk-com commented on August 27, 2024

I confirm that the patch from branch libusb-hang solves #142 issue. I can not reproduce it with the patch, but easy can reproduce without.

from hidapi.

Youw avatar Youw commented on August 27, 2024

That's awesome news. As I hoped, the root issue found and fixed.

from hidapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.