GithubHelp home page GithubHelp logo

xfer_callback panic about gousb HOT 5 CLOSED

kylelemons avatar kylelemons commented on June 26, 2024
xfer_callback panic

from gousb.

Comments (5)

zagrodzki avatar zagrodzki commented on June 26, 2024

I think you are correct and I've experienced it before as well. It seems to be dependent on the Go and GCC version as far as I can tell. I'll add a fix later, in the meantime, you can try out the new release of the library that solved this problem (in exactly the way you described).

https://github.com/google/gousb

It's not been formally announced yet as the stable replacement, but I think we're getting there.

from gousb.

codido avatar codido commented on June 26, 2024

Ah, good to know, thanks!

from gousb.

codido avatar codido commented on June 26, 2024

btw, I believe there's another similar issue in the code, which google/gousb also experiences:
libusb.alloc stores the buffer (Go pointer) into the allocated xfer structure, which is later on used by C.

from gousb.

zagrodzki avatar zagrodzki commented on June 26, 2024

I think you're right - the xfer struct is C memory (allocated by libusb), &buf[0] is a Go pointer, and "Go code may not store a Go pointer in C memory". It seems like the buffer should be initialized from the C side, since then the ownership of the buffer would be controlled by the C code and the problem would go away. I'll try to fix it sometime soon.

from gousb.

zagrodzki avatar zagrodzki commented on June 26, 2024

google/gousb fixed in google/gousb#11

Since kylelemons/gousb was now officially marked as deprecated, I'll close this issue, since I won't be doing any more bugfixes in this code.

from gousb.

Related Issues (18)

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.