Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation Fault on macOS when trying to send keyboard events #98

Closed
AdrianoFerrari opened this issue Dec 5, 2019 · 5 comments
Closed
Assignees
Labels
3rd party Issue is linked to or blocked by 3rd party dependencies

Comments

@AdrianoFerrari
Copy link

AdrianoFerrari commented Dec 5, 2019

Version: 1.3.1

Whenever Travis CI or GitHub Actions on macOS hit the first test that uses nut.js keyboard, I get a segmentation fault:
/Users/travis/.travis/functions: line 113: 6934 Segmentation fault: 11 npm run test
(full Travis log here)

Even going back to my last passing build and re-running it, the same build now fails with a Segmentation fault. Same is true with GitHub actions (see e.g. here).

I played around with moving nut.js calls to keyboard, and each time my tests would fail with a seg fault whenever it hit the first call.

I've been busting my head about this for two days! Any ideas?

For context, all I really want to do is to be able to send keyboard events like "Cmd+S" and "Alt+Cmd+Shift+Y" on macOS from my node.js integration tests. Other libraries have worked for Linux & Windows, but none has worked consistently on macOS.

@s1hofmann
Copy link
Member

Hi @AdrianoFerrari, sorry to see you're running into errors.
Given the fact that a once successful build now fails makes me think something changed on the target platform.

I do not yet have a particular clue what might have happened, but I'll try to investigate on these issues and report back.
Thanks for reporting!

@s1hofmann s1hofmann self-assigned this Dec 11, 2019
@s1hofmann s1hofmann added bug Something isn't working and removed bug Something isn't working labels Dec 11, 2019
@AdrianoFerrari
Copy link
Author

Thanks. That's what I suspected, though it seems odd that both Travis CI and GitHub Actions run into same error. Another theory I had is that some dependency has been updated since the build had passed, and it's now pulling in a different version of it than it did before. (my impression was that having a "package-lock.json" file, and using npm ci would prevent this, but maybe I'm mistaken).

@ajimix
Copy link

ajimix commented Jan 7, 2020

Hello, this happens for this project and for RobotJS (which is a similar project) starting from Node 12.13

So something has changed in node 12.13 that affects both projects.

The solution for anyone who comes to this thread is to use node 12.12 or earlier

@s1hofmann
Copy link
Member

I did spent some time investigating on this issue yesterday evening. The issue persists up until node v13.7.0. I traced the changelog and identified the update to libuv v1.34.1 to solve the issue.

Rebuilding node v12.16.0 (lts/erbium) after an update from libuv v1.34.0 to v1.34.1 solves the issue.

In summary, node versions which are not yet including libuv v1.34.1 are affected by this issue.

@s1hofmann s1hofmann added the 3rd party Issue is linked to or blocked by 3rd party dependencies label Feb 17, 2020
@s1hofmann
Copy link
Member

Update: https://github.com/nodejs/node/tree/v12.16.2-proposal comes with libuv v1.34.2 so this issue might be resolved for node 12 soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party Issue is linked to or blocked by 3rd party dependencies
Projects
None yet
Development

No branches or pull requests

3 participants