Skip to content

Electron, node-hid, Windows 7, segmentation fault on close() #210

Closed

Description

@randomf

Hello,

I'm getting segmentation fault upon close(). Searching, connecting and R/W to the device works fine. I even tried code suggested in https://github.com/node-hid/node-hid/issues/129 without a luck. Same code works on Linux and Mac. Any ideas?

Node 6.11
Windows 7 SP1
Electron 1.4.16
node-hid 0.5.4

Activity

  1. todbot commented on Jun 28, 2017

    @todbot
    Contributor

    Hi, could you show the code you're using both before and after close()?

  2. randomf commented on Jun 28, 2017

    @randomf
    Author

    Hi,

    here it goes:

    device.write(Array.from(new Buffer('020000', 'hex')));
    
    // some code is being processed in the meantime
    
    device.pause();
    device.removeAllListeners("data");
    device.removeAllListeners("error");
    device.close();
    

    There is no node-hid relevant code executed after.

  3. todbot commented on Jun 28, 2017

    @todbot
    Contributor

    What are you doing immediately after close? If you're doing process.exit() or similar you will likely have problems because Node doesn't have time to clean up EventListeners

  4. randomf commented on Jun 28, 2017

    @randomf
    Author

    I'm waiting for an user input in a React application. I don't call process.exit().

  5. pablozandona commented on Jul 6, 2017

    @pablozandona

    Same problem here.

    Node 6.10.3
    Windows 7 SP12
    node-hid 0.5.4

  6. todbot commented on Jul 6, 2017

    @todbot
    Contributor

    Could someone experiencing this issue submit a small complete code example that illustrates the crash?

  7. todbot commented on Nov 23, 2019

    @todbot
    Contributor

    Closing as I am suspecting this issue has been addressed by moving to libusb/hidapi.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions